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 小时前
XML 序列化与操作详解笔记
xml·前端·笔记
阿华的代码王国3 天前
【Android】适配器与外部事件的交互
android·xml·java·前端·后端·交互
阿华的代码王国3 天前
【Android】RecyclerView复用CheckBox的异常状态
android·xml·java·前端·后端
DavieLau4 天前
C#项目WCF接口暴露调用及SOAP接口请求测试(Python版)
xml·服务器·开发语言·python·c#
曹牧4 天前
XML头部声明发送者信息的实现方法
xml
寒士obj5 天前
熟悉并使用Spring框架 - XML篇
xml·java·spring
Arva .6 天前
Spring基于XML的自动装配
xml·java·spring
fatfishccc6 天前
循序渐进学 Spring (上):从 IoC/DI 核心原理到 XML 配置实战
xml·java·数据库·spring·intellij-idea·ioc·di
fatfishccc10 天前
【MyBatis新手避坑】详解 `Could not find resource ...Mapper.xml` 错误
xml·intellij-idea·mybatis
helloworld工程师10 天前
Dubbo应用开发之基于xml的第一个Dubbo程序
xml·dubbo·safari