mybatis-mysql-like,if,时间大于小于的判断
来源:互联网 发布:淘宝如何查看买家评价 编辑:程序博客网 时间:2024/06/09 16:26
1.if
mybatis的xml 中 if 的判断一般 是string和int这2种
string 一般是用 status_order != '' and status_order != null and status_order != ‘null’
int 一般是status_order != 0 and status_order==5
2.like
mybatis的xml 中 like 的写法是 多个concat 函数 例如:name like concat(“%”,#{name},“%”)
3.时间大于小于
mybatis的xml 中 时间判断一般 这样写 >大于 <小于 >=大于等于 <=小于等于
and m.order_status >= 5 and m.order_status < 8
<select id="listQueryCommodity" resultMap="OrderForm" parameterType="com.web.bean.WscOrderForm">select m.*,s.name from dxw_mall.m_order_form m,dxw_mall.m_address s where s.id=m.address_content_id <if test="status_order != '' and status_order != null and status_order != 0 and status_order != 2">and m.order_status = #{status_order}</if> <if test="status_order == 2" >and (m.order_status >=8 and m.order_status <=11 or m.order_status =2)</if><if test="status_order == 0" >and m.order_status = 0</if><if test="status_text !=0 and status_text != 5 and status_text != 2 and status_text != '' and status_text != null">and m.order_status = #{status_text}</if><if test="status_text == 0 " >and m.order_status = 0</if><if test="status_text == 2 ">and (m.order_status >=8 and m.order_status <=11 or m.order_status =2)</if><if test="status_text == 5 ">and m.order_status >= 5 and m.order_status < 8</if><if test="starTime != '' and starTime != null">and m.time >= #{starTime}</if><if test="endTime != '' and endTime != null">and m.time <= #{endTime}</if><if test="qname != '' and qname != null">and (s.name like CONCAT('%',#{qname},'%') OR s.phone like CONCAT('%',#{qname},'%') OR m.order_number like CONCAT('%',#{qname},'%'))</if>ORDER BY time desc</select>
阅读全文
0 0
- mybatis-mysql-like,if,时间大于小于的判断
- mybatis大于小于的转义
- mybatis大于小于的转义
- mybatis大于小于的转义
- mybatis大于小于的转义
- mybatis大于小于的转义
- Mybatis大于小于的转义
- mybatis大于小于的转义
- mybatis xml文件中的大于、小于、及like模糊查询的写法
- mybatis xml文件中的大于、小于、及like模糊查询的写法
- 比较两个数a、b的大小,不能使用大于/小于、if、switch,?:等判断语句
- 比较两个数a、b的大小,不能使用大于/小于、if、switch,?:等判断语句
- mybatis中 大于小于的写法
- mybatis if 条件判断 = like
- mybatis 小于大于转移
- mybatis 时间判断 if else
- shell的if else 以及大于,小于等逻辑表达式
- shell的if else 以及大于,小于等逻辑表达式
- Ubuntu上安装RED5服务器
- vivo面试
- leet code 008:atoi 字符串转整型数
- java读取txt文件乱码解决方案
- cocos Creator js 房卡麻将/血战/H5四川麻将源码下载搭建
- mybatis-mysql-like,if,时间大于小于的判断
- 最新县及县以上行政区划代码(截止2016年7月31日)
- spark 错误
- centos升级openssh
- 【Web前端学习笔记】Javascript_04_BOM,DOM思想,正则表达式
- MySQL数据库优化的八种方式(经典必看)
- 2240:Arbitrage
- app代码混淆规则
- 我的第一个vue