mybatis返回Map<Long,Object>
程序员文章站
2022-03-01 12:37:01
...
接口写@Mapkey(‘字段属性’)
@MapKey("sourceId")
Map<Long, MainTainInfoVO> selectBySourceIdsAndMaintainSource(@Param("alarmIdList") List<Long> alarmIdList, @Param("maintainSource") int maintainSource);
<select id="selectBySourceIdsAndMaintainSource" resultMap="BaseResultMapVO">
select
<include refid="Base_Column_List_VO"/>
from bs_maintain_info_t mt
<where>
mt.maintain_source = #{maintainSource,jdbcType=INTEGER}
and
<if test="alarmIdList !=null and alarmIdList.size()>0">
mt.source_id in
<foreach item="item" index="index" collection="alarmIdList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
上一篇: nvm的使用