xml 取值错误 #{} boolean 一直为 false

取值时

#{param.msgStatus} 一直是false,java代码里面显示true。

sql 复制代码
 <select id="findPageOaReading" resultType="com.focusin.data.office.func.dto.ProcessMessageInfoDTO">
        select i.*, t.template_name procdefName
        from process_message_info i
                          inner join process_oa_template t on i.process_oa_template_id = t.id
        where i.del_flag = 0 and i.status = 1

            and i.receive_user = #{param.receiveUser}
            and i.data_type in (1, 2, 3, 4)
            and i.msg_status = #{param.msgStatus}
            <if test="param.processTitle!=null and param.processTitle!=''">
                and i.process_title like concat(#{param.processTitle}, '%')
            </if>
            <if test="param.tenant!=null and param.tenant!=''">
                and i.tenant = #{param.tenant}
            </if>

            <if test="param.sendUser!=null and param.sendUser!=''">
                and i.send_user = #{param.sendUser}
            </if>

            <if test="param.templateName!=null and param.templateName!=''">
                and t.template_name like CONCAT(#{param.templateName},'%')
            </if>

        <if test="param.receiveBeginTime!=null and param.receiveEndTime!=null">
            and i.create_time between #{param.receiveBeginTime} and #{param.receiveEndTime}
        </if>
        <if test="param.msgStatus == true and param.operateBeginTime!=null and param.operateEndTime!=null">
            and i.update_time between #{param.operateBeginTime} and #{param.operateEndTime}
        </if>


    </select>

问题原因:判断boolean类型时不能用 param.msgStatus = 1 ,不然会使得 #{param.msgStatus} 取值一直为false

相关推荐
超级小忍1 天前
在 Spring Boot 中使用 MyBatis 的 XML 文件编写 SQL 语句详解
xml·spring boot·mybatis
你我约定有三2 天前
spring--xml注入时bean的property属性
xml·java·spring
12345,catch a tiger2 天前
实用技巧 Excel 与 XML互转
xml
24kHT2 天前
xml映射文件的方式操作mybatis
xml·mybatis
石头wang3 天前
xml 知识总结: xsd,xsi:schemaLocation,xmlns,xmlns:xsi
xml
人生在勤,不索何获-白大侠3 天前
day21——特殊文件:XML、Properties、以及日志框架
xml·java·开发语言
代码的余温3 天前
Spring Boot集成Logback日志全攻略
xml·spring boot·logback
代码的余温4 天前
Logback.xml配置详解与实战指南
xml·logback
wen's4 天前
React Native安卓刘海屏适配终极方案:仅需修改 AndroidManifest.xml!
android·xml·react native
面朝大海,春不暖,花不开5 天前
结构化数据格式解析:JSON 与 XML 的技术应用与实践
xml·json