Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add MapValue annotation #2863

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

add MapValue annotation #2863

wants to merge 3 commits into from

Conversation

min1854
Copy link

@min1854 min1854 commented Apr 10, 2023

I want to be able to define the value of the map in addition to the key of the map, Implemented through the MapValue annotation, And it doesn't affect the original MapKey annotation

#2865

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>

@min1854 min1854 changed the title MapValue annotation add MapValue annotation Apr 12, 2023
@min1854 min1854 mentioned this pull request Apr 15, 2023
@litian-98
Copy link

好好好,今天刚好碰到这个问题,希望尽早合并

@itssChnnree
Copy link

想要这个功能好久了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants