mybatis

Vo包

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

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>")

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄