|
@@ -147,7 +147,21 @@
|
147
|
147
|
</select>
|
148
|
148
|
|
149
|
149
|
<select id="selectCmcProjectListFuzzy" parameterType="CmcProject" resultMap="CmcProjectResult">
|
150
|
|
- <include refid="selectCmcProjectVo"/>
|
|
150
|
+ select t1.* from (select distinct(p.project_id), p.project_number, p.project_name, p.project_leader, u.nick_name as leader_nick_name, p.is_finished, p.project_source, p.party_a_id, pa.party_a_name, p.contact_person, p.telephone,
|
|
151
|
+ p.project_type, p.project_level, p.project_registrant, u1.nick_name as registrant_nick_name, p.undertaking_dept, p.project_planner, p.site_leader, p.organize_document, p.organize_time, p.is_complete,
|
|
152
|
+ p.register_time, p.plan_time, p.entry_time, p.exit_time, p.remark, tp.technical_director, u2.nick_name as director_nick_name, tp.quality_inspector, p.project_kml, p.project_cp, p.kml_lng, p.kml_lat,
|
|
153
|
+ p.cars, p.drivers, p.devices, p.participates, p.task_document, p.project_request, tp.technical_designer, u3.nick_name as designer_nick_name, u4.nick_name as planner_nick_name,
|
|
154
|
+ u5.nick_name as site_nick_name, p.in_leader, p.out_leader, p.lead_dept, p.join_dept, pc.contract_id, c.contract_number, c.contract_code, c.contract_name from cmc_project as p
|
|
155
|
+ left join sys_user as u on u.user_id = p.project_leader
|
|
156
|
+ left join sys_user as u1 on u1.user_id = p.project_registrant
|
|
157
|
+ left join cmc_technical_plan as tp on tp.project_id = p.project_id
|
|
158
|
+ left join sys_user as u2 on u2.user_id = tp.technical_director
|
|
159
|
+ left join sys_user as u3 on u3.user_id = tp.technical_designer
|
|
160
|
+ left join sys_user as u4 on u4.user_id = p.project_planner
|
|
161
|
+ left join sys_user as u5 on u5.user_id = p.site_leader
|
|
162
|
+ left join cmc_party_a as pa on pa.party_a_id = p.party_a_id
|
|
163
|
+ left join cmc_project_contract as pc on pc.project_id = p.project_id
|
|
164
|
+ left join cmc_contract as c on c.contract_id = pc.contract_id
|
151
|
165
|
<where>
|
152
|
166
|
(p.project_number REGEXP '^[0-9]+W[0-9]' or p.project_number REGEXP '^[0-9]+C[0-9]') AND NOT (p.project_number REGEXP '[/\\*-]')
|
153
|
167
|
and (case when p.undertaking_dept not like concat('%', '113', '%') then p.undertaking_dept not like concat('%', '113', '%')
|
|
@@ -180,7 +194,58 @@
|
180
|
194
|
<if test="participates != null and participates != ''"> and find_in_set(#{participates}, p.participates)</if>
|
181
|
195
|
</where>
|
182
|
196
|
group by p.project_id
|
183
|
|
- order by p.register_time desc, p.project_number desc
|
|
197
|
+ order by p.register_time desc, p.project_number desc) as t1
|
|
198
|
+ union
|
|
199
|
+ select t2.* from (select distinct(p.project_id), p.project_number, p.project_name, p.project_leader, u.nick_name as leader_nick_name, p.is_finished, p.project_source, p.party_a_id, pa.party_a_name, p.contact_person, p.telephone,
|
|
200
|
+ p.project_type, p.project_level, p.project_registrant, u1.nick_name as registrant_nick_name, p.undertaking_dept, p.project_planner, p.site_leader, p.organize_document, p.organize_time, p.is_complete,
|
|
201
|
+ p.register_time, p.plan_time, p.entry_time, p.exit_time, p.remark, tp.technical_director, u2.nick_name as director_nick_name, tp.quality_inspector, p.project_kml, p.project_cp, p.kml_lng, p.kml_lat,
|
|
202
|
+ p.cars, p.drivers, p.devices, p.participates, p.task_document, p.project_request, tp.technical_designer, u3.nick_name as designer_nick_name, u4.nick_name as planner_nick_name,
|
|
203
|
+ u5.nick_name as site_nick_name, p.in_leader, p.out_leader, p.lead_dept, p.join_dept, pc.contract_id, c.contract_number, c.contract_code, c.contract_name from cmc_project as p
|
|
204
|
+ left join sys_user as u on u.user_id = p.project_leader
|
|
205
|
+ left join sys_user as u1 on u1.user_id = p.project_registrant
|
|
206
|
+ left join cmc_technical_plan as tp on tp.project_id = p.project_id
|
|
207
|
+ left join sys_user as u2 on u2.user_id = tp.technical_director
|
|
208
|
+ left join sys_user as u3 on u3.user_id = tp.technical_designer
|
|
209
|
+ left join sys_user as u4 on u4.user_id = p.project_planner
|
|
210
|
+ left join sys_user as u5 on u5.user_id = p.site_leader
|
|
211
|
+ left join cmc_party_a as pa on pa.party_a_id = p.party_a_id
|
|
212
|
+ left join cmc_project_contract as pc on pc.project_id = p.project_id
|
|
213
|
+ left join cmc_contract as c on c.contract_id = pc.contract_id
|
|
214
|
+ left join cmc_project_work as pw on pw.project_id = p.project_id
|
|
215
|
+ <where>
|
|
216
|
+ (p.project_number REGEXP '^[0-9]+W[0-9]' or p.project_number REGEXP '^[0-9]+C[0-9]') AND NOT (p.project_number REGEXP '[/\\*-]')
|
|
217
|
+ and (case when p.undertaking_dept not like concat('%', '113', '%') then p.undertaking_dept not like concat('%', '113', '%')
|
|
218
|
+ when p.undertaking_dept is null then p.undertaking_dept is null
|
|
219
|
+ when p.undertaking_dept like concat('%', '113', '%') then p.undertaking_dept like concat('%', ',', '%')
|
|
220
|
+ end)
|
|
221
|
+ and (pa.party_a_name like concat('%', #{queryString}, '%') or
|
|
222
|
+ p.contact_person like concat('%', #{queryString}, '%') or
|
|
223
|
+ p.telephone like concat('%', #{queryString}, '%') or
|
|
224
|
+ p.project_type like concat('%', #{queryString}, '%') or
|
|
225
|
+ pw.content like concat('%', #{queryString}, '%'))
|
|
226
|
+ <if test="projectId != null and projectId != ''"> and p.project_id = #{projectId}</if>
|
|
227
|
+ <if test="projectNumber != null and projectNumber != ''"> and p.project_number like concat('%', #{projectNumber}, '%')</if>
|
|
228
|
+ <if test="projectName != null and projectName != ''"> and p.project_name like concat('%', #{projectName}, '%')</if>
|
|
229
|
+ <if test="projectLeader != null "> and p.project_leader = #{projectLeader}</if>
|
|
230
|
+ <if test="isFinished != null and isFinished != ''"> and p.is_finished = #{isFinished}</if>
|
|
231
|
+ <if test="isComplete != null and isComplete != ''"> and p.is_complete = #{isComplete}</if>
|
|
232
|
+ <if test="projectSource != null and projectSource != ''"> and p.project_source = #{projectSource}</if>
|
|
233
|
+ <if test="partyAId != null and partyAId != ''"> and p.party_a_id = #{partyAId}</if>
|
|
234
|
+ <if test="contactPerson != null and contactPerson != ''"> and p.contact_person = #{contactPerson}</if>
|
|
235
|
+ <if test="telephone != null and telephone != ''"> and p.telephone = #{telephone}</if>
|
|
236
|
+ <if test="projectType != null and projectType != ''"> and p.project_type = #{projectType}</if>
|
|
237
|
+ <if test="projectLevel != null and projectLevel != ''"> and p.project_level = #{projectLevel}</if>
|
|
238
|
+ <if test="projectRegistrant != null "> and p.project_registrant = #{projectRegistrant}</if>
|
|
239
|
+ <if test="undertakingDept != null and undertakingDept != ''"> and p.undertaking_dept like concat('%', #{undertakingDept}, '%')</if>
|
|
240
|
+ <if test="projectPlanner != null "> and p.project_planner = #{projectPlanner}</if>
|
|
241
|
+ <if test="siteLeader != null "> and p.site_leader = #{siteLeader}</if>
|
|
242
|
+ <if test="planTime != null "> and p.plan_time = #{planTime}</if>
|
|
243
|
+ <if test="entryTime != null "> and p.entry_time = #{entryTime}</if>
|
|
244
|
+ <if test="exitTime != null "> and p.exit_time = #{exitTime}</if>
|
|
245
|
+ <if test="participates != null and participates != ''"> and find_in_set(#{participates}, p.participates)</if>
|
|
246
|
+ </where>
|
|
247
|
+ order by p.register_time desc, p.project_number desc) as t2
|
|
248
|
+ order by register_time desc, project_number desc
|
184
|
249
|
</select>
|
185
|
250
|
|
186
|
251
|
<select id="selectCmcInvestProjectList" parameterType="CmcProject" resultMap="CmcProjectResult">
|