Open
Description
Feature request
In daily query, only the key of the map can be defined. I hope that the value of the map can also be defined, which can be returned directly Map<Integer, Integer>
public interface NoticeMapper {
@MapKey("status")
@MapValue("count")
Map<Integer, Integer> groupStatus();
}
<mapper namespace="org.apache.ibatis.submitted.mapkey_value.NoticeMapper">
<resultMap id="groupStatusMap" type="hashmap">
<result column="count" javaType="Integer" property="count"/>
<result column="status" javaType="Integer" property="status"/>
</resultMap>
<select id="groupStatus" resultMap="groupStatusMap">
select count(*) as count , status
from notice group by status
</select>
</mapper>
Metadata
Metadata
Assignees
Labels
No labels