mybatis中使用动态sql,报错: invalid comparison: java.util.ArrayList and java.lang.String] with root cause
是由于 list != ' ' 导致的,引起了集合与string类型的比较
<if test="lsit != null and list != ''"> B.COMMID IN ( <foreach collection="list" item="commId" index="index" separator=","> #{commId,jdbcType=VARCHAR} </foreach> ) </if>
修改为
<if test="lsit != null and list.size > 0"> B.COMMID IN ( <foreach collection="list" item="commId" index="index" separator=","> #{commId,jdbcType=VARCHAR} </foreach> ) </if>