首页 > 数据库技术 > 详细

java动态条件查询sql语句

时间:2018-07-06 11:11:39      阅读:273      评论:0      收藏:0      [点我收藏+]
select
*
from
table
where
1=1
<if test="tUserId!=null and tUserId!=‘‘">
and t_user_id=#{tUserId}
</if>
<if test="toolCode!=null and toolCode!=‘‘">
and .tool_code=#{toolCode}
</if>
<if test="workCode!=null and workCode!=‘‘">
and work_code=#{workCode}
</if>
<if test="bDate!=null and bDate!=‘‘">
and b_date>#{bDate}
</if>

java动态条件查询sql语句

原文:http://blog.51cto.com/10972685/2136975

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!