java.lang.IllegalArgumentException: invalid comparison: java.util.ArrayList and java.lang.String
先把代码贴上:
<if test="sectionList != null and sectionList != '' ">
AND a.SectionID in
<foreach item="item" index="index" collection="sectionList" open="("
separator="," close=")">
#{item}
</foreach>
</if>
java.util.ArrayList and java.lang.String,刚发现问题以为是代码写错了,仔细看发现是ArrayList String转换问题。
原因在if里
修改为:
<if test="sectionList != null and sectionList.size > 0">
size判断,list大小。
OK,问题解决问题。