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

相关推荐
Andy工程师4 小时前
logback-spring.xml优先级更高
xml·spring·logback
小江村儿的文杰5 小时前
UE4在MacOS上将Commit.gitdeps.xml设为Git LFS文件的潜在弊端
xml·ue4
humstone8 小时前
基于xml 和sql 实现自定义报表查询
xml·数据库·sql
就叫飞六吧1 天前
考古spring.xml注册bean无法扫描目录问题
xml·java·spring
Star abuse1 天前
XML转YOLO格式数据集教程
xml·人工智能·yolo
gAlAxy...2 天前
MyBatis 核心配置文件 SqlMapConfig.xml 全解析
xml·mybatis
编程修仙3 天前
第十一篇 Spring事务
xml·java·数据库·spring
金士顿3 天前
Ethercat耦合器添加的IO导出xml 初始化IO参数
android·xml·java
烤麻辣烫4 天前
黑马程序员苍穹外卖后端概览
xml·java·数据库·spring·intellij-idea
暗碳4 天前
安卓abx二进制xml文件转换普通xml文件
android·xml