MyBatis规则xml中<if>标签判断字符串相等怎么写
SELECT count(1) from energy_alarm_loss_info where hier_id = #{hierId} and date_type = #{dateType} <if test="dateType == '日'.toString()"> and date(create_time) = date(sysdate()) </if> <if test="dateType == '月'.toString()"> and year(create_time) = year(sysdate()) and month(create_time) = month(sysdate()) </if>
如果还不行,就写下面这样:
<if test="dateType.toString() == '日'.toString()">

浙公网安备 33010602011771号