mybatis没有if test else的写法,只能用choose when :
D:\szw\zjy-v2\com.cloud.apps\src\main\resources\mapper\exam\TbSchoolExamMapper.xml
<choose>
<when test="classList.size()>0">
AND tsa.CLASS_GID IN
<foreach collection="classList" item="item" index="index" open="(" separator="," close=")">
#{item.classGid}
</foreach>
</when>
<otherwise>
AND tsa.CLASS_GID IN ('')
</otherwise>
</choose>