1、insert:
插入一条sql语句是如果有time字段可以在sql中直接用CURRENT_TIMESTAMP()函数;
2、query:
查询sql语句如果字段中有time字段需要对时间进行格式化data_format(字段名,'%Y-%m-%d %H:%i:%s');
查询时间段时可以用between str_to_date(字段名,'%Y-%m-%d %H:%i:%s') and str_to_date(字段名,'%Y-%m-%d %H:%i:%s');
分页查询可以用LIMIT #{开始行数},#{结束行数}
例:select 字段 from 表名 where 条件 LIMIT #{开始行数},#{结束行数}
模糊查询:字段 like concat('%',字段,'%')
批量查询用:
select 字段 from 表名 where 条件 and <foreach collection="list" separator="," close=")" open="(" item="字段名">#{参数}</foreach>