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

9 篇文章 0 订阅
5 篇文章 0 订阅

取值时

#{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

在这里插入图片描述

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

dlage

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值