McOperationLogMapper.xml
4.78 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
82
83
84
85
86
87
88
89
90
91
92
93
<?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.chinagas.modules.schsf.mapper.McOperationLogMapper">
<resultMap type="com.chinagas.modules.schsf.domain.McOperationLog" id="McOperationLogResult">
<result property="id" column="id" />
<result property="dataForm" column="data_form" />
<result property="dataId" column="data_id" />
<result property="procRole" column="proc_role" />
<result property="procUser" column="proc_user" />
<result property="procTime" column="proc_time" />
<result property="procAccount" column="proc_account" />
<result property="opName" column="op_name" />
<result property="opType" column="op_type" />
<result property="opRemark" column="op_remark" />
<result property="beforeDataJson" column="before_data_json" />
<result property="afterDataJson" column="after_data_json" />
<result property="procId" column="proc_id" />
</resultMap>
<sql id="selectMcOperationLogVo">
select id,
data_form,
data_id,
proc_role,
proc_user,
proc_time,
proc_account,
op_name,
op_type,
op_remark,
before_data_json,
after_data_json,
proc_id
from mc_operation_log
</sql>
<select id="selectMcOperationLogList" parameterType="com.chinagas.modules.schsf.domain.McOperationLog" resultMap="McOperationLogResult">
<include refid="selectMcOperationLogVo"/>
<where>
<if test="dataForm != null and dataForm != ''"> and data_form = #{dataForm}</if>
<if test="dataId != null "> and data_id = #{dataId}</if>
<if test="procRole != null and procRole != ''"> and proc_role = #{procRole}</if>
<if test="procUser != null and procUser != ''"> and proc_user = #{procUser}</if>
<if test="procTime != null "> and proc_time = #{procTime}</if>
<if test="procAccount != null and procAccount != ''"> and proc_account = #{procAccount}</if>
<if test="opName != null and opName != ''"> and op_name like concat('%', #{opName}, '%')</if>
<if test="opType != null and opType != ''"> and op_type = #{opType}</if>
<if test="opRemark != null and opRemark != ''"> and op_remark = #{opRemark}</if>
<if test="beforeDataJson != null and beforeDataJson != ''"> and before_data_json = #{beforeDataJson}</if>
<if test="afterDataJson != null and afterDataJson != ''"> and after_data_json = #{afterDataJson}</if>
<if test="procId != null and procId != ''"> and proc_id = #{procId}</if>
</where>
</select>
<insert id="insertMcOperationLog" parameterType="com.chinagas.modules.schsf.domain.McOperationLog">
insert into mc_operation_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="dataForm != null and dataForm != ''">data_form,</if>
<if test="dataId != null">data_id,</if>
<if test="procRole != null">proc_role,</if>
<if test="procUser != null and procUser != ''">proc_user,</if>
<if test="procTime != null">proc_time,</if>
<if test="procAccount != null and procAccount != ''">proc_account,</if>
<if test="opName != null">op_name,</if>
<if test="opType != null">op_type,</if>
<if test="opRemark != null">op_remark,</if>
<if test="beforeDataJson != null">before_data_json,</if>
<if test="afterDataJson != null">after_data_json,</if>
<if test="procId != null">proc_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="dataForm != null and dataForm != ''">#{dataForm},</if>
<if test="dataId != null">#{dataId},</if>
<if test="procRole != null">#{procRole},</if>
<if test="procUser != null and procUser != ''">#{procUser},</if>
<if test="procTime != null">#{procTime},</if>
<if test="procAccount != null and procAccount != ''">#{procAccount},</if>
<if test="opName != null">#{opName},</if>
<if test="opType != null">#{opType},</if>
<if test="opRemark != null">#{opRemark},</if>
<if test="beforeDataJson != null">#{beforeDataJson},</if>
<if test="afterDataJson != null">#{afterDataJson},</if>
<if test="procId != null">#{procId},</if>
</trim>
</insert>
</mapper>