MyBatis的in查询
程序员文章站
2024-03-06 21:56:02
...
Mapper层的文件
List<PowerbiShowHistory> selectList(@Param(value = "stringList") List<String> stringList, @Param(value = "userCode") String userCode);
XML文件的内容
<select id="selectList" resultMap="BaseResultMap">
SELECT * FROM powerbi_show_history
where SHOW_GRUOUP_NAME in
<foreach item="item" index="index" collection="stringList" open="(" separator="," close=")">
#{item}
</foreach>
and CREATE_USERCODE=#{userCode}
and STATE='1'
</select>
下一篇: Java实现拖拽列表项的排序功能