1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.wisenergy.chnmuseum.party.mapper.TOperationLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.TOperationLog">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="area" property="area"/>
<result column="operation_type" property="operationType"/>
<result column="create_time" property="createTime"/>
<result column="user_name" property="userName"/>
<result column="start_date" property="startDate"/>
<result column="end_date" property="endDate"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, user_id, area, operation_type, create_time
</sql>
<select id="pageList" resultMap="BaseResultMap">
SELECT o.*,u.user_name
FROM t_operation_log o
left join t_user u on o.user_id = u.id
where 1=1
<if test=" operationLog.userName != null and operationLog.userName != '' ">
and u.user_name like concat('%', #{operationLog.userName}, '%')
</if>
<if test=" operationLog.startDate != null">
and o.create_time <![CDATA[>=]]> #{operationLog.startDate}
</if>
<if test=" operationLog.endDate != null">
and o.create_time <![CDATA[<=]]> #{operationLog.endDate}
</if>
</select>
</mapper>