Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.ArrayList and java.lang.String
翻译过来就是
原因:java.lang.IllegalArgumentException:无效比较:java.util.ArrayList和java.lang.String
这个情况在list集合查找数据的sql中出的问题,在接受list的时候加了判断 list!='' ,引起了集合与String类型的比较
<choose> <when test="names!= null and names.size!=''"> and name in <foreach collection="names" item="name" index="index" open="(" close=")" separator=","> #{name} </foreach> </when> <otherwise> and name= '' </otherwise> </choose>
换成
<choose> <when test="names!= null and names.size>0"> and name in <foreach collection="names" item="name" index="index" open="(" close=")" separator=","> #{name} </foreach> </when> <otherwise> and name= '' </otherwise> </choose>
本文来自博客园,作者:King-DA,转载请注明原文链接:https://www.cnblogs.com/qingmuchuanqi48/p/14106493.html