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

相关推荐
研來如此4 天前
tinyxml2 常用读取接口对照表
xml·c++·tinyxml2
pupudawang5 天前
使用 Logback 的最佳实践:`logback.xml` 与 `logback-spring.xml` 的区别与用法
xml·spring·logback
jf加菲猫5 天前
第10章 数据处理
xml·开发语言·数据库·c++·qt·ui
Java成神之路-5 天前
序列化协议全解析:XML、SOAP、JSON 与 Protobuf 实战对比及 Protobuf 演进方案
xml·json
帅次5 天前
WebView 并发初始化竞争风险分析
android·xml·flutter·kotlin·webview·androidx·dalvik
程序员小崔日记7 天前
一篇文章带你入门漏洞靶场:从 0 到 1 玩转 bWAPP(附完整安装教程)
xml·网络安全·漏洞学习·靶场搭建
xuhaoyu_cpp_java8 天前
XML学习
xml·java·笔记·学习
Riu_Peter10 天前
【技术】Maven 配置 settings.xml 轮询下载
xml·java·maven
それども10 天前
Mybatis xml 执行提示 NoSuchPropertyException
xml·mybatis
E_ICEBLUE10 天前
在 Python 中转换 XML 为 PDF 文档:基础转换与转换设置
xml·python·pdf