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 天前
Jackson处理和mybatis的xml转换问题
xml·jackson·mybatis·javatype
tianyuanwo17 天前
深入解析 RISC-V 虚拟化中的 UEFI 固件配置:从 XML 到 NVRAM 的生命周期管理
xml·linux·risc-v
糖果店的幽灵20 天前
软件测试接口测试从入门到精通:常见接口类型与数据格式
xml·软件测试·json·接口测试·数据格式
摇滚侠20 天前
SpringMVC 入门到实战 配置类替换 XML 配置文件 86-91
xml·java·后端·spring·maven·intellij-idea
就叫_这个吧21 天前
IDEA Mybatis xml文件,实现sql语句联想,自动填入补充
xml·mysql·intellij-idea·mybatis
范什么特西21 天前
配置文件xml和properties
xml·前端
曹牧23 天前
Oracle:xml转义
xml·数据库·oracle
曹牧23 天前
Java:XML转义
xml·java·开发语言
摇滚侠23 天前
Spring 零基础入门到进阶 基于注解管理 Bean 38-43
xml·java·后端·spring·intellij-idea
San813_LDD23 天前
[深度学习] 数据序列化格式对比:以日志级别配置为例
xml·java·前端