error
java.lang.IllegalArgumentException: invalid comparison:
java.util.LinkedHashMap and java.lang.String
reason
if test 里面不需要添加#{},只需要填入参数即可。
code
<mapper namespace="com.bjsxt.mapper.IncomeMapper">
<select id="findIncomeByCondition" resultType="Income">
SELECT * from income
<where>
<if test="startTime != null and startTime != '' and stopTime != null and stopTime != ''">
icdate BETWEEN #{startTime} AND #{stopTime}
</if>
<if test="startTime != null and startTime != '' and (stopTime == null || stopTime == '')">
and icdate >= #{startTime}
</if>
<if test="(startTime == null || startTime == '') and stopTime != null and stopTime != ''">
and icdate <= #{stopTime}
</if>
<if test="ictype != null and ictype != ''">
and ictype= #{ictype}
</if>
</where>
</select>
</mapper>