ibatis mysql数据库 模糊查询 时间大小比较
来源:互联网 发布:晋城广电网络 编辑:程序博客网 时间:2024/04/29 13:37
<resultMap id="logResult" class="com.frame.vo.log.LogVo" >
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="operationType" column="operation_type" />
<result property="operationContent" column="operation_content" />
<result property="operationDate" column="operation_date" />
</resultMap>
<!-- getLogForPage查询where条件 -->
<sql id="queryLogWhere">
<dynamic prepend="where">
<isNotEmpty prepend="and" property="id">
t.id=#id#
</isNotEmpty>
<isNotEmpty prepend="and" property="userId">
t.user_id like concat('%',#userId#,'%')
</isNotEmpty>
<isNotEmpty prepend="and" property="operationType">
t.operation_type like concat('%',#operationType#,'%')
</isNotEmpty>
<isNotEmpty prepend="and" property="operationContent">
t.operation_content=#operationContent#
</isNotEmpty>
<isNotEmpty prepend="and" property="logDateStart">
<![CDATA[t.operation_date>=#logDateStart#]]>
</isNotEmpty>
<isNotEmpty prepend="and" property="logDateEnd">
<![CDATA[t.operation_date<=#logDateEnd#]]>
</isNotEmpty>
</dynamic>
order by t.operation_date desc
</sql>
<!-- getLogForPage查询入口 -->
<select id="queryLog" parameterClass="java.util.HashMap" resultMap="logResult">
select id, user_id, operation_type, operation_content, operation_date from t_m_log t
<include refid="queryLogWhere" />
<dynamic prepend="">
<isNotNull property="limitStart">
<isNotNull property="limitSize">
limit #limitStart#, #limitSize#
</isNotNull>
</isNotNull>
</dynamic>
</select>
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="operationType" column="operation_type" />
<result property="operationContent" column="operation_content" />
<result property="operationDate" column="operation_date" />
</resultMap>
<!-- getLogForPage查询where条件 -->
<sql id="queryLogWhere">
<dynamic prepend="where">
<isNotEmpty prepend="and" property="id">
t.id=#id#
</isNotEmpty>
<isNotEmpty prepend="and" property="userId">
t.user_id like concat('%',#userId#,'%')
</isNotEmpty>
<isNotEmpty prepend="and" property="operationType">
t.operation_type like concat('%',#operationType#,'%')
</isNotEmpty>
<isNotEmpty prepend="and" property="operationContent">
t.operation_content=#operationContent#
</isNotEmpty>
<isNotEmpty prepend="and" property="logDateStart">
<![CDATA[t.operation_date>=#logDateStart#]]>
</isNotEmpty>
<isNotEmpty prepend="and" property="logDateEnd">
<![CDATA[t.operation_date<=#logDateEnd#]]>
</isNotEmpty>
</dynamic>
order by t.operation_date desc
</sql>
<!-- getLogForPage查询入口 -->
<select id="queryLog" parameterClass="java.util.HashMap" resultMap="logResult">
select id, user_id, operation_type, operation_content, operation_date from t_m_log t
<include refid="queryLogWhere" />
<dynamic prepend="">
<isNotNull property="limitStart">
<isNotNull property="limitSize">
limit #limitStart#, #limitSize#
</isNotNull>
</isNotNull>
</dynamic>
</select>
0 0
- ibatis mysql数据库 模糊查询 时间大小比较
- mybatils 数据库时间模糊查询
- 【数据库】——mysql比较时间大小,精确到秒
- MySQL数据库的模糊查询
- Mysql 数据库模糊查询定位
- MySQL查询数据库大小
- Pg数据库比较时间大小
- mysql 时间日期比较大小
- iBatis的模糊查询
- IBATIS模糊查询
- Ibatis模糊查询
- ibatis中的模糊查询
- ibatis模糊查询(like)
- Ibatis字段模糊查询
- ibatis模糊查询
- iBatis like模糊查询
- ibatis模糊查询
- mysql数据库比较时间
- 常见Nandflash芯片及厂商总结
- SSH2开发回顾总结(一)
- P51 第二章 第14题 潘璠
- mysql 复制表数据到原表
- RamDisk有三种实现方式
- ibatis mysql数据库 模糊查询 时间大小比较
- iOS块语法详解(block编程)
- 几种R语言中文分词工具安装尝试
- C++中引用(&)的用法和拷贝/赋值函数的区别
- P51第15题
- AngularJS开发人员最常犯的10个错误
- linux上面下载文件到本地的命令
- Hibernate懒加载错误
- mysql 下载数据库文件到本地