McConstructionMapper.xml
14.3 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<?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.McConstructionMapper">
<resultMap type="com.chinagas.modules.schsf.domain.McConstruction" id="McConstructionResult">
<result property="id" column="id" />
<result property="cmtyId" column="cmty_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="province" column="province" />
<result property="city" column="city" />
<result property="district" column="district" />
<result property="street" column="street" />
<result property="vlgOrCmty" column="vlg_or_cmty" />
<result property="urbRurCls" column="urb_rur_cls" />
<result property="projectTypeName" column="project_type_name" />
<result property="projectTypeCode" column="project_type_code" />
<result property="assignmentTime" column="assignment_time" />
<result property="isCompleted" column="is_completed" />
<result property="completionTime" column="completion_time" />
<result property="nonNcmpRsn" column="non_ncmp_rsn" />
<result property="projectPersonId" column="project_person_id" />
<result property="projectPersonName" column="project_person_name" />
<result property="projectPersonAccount" column="project_person_account" />
<result property="gasConnMtrRis" column="gas_conn_mtr_ris" />
<result property="gctMtrrisTime" column="gct_mtrris_time" />
<result property="gctNcmpRsn" column="gct_ncmp_rsn" />
<result property="operatePersonId" column="operate_person_id" />
<result property="operatePersonName" column="operate_person_name" />
<result property="operatePersonAccount" column="operate_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="selectMcConstructionVo">
select id, cmty_id, region_name, group_name, company_name, company_code, province, city, district, street, vlg_or_cmty, urb_rur_cls, project_type_name, project_type_code, assignment_time, is_completed, completion_time, non_ncmp_rsn, project_person_id, project_person_name, project_person_account, gas_conn_mtr_ris, gct_mtrris_time, gct_ncmp_rsn, operate_person_id, operate_person_name, operate_person_account, remark, create_time, create_by, update_time, update_by, def_flag from mc_construction
</sql>
<select id="selectMcConstructionList" parameterType="com.chinagas.modules.schsf.domain.McConstruction" resultMap="McConstructionResult">
<include refid="selectMcConstructionVo"/>
<where>
<if test="cmtyId != null "> and cmty_id = #{cmtyId}</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="province != null and province != ''"> and province = #{province}</if>
<if test="city != null and city != ''"> and city = #{city}</if>
<if test="district != null and district != ''"> and district = #{district}</if>
<if test="street != null and street != ''"> and street = #{street}</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="projectTypeName != null and projectTypeName != ''"> and project_type_name like concat('%', #{projectTypeName}, '%')</if>
<if test="projectTypeCode != null and projectTypeCode != ''"> and project_type_code = #{projectTypeCode}</if>
<if test="assignmentTime != null "> and assignment_time = #{assignmentTime}</if>
<if test="isCompleted != null and isCompleted != ''"> and is_completed = #{isCompleted}</if>
<if test="completionTime != null "> and completion_time = #{completionTime}</if>
<if test="nonNcmpRsn != null and nonNcmpRsn != ''"> and non_ncmp_rsn = #{nonNcmpRsn}</if>
<if test="projectPersonId != null "> and project_person_id = #{projectPersonId}</if>
<if test="projectPersonName != null and projectPersonName != ''"> and project_person_name like concat('%', #{projectPersonName}, '%')</if>
<if test="projectPersonAccount != null and projectPersonAccount != ''"> and project_person_account = #{projectPersonAccount}</if>
<if test="gasConnMtrRis != null and gasConnMtrRis != ''"> and gas_conn_mtr_ris = #{gasConnMtrRis}</if>
<if test="gctMtrrisTime != null "> and gct_mtrris_time = #{gctMtrrisTime}</if>
<if test="gctNcmpRsn != null and gctNcmpRsn != ''"> and gct_ncmp_rsn = #{gctNcmpRsn}</if>
<if test="operatePersonId != null "> and operate_person_id = #{operatePersonId}</if>
<if test="operatePersonName != null and operatePersonName != ''"> and operate_person_name like concat('%', #{operatePersonName}, '%')</if>
<if test="operatePersonAccount != null and operatePersonAccount != ''"> and operate_person_account = #{operatePersonAccount}</if>
<if test="defFlag != null and defFlag != ''"> and def_flag = #{defFlag}</if>
</where>
</select>
<select id="selectMcConstructionById" parameterType="Long" resultMap="McConstructionResult">
<include refid="selectMcConstructionVo"/>
where id = #{id}
</select>
<insert id="insertMcConstruction" parameterType="com.chinagas.modules.schsf.domain.McConstruction" useGeneratedKeys="true" keyProperty="id">
insert into mc_construction
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="cmtyId != null">cmty_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="province != null">province,</if>
<if test="city != null">city,</if>
<if test="district != null">district,</if>
<if test="street != null">street,</if>
<if test="vlgOrCmty != null">vlg_or_cmty,</if>
<if test="urbRurCls != null">urb_rur_cls,</if>
<if test="projectTypeName != null">project_type_name,</if>
<if test="projectTypeCode != null">project_type_code,</if>
<if test="assignmentTime != null">assignment_time,</if>
<if test="isCompleted != null">is_completed,</if>
<if test="completionTime != null">completion_time,</if>
<if test="nonNcmpRsn != null">non_ncmp_rsn,</if>
<if test="projectPersonId != null">project_person_id,</if>
<if test="projectPersonName != null">project_person_name,</if>
<if test="projectPersonAccount != null">project_person_account,</if>
<if test="gasConnMtrRis != null">gas_conn_mtr_ris,</if>
<if test="gctMtrrisTime != null">gct_mtrris_time,</if>
<if test="gctNcmpRsn != null">gct_ncmp_rsn,</if>
<if test="operatePersonId != null">operate_person_id,</if>
<if test="operatePersonName != null">operate_person_name,</if>
<if test="operatePersonAccount != null">operate_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="cmtyId != null">#{cmtyId},</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="province != null">#{province},</if>
<if test="city != null">#{city},</if>
<if test="district != null">#{district},</if>
<if test="street != null">#{street},</if>
<if test="vlgOrCmty != null">#{vlgOrCmty},</if>
<if test="urbRurCls != null">#{urbRurCls},</if>
<if test="projectTypeName != null">#{projectTypeName},</if>
<if test="projectTypeCode != null">#{projectTypeCode},</if>
<if test="assignmentTime != null">#{assignmentTime},</if>
<if test="isCompleted != null">#{isCompleted},</if>
<if test="completionTime != null">#{completionTime},</if>
<if test="nonNcmpRsn != null">#{nonNcmpRsn},</if>
<if test="projectPersonId != null">#{projectPersonId},</if>
<if test="projectPersonName != null">#{projectPersonName},</if>
<if test="projectPersonAccount != null">#{projectPersonAccount},</if>
<if test="gasConnMtrRis != null">#{gasConnMtrRis},</if>
<if test="gctMtrrisTime != null">#{gctMtrrisTime},</if>
<if test="gctNcmpRsn != null">#{gctNcmpRsn},</if>
<if test="operatePersonId != null">#{operatePersonId},</if>
<if test="operatePersonName != null">#{operatePersonName},</if>
<if test="operatePersonAccount != null">#{operatePersonAccount},</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="updateMcConstruction" parameterType="com.chinagas.modules.schsf.domain.McConstruction">
update mc_construction
<trim prefix="SET" suffixOverrides=",">
<if test="cmtyId != null">cmty_id = #{cmtyId},</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="province != null">province = #{province},</if>
<if test="city != null">city = #{city},</if>
<if test="district != null">district = #{district},</if>
<if test="street != null">street = #{street},</if>
<if test="vlgOrCmty != null">vlg_or_cmty = #{vlgOrCmty},</if>
<if test="urbRurCls != null">urb_rur_cls = #{urbRurCls},</if>
<if test="projectTypeName != null">project_type_name = #{projectTypeName},</if>
<if test="projectTypeCode != null">project_type_code = #{projectTypeCode},</if>
<if test="assignmentTime != null">assignment_time = #{assignmentTime},</if>
<if test="isCompleted != null">is_completed = #{isCompleted},</if>
<if test="completionTime != null">completion_time = #{completionTime},</if>
<if test="nonNcmpRsn != null">non_ncmp_rsn = #{nonNcmpRsn},</if>
<if test="projectPersonId != null">project_person_id = #{projectPersonId},</if>
<if test="projectPersonName != null">project_person_name = #{projectPersonName},</if>
<if test="projectPersonAccount != null">project_person_account = #{projectPersonAccount},</if>
<if test="gasConnMtrRis != null">gas_conn_mtr_ris = #{gasConnMtrRis},</if>
<if test="gctMtrrisTime != null">gct_mtrris_time = #{gctMtrrisTime},</if>
<if test="gctNcmpRsn != null">gct_ncmp_rsn = #{gctNcmpRsn},</if>
<if test="operatePersonId != null">operate_person_id = #{operatePersonId},</if>
<if test="operatePersonName != null">operate_person_name = #{operatePersonName},</if>
<if test="operatePersonAccount != null">operate_person_account = #{operatePersonAccount},</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="deleteMcConstructionById" parameterType="Long">
delete from mc_construction where id = #{id}
</delete>
<delete id="deleteMcConstructionByIds" parameterType="String">
delete from mc_construction where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>