关于前端传以逗号分割的字符串的接收


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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM