欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 教育 > 锐评 > xml 取值错误 #{} boolean 一直为 false

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

2024/10/24 6:32:37 来源:https://blog.csdn.net/zphuangtang/article/details/139478818  浏览:    关键词:xml 取值错误 #{} boolean 一直为 false

取值时

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

 <select id="findPageOaReading" resultType="com.focusin.data.office.func.dto.ProcessMessageInfoDTO">select i.*, t.template_name procdefNamefrom process_message_info iinner join process_oa_template t on i.process_oa_template_id = t.idwhere i.del_flag = 0 and i.status = 1and 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

在这里插入图片描述

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com