McIgnitionMapper.xml
12.1 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
172
173
174
175
176
177
178
179
180
181
182
183
<?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.McIgnitionMapper">
<resultMap type="com.chinagas.modules.schsf.domain.McIgnition" id="McIgnitionResult">
<result property="id" column="id" />
<result property="visitId" column="visit_id" />
<result property="regionName" column="region_name" />
<result property="groupName" column="group_name" />
<result property="companyName" column="company_name" />
<result property="companyCode" column="company_code" />
<result property="userProvince" column="user_province" />
<result property="userCity" column="user_city" />
<result property="userDistrict" column="user_district" />
<result property="userStreet" column="user_street" />
<result property="vlgOrCmty" column="vlg_or_cmty" />
<result property="urbRurCls" column="urb_rur_cls" />
<result property="userDetailedAddress" column="user_detailed_address" />
<result property="userCode" column="user_code" />
<result property="userName" column="user_name" />
<result property="userPhone" column="user_phone" />
<result property="ignCnfStatusCode" column="ign_cnf_status_code" />
<result property="ignTime" column="ign_time" />
<result property="nIgnRsn" column="n_ign_rsn" />
<result property="cnfPersonId" column="cnf_person_id" />
<result property="cnfPersonName" column="cnf_person_name" />
<result property="cnfPersonAccount" column="cnf_person_account" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="defFlag" column="def_flag" />
</resultMap>
<sql id="selectMcIgnitionVo">
select id, visit_id, region_name, group_name, company_name, company_code, user_province, user_city, user_district, user_street, vlg_or_cmty, urb_rur_cls, user_detailed_address, user_code, user_name, user_phone, ign_cnf_status_code, ign_time, n_ign_rsn, cnf_person_id, cnf_person_name, cnf_person_account, remark, create_time, create_by, update_time, update_by, def_flag from mc_ignition
</sql>
<select id="selectMcIgnitionList" parameterType="com.chinagas.modules.schsf.domain.McIgnition" resultMap="McIgnitionResult">
<include refid="selectMcIgnitionVo"/>
<where>
<if test="visitId != null "> and visit_id = #{visitId}</if>
<if test="regionName != null and regionName != ''"> and region_name like concat('%', #{regionName}, '%')</if>
<if test="groupName != null and groupName != ''"> and group_name like concat('%', #{groupName}, '%')</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode}</if>
<if test="userProvince != null and userProvince != ''"> and user_province = #{userProvince}</if>
<if test="userCity != null and userCity != ''"> and user_city = #{userCity}</if>
<if test="userDistrict != null and userDistrict != ''"> and user_district = #{userDistrict}</if>
<if test="userStreet != null and userStreet != ''"> and user_street = #{userStreet}</if>
<if test="vlgOrCmty != null and vlgOrCmty != ''"> and vlg_or_cmty = #{vlgOrCmty}</if>
<if test="urbRurCls != null and urbRurCls != ''"> and urb_rur_cls = #{urbRurCls}</if>
<if test="userDetailedAddress != null and userDetailedAddress != ''"> and user_detailed_address = #{userDetailedAddress}</if>
<if test="userCode != null and userCode != ''"> and user_code = #{userCode}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="userPhone != null and userPhone != ''"> and user_phone = #{userPhone}</if>
<if test="ignCnfStatusCode != null and ignCnfStatusCode != ''"> and ign_cnf_status_code = #{ignCnfStatusCode}</if>
<if test="ignTime != null "> and ign_time = #{ignTime}</if>
<if test="nIgnRsn != null and nIgnRsn != ''"> and n_ign_rsn = #{nIgnRsn}</if>
<if test="cnfPersonId != null "> and cnf_person_id = #{cnfPersonId}</if>
<if test="cnfPersonName != null and cnfPersonName != ''"> and cnf_person_name like concat('%', #{cnfPersonName}, '%')</if>
<if test="cnfPersonAccount != null and cnfPersonAccount != ''"> and cnf_person_account = #{cnfPersonAccount}</if>
<if test="defFlag != null and defFlag != ''"> and def_flag = #{defFlag}</if>
</where>
</select>
<select id="selectMcIgnitionById" parameterType="Long" resultMap="McIgnitionResult">
<include refid="selectMcIgnitionVo"/>
where id = #{id}
</select>
<insert id="insertMcIgnition" parameterType="com.chinagas.modules.schsf.domain.McIgnition">
insert into mc_ignition
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="visitId != null">visit_id,</if>
<if test="regionName != null and regionName != ''">region_name,</if>
<if test="groupName != null and groupName != ''">group_name,</if>
<if test="companyName != null and companyName != ''">company_name,</if>
<if test="companyCode != null and companyCode != ''">company_code,</if>
<if test="userProvince != null">user_province,</if>
<if test="userCity != null">user_city,</if>
<if test="userDistrict != null">user_district,</if>
<if test="userStreet != null">user_street,</if>
<if test="vlgOrCmty != null">vlg_or_cmty,</if>
<if test="urbRurCls != null">urb_rur_cls,</if>
<if test="userDetailedAddress != null">user_detailed_address,</if>
<if test="userCode != null">user_code,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="userPhone != null and userPhone != ''">user_phone,</if>
<if test="ignCnfStatusCode != null and ignCnfStatusCode != ''">ign_cnf_status_code,</if>
<if test="ignTime != null">ign_time,</if>
<if test="nIgnRsn != null">n_ign_rsn,</if>
<if test="cnfPersonId != null">cnf_person_id,</if>
<if test="cnfPersonName != null">cnf_person_name,</if>
<if test="cnfPersonAccount != null">cnf_person_account,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="defFlag != null and defFlag != ''">def_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="visitId != null">#{visitId},</if>
<if test="regionName != null and regionName != ''">#{regionName},</if>
<if test="groupName != null and groupName != ''">#{groupName},</if>
<if test="companyName != null and companyName != ''">#{companyName},</if>
<if test="companyCode != null and companyCode != ''">#{companyCode},</if>
<if test="userProvince != null">#{userProvince},</if>
<if test="userCity != null">#{userCity},</if>
<if test="userDistrict != null">#{userDistrict},</if>
<if test="userStreet != null">#{userStreet},</if>
<if test="vlgOrCmty != null">#{vlgOrCmty},</if>
<if test="urbRurCls != null">#{urbRurCls},</if>
<if test="userDetailedAddress != null">#{userDetailedAddress},</if>
<if test="userCode != null">#{userCode},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="userPhone != null and userPhone != ''">#{userPhone},</if>
<if test="ignCnfStatusCode != null and ignCnfStatusCode != ''">#{ignCnfStatusCode},</if>
<if test="ignTime != null">#{ignTime},</if>
<if test="nIgnRsn != null">#{nIgnRsn},</if>
<if test="cnfPersonId != null">#{cnfPersonId},</if>
<if test="cnfPersonName != null">#{cnfPersonName},</if>
<if test="cnfPersonAccount != null">#{cnfPersonAccount},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="defFlag != null and defFlag != ''">#{defFlag},</if>
</trim>
</insert>
<update id="updateMcIgnition" parameterType="com.chinagas.modules.schsf.domain.McIgnition">
update mc_ignition
<trim prefix="SET" suffixOverrides=",">
<if test="visitId != null">visit_id = #{visitId},</if>
<if test="regionName != null and regionName != ''">region_name = #{regionName},</if>
<if test="groupName != null and groupName != ''">group_name = #{groupName},</if>
<if test="companyName != null and companyName != ''">company_name = #{companyName},</if>
<if test="companyCode != null and companyCode != ''">company_code = #{companyCode},</if>
<if test="userProvince != null">user_province = #{userProvince},</if>
<if test="userCity != null">user_city = #{userCity},</if>
<if test="userDistrict != null">user_district = #{userDistrict},</if>
<if test="userStreet != null">user_street = #{userStreet},</if>
<if test="vlgOrCmty != null">vlg_or_cmty = #{vlgOrCmty},</if>
<if test="urbRurCls != null">urb_rur_cls = #{urbRurCls},</if>
<if test="userDetailedAddress != null">user_detailed_address = #{userDetailedAddress},</if>
<if test="userCode != null">user_code = #{userCode},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="userPhone != null and userPhone != ''">user_phone = #{userPhone},</if>
<if test="ignCnfStatusCode != null and ignCnfStatusCode != ''">ign_cnf_status_code = #{ignCnfStatusCode},</if>
<if test="ignTime != null">ign_time = #{ignTime},</if>
<if test="nIgnRsn != null">n_ign_rsn = #{nIgnRsn},</if>
<if test="cnfPersonId != null">cnf_person_id = #{cnfPersonId},</if>
<if test="cnfPersonName != null">cnf_person_name = #{cnfPersonName},</if>
<if test="cnfPersonAccount != null">cnf_person_account = #{cnfPersonAccount},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="defFlag != null and defFlag != ''">def_flag = #{defFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMcIgnitionById" parameterType="Long">
delete from mc_ignition where id = #{id}
</delete>
<delete id="deleteMcIgnitionByIds" parameterType="String">
delete from mc_ignition where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>