xml 取值错误 #{} boolean 一直为 false

取值时

#{param.msgStatus} 一直是false,java代码里面显示true。

 <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. 啥python’hello‘>‘world‘是false

    2024-06-09 17:06:01       11 阅读
  2. Boolean test介绍

    2024-06-09 17:06:01       8 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-06-09 17:06:01       8 阅读
  2. 【Python教程】压缩PDF文件大小

    2024-06-09 17:06:01       9 阅读
  3. 通过文章id递归查询所有评论(xml)

    2024-06-09 17:06:01       10 阅读

热门阅读

  1. Django中drf动态过滤查询

    2024-06-09 17:06:01       9 阅读
  2. 006 RabbitMQ

    2024-06-09 17:06:01       10 阅读
  3. 记录一次jlink连不上cpu的情况

    2024-06-09 17:06:01       9 阅读
  4. wordpress网站建设详细过程

    2024-06-09 17:06:01       6 阅读
  5. 移动端前端开发遇到过的Andorid和IOS的差异记录

    2024-06-09 17:06:01       8 阅读
  6. Audio音频资源播放

    2024-06-09 17:06:01       8 阅读
  7. springboot + easyRules 搭建规则引擎服务

    2024-06-09 17:06:01       8 阅读
  8. AI学习的基础理论路径

    2024-06-09 17:06:01       5 阅读
  9. es6 proxy的作用和用法

    2024-06-09 17:06:01       6 阅读
  10. 简单记录个python国内镜像源

    2024-06-09 17:06:01       5 阅读