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

相关推荐
sunnyday04262 小时前
Spring Boot 日志配置详解:log4j2.xml 的完整配置指南
xml·spring boot·log4j
熊出没4 小时前
关于MyBatis Mapper 接口与 XML 映射机制的分析
xml·microsoft·mybatis
她说..1 天前
FIND_IN_SET()方法
xml·java·spring boot
北辰当尹2 天前
xml基础
android·xml
qqqahhh5 天前
xml文件的动态化配置,导入
xml·spring·springboot
吴声子夜歌5 天前
Maven——pom.xml详解
xml·java·maven
iSee8576 天前
struts2 XML外部实体注入漏洞复现(CVE-2025-68493)
xml·安全·struts2
爱吃土豆的马铃薯ㅤㅤㅤㅤㅤㅤㅤㅤㅤ7 天前
mapper.xml中的大于等于、小于等于
xml
问水っ8 天前
Qt Creator快速入门 第三版 第17-2章 XML
xml
独断万古他化8 天前
【MyBatis 深度解析】注解操作与 XML 配置:增删改查全流程实现
xml·java·spring·mybatis