异常: java.lang.IllegalArgumentException: invalid comparison
Error querying database.
Cause: java.lang.IllegalArgumentException: invalid comparison:
com.*.module.bean.enums.Enum_BusinessStage and java.lang.String
说明: 在Mapper.xml中对非字符串类型的数据进行了是否为空判断,只有字符串才需要非空判断
错误写法:因为department是一个类对象,并不是字符串类型
<if test="department!=null and department!=''">
and department like concat('%',concat(#{department.department},'%'))
</if>
正确写法:细节需要注意一下
<if test="department.department!=null and department.department!=''">
and department like concat('%',concat(#{department.department},'%'))
</if>