EventMapper.xml
6.01 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?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.runsa.crmapp.common.mapper.EventMapper" >
<resultMap id="BaseResultMap" type="cn.runsa.crmapp.common.entity.Event" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="EVT_ID" property="evtId" jdbcType="INTEGER" />
<result column="EVT_CODE" property="evtCode" jdbcType="VARCHAR" />
<result column="EVT_NAME" property="evtName" jdbcType="VARCHAR" />
<result column="EVT_DESC" property="evtDesc" jdbcType="VARCHAR" />
<result column="GLOBAL" property="global" jdbcType="BIT" />
<result column="INTERNAL" property="internal" jdbcType="BIT" />
<result column="REC_TIME" property="recTime" jdbcType="TIMESTAMP" />
<result column="REC_USER" property="recUser" jdbcType="BIGINT" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
`EVT_ID`, `EVT_CODE`, `EVT_NAME`, `EVT_DESC`, `GLOBAL`, `INTERNAL`, `REC_TIME`, `REC_USER`
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from crm_event
where `EVT_ID` = #{evtId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from crm_event
where `EVT_ID` = #{evtId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="cn.runsa.crmapp.common.entity.Event" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey resultType="java.lang.Integer" keyProperty="evtId" order="AFTER" >
SELECT LAST_INSERT_ID()
</selectKey>
insert into crm_event (`EVT_CODE`, `EVT_NAME`, `EVT_DESC`,
`GLOBAL`, `INTERNAL`, `REC_TIME`,
`REC_USER`)
values (#{evtCode,jdbcType=VARCHAR}, #{evtName,jdbcType=VARCHAR}, #{evtDesc,jdbcType=VARCHAR},
#{global,jdbcType=BIT}, #{internal,jdbcType=BIT}, #{recTime,jdbcType=TIMESTAMP},
#{recUser,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="cn.runsa.crmapp.common.entity.Event" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey resultType="java.lang.Integer" keyProperty="evtId" order="AFTER" >
SELECT LAST_INSERT_ID()
</selectKey>
insert into crm_event
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="evtCode != null" >
`EVT_CODE`,
</if>
<if test="evtName != null" >
`EVT_NAME`,
</if>
<if test="evtDesc != null" >
`EVT_DESC`,
</if>
<if test="global != null" >
`GLOBAL`,
</if>
<if test="internal != null" >
`INTERNAL`,
</if>
<if test="recTime != null" >
`REC_TIME`,
</if>
<if test="recUser != null" >
`REC_USER`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="evtCode != null" >
#{evtCode,jdbcType=VARCHAR},
</if>
<if test="evtName != null" >
#{evtName,jdbcType=VARCHAR},
</if>
<if test="evtDesc != null" >
#{evtDesc,jdbcType=VARCHAR},
</if>
<if test="global != null" >
#{global,jdbcType=BIT},
</if>
<if test="internal != null" >
#{internal,jdbcType=BIT},
</if>
<if test="recTime != null" >
#{recTime,jdbcType=TIMESTAMP},
</if>
<if test="recUser != null" >
#{recUser,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="cn.runsa.crmapp.common.entity.Event" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update crm_event
<set >
<if test="evtCode != null" >
`EVT_CODE` = #{evtCode,jdbcType=VARCHAR},
</if>
<if test="evtName != null" >
`EVT_NAME` = #{evtName,jdbcType=VARCHAR},
</if>
<if test="evtDesc != null" >
`EVT_DESC` = #{evtDesc,jdbcType=VARCHAR},
</if>
<if test="global != null" >
`GLOBAL` = #{global,jdbcType=BIT},
</if>
<if test="internal != null" >
`INTERNAL` = #{internal,jdbcType=BIT},
</if>
<if test="recTime != null" >
`REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
</if>
<if test="recUser != null" >
`REC_USER` = #{recUser,jdbcType=BIGINT},
</if>
</set>
where `EVT_ID` = #{evtId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="cn.runsa.crmapp.common.entity.Event" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update crm_event
set `EVT_CODE` = #{evtCode,jdbcType=VARCHAR},
`EVT_NAME` = #{evtName,jdbcType=VARCHAR},
`EVT_DESC` = #{evtDesc,jdbcType=VARCHAR},
`GLOBAL` = #{global,jdbcType=BIT},
`INTERNAL` = #{internal,jdbcType=BIT},
`REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
`REC_USER` = #{recUser,jdbcType=BIGINT}
where `EVT_ID` = #{evtId,jdbcType=INTEGER}
</update>
<select id="selectOuters" resultMap="BaseResultMap">
select EVT_CODE,EVT_ID,EVT_NAME,EVT_DESC,GLOBAL
from crm_event where INTERNAL = 0
</select>
<select id="selectByEventCode" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List" />
from crm_event
where `EVT_CODE` = #{evtCode}
</select>
</mapper>