主要是在java的.xml文件中的sql写法(涉及sql语法)
- 日期类型char和date转化
date转为char:to_char(createdate , 'dd/MM/yyyy hh24:mi:ss')
char转为date:to_date(ct , 'dd/MM/yyyy hh24:mi:ss')
注:系统时间 SYSDATE
- if判断
SELECT 列
FROM 表名
WHERE 1=1
<if test='if判断条件'>AND 条件</if>
<!--例如-->
<if test='key=="1"'>AND SYSDATE - to_date(ct,'dd/MM/yyyy hh24:mi:ss')</if>
<if test="userid!=null and uesrid !=''">AND userid like '%${userid}%'</if>
- (后面再补充)