mybatis条件in的用法
解决方法:
xml文件:
<if test="universalcodes != null and universalcodes.size()!=0">
and b.universalcode in
<foreach item="item" index="index" collection="universalcodes" open="(" separator="," close=")">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
java代码:
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("universalcodes",universalcodes);
其中universalcodes是List<String>