OperationLogMapper.xml
2.7 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?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="com.sibu.orderHelper.integral.web.dao.IMOperationLogDao">
<resultMap type="com.sibu.orderHelper.integral.model.OperationLog" id="listOperationLog">
<id column="id" property="id"/>
<result column="operation_user" property="operationUser" />
<result column="operation_type" property="operationType" />
<result column="operation_object" property="operationObject" />
<result column="operation_date" property="operationDate" />
<result column="operation_content" property="operationContent" />
</resultMap>
<!-- 保存日志 -->
<insert id="save" parameterType="com.sibu.orderHelper.integral.model.OperationLog">
INSERT INTO `operation_log` (
`operation_user`,
`operation_type`,
`operation_object`,
`operation_date`,
`operation_content`
)
VALUES
(
#{operationUser},
#{operationType},
#{operationObject},
#{operationDate},
#{operationContent}
) ;
</insert>
<select id="operationPager" parameterType="map" resultMap="listOperationLog">
select * from operation_log
where operation_type=#{operationType}
<if test="operationUser != null and operationUser != ''">
AND operation_user LIKE concat('%',#{operationUser},'%')
</if>
<if test="operationObject != null and operationObject != ''">
AND operation_object LIKE concat('%',#{operationObject},'%')
</if>
<if test="operationContent != null and operationContent != ''">
AND operation_content LIKE concat('%',#{operationContent},'%')
</if>
<if test="startDate != null and startDate != ''">
AND operation_date >= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
<![CDATA[
AND operation_date <= #{endDate}
]]>
</if>
ORDER BY operation_date DESC
LIMIT ${pageNow}, ${pageSize}
</select>
<select id="totalOperation" parameterType="map" resultType="int">
select count(id) from operation_log
where operation_type=#{operationType}
<if test="operationUser != null and operationUser != ''">
AND operation_user LIKE concat('%',#{operationUser},'%')
</if>
<if test="operationObject != null and operationObject != ''">
AND operation_object LIKE concat('%',#{operationObject},'%')
</if>
<if test="operationContent != null and operationContent != ''">
AND operation_content LIKE concat('%',#{operationContent},'%')
</if>
<if test="startDate != null and startDate != ''">
AND operation_date >= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
<![CDATA[
AND operation_date <= #{endDate}
]]>
</if>
</select>
</mapper>