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

相关推荐
DevOpenClub7 小时前
PDF 多格式解析如何避免混用输出:TEXT、HTML、XML 与 TAG 数据契约
xml·前端·数据库·pdf·html
Java小白笔记12 小时前
MyBatis XML Mapper 标签与 CRUD 原理实战
xml·数据库·mybatis
风萧萧19991 天前
JAVA :JSONObject转换为XML
xml·java·python
马优晨3 天前
pom.xml 中 jquery webjars 依赖解释
xml·前端·jquery·jquery webjars·webjars依赖
楚识科技4 天前
定制 OCR 服务:非标证件与表格的 XML 字段映射实践
xml·ocr
光泽雨5 天前
JSON /XML转换
xml·json
我命由我123456 天前
UI 设计 7 种排列方式
xml·学习·ui·html·产品运营·产品经理·学习方法
ly768912 天前
XML 从入门到实践:语法、命名空间、XPath、XSD 与 Java 安全解析
xml·java·python
欧特克_Glodon14 天前
OpenCV计算机视觉开发入门与实践<十二>:XML 和 YAML 文件读写
xml·c++·opencv·计算机视觉