mybatis
Vo包
public class OutPayLogGroupByOutIdVo {
private List<String> feeItem;
}
xml里面的写法
<if test="feeItem != null and feeItem.size>0">
AND log.fee_item in
<foreach item="feeItem" index="index" collection="feeItem" open="("
separator=","
close=")">
#{feeItem}
</foreach>
</if>
直接传参数的
List<Map<String, Object>> selectTFInfoByList(@Param("list")List<String> list, @Param("type")String type)
@Select("<script>"
+ " SELECT * "
WHERE aaa IN "
+ " <foreach item='list' index='index' collection='list' open='(' separator=',' close=')'>"
+ " #{list}"
+ " </foreach>"
+ " </script>")