|
@@ -141,7 +141,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
a.NAME AS roomName,
|
|
|
a.id AS roomId,
|
|
|
b.engin_type AS enginCycle,
|
|
|
- IFNULL( b.completion_status, '未施工' ) AS roomStatus,
|
|
|
+ IFNULL( b.completion_status,
|
|
|
+ IFNULL((select '未安装' from z_engin_not_installed ni
|
|
|
+ where ni.house_id = a.id
|
|
|
+ <if test="enginType != null and enginType != ''">
|
|
|
+ and ni.engin_type=#{enginType}
|
|
|
+ </if>
|
|
|
+ LIMIT 1),'未施工')) AS roomStatus,
|
|
|
b.create_time,
|
|
|
CAST(CONCAT( REPLACE ( bd.NAME, '栋', '' ),REPLACE ( c.NAME, '单元', '' )) AS SIGNED) AS unitOrder
|
|
|
FROM
|
|
@@ -172,11 +178,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
za.id as areaId,
|
|
|
za.NAME,
|
|
|
IFNULL( za.scale, 0 ) AS scale,
|
|
|
- IFNULL( ze.completion_status, '未施工' ) AS roomStatus
|
|
|
+ IFNULL( ze.completion_status,
|
|
|
+ IFNULL((select '未安装' from z_engin_not_installed ni
|
|
|
+ where ni.house_id = zh.id
|
|
|
+ <if test="enginType != null and enginType != ''">
|
|
|
+ and ni.engin_type=#{enginType}
|
|
|
+ </if>
|
|
|
+ LIMIT 1),'未施工')) AS roomStatus
|
|
|
FROM
|
|
|
z_house zh
|
|
|
LEFT JOIN z_area za ON za.id = zh.area_id
|
|
|
LEFT JOIN z_engineering_civil ze ON zh.id = ze.house_id AND ze.del_flag = '0' AND ze.engin_cycle=#{enginCycle}
|
|
|
+ <if test="enginType != null and enginType != ''">
|
|
|
+ and ze.engin_type=#{enginType}
|
|
|
+ </if>
|
|
|
WHERE
|
|
|
zh.del_flag = 0
|
|
|
AND zh.area_id in
|
|
@@ -190,11 +205,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
za.id as areaId,
|
|
|
za.NAME,
|
|
|
IFNULL( za.scale, 0 ) AS scale,
|
|
|
- IFNULL( ze.completion_status, '未施工' ) AS roomStatus
|
|
|
+ IFNULL( ze.completion_status,
|
|
|
+ IFNULL((select '未安装' from z_engin_not_installed ni
|
|
|
+ where ni.house_id = zh.id
|
|
|
+ <if test="enginType != null and enginType != ''">
|
|
|
+ and ni.engin_type=#{enginType}
|
|
|
+ </if>
|
|
|
+ LIMIT 1),'未施工')) AS roomStatus
|
|
|
FROM
|
|
|
z_house zh
|
|
|
LEFT JOIN z_area za ON za.id = zh.area_id
|
|
|
LEFT JOIN z_engineering_civil ze ON zh.id = ze.house_id AND ze.del_flag = '0' AND ze.engin_cycle=#{enginCycle}
|
|
|
+ <if test="enginType != null and enginType != ''">
|
|
|
+ and ze.engin_type=#{enginType}
|
|
|
+ </if>
|
|
|
WHERE
|
|
|
zh.del_flag = 0
|
|
|
ORDER BY za.id ASC
|
|
@@ -270,7 +294,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
z_engineering_info
|
|
|
WHERE
|
|
|
1=1
|
|
|
-
|
|
|
<if test="createTime != null and createTime != ''">
|
|
|
and update_info_time between #{createTime[0]} and #{createTime[1]}
|
|
|
</if>
|
|
@@ -295,88 +318,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
</select>
|
|
|
<select id="getexportList" resultType="com.ruoyi.zdsz.domain.vo.ZEngineeringCivilExportVo">
|
|
|
- SELECT
|
|
|
- a.id,
|
|
|
- (SELECT dict_label FROM `sys_dict_data` WHERE dict_type = 'district' AND dict_value = a.district) AS district,
|
|
|
- g.`name` AS area_id,
|
|
|
- h.`name` AS building_id,
|
|
|
- i.`name` AS unit_id,
|
|
|
- j.`name` AS house_id,
|
|
|
- (SELECT dict_label FROM `sys_dict_data` WHERE dict_type = 'community_source' AND dict_value = j.`source`) AS source,
|
|
|
- k.dict_label AS engin_classification,
|
|
|
- CASE
|
|
|
- a.engin_type
|
|
|
- WHEN 'new_built' THEN
|
|
|
- '新建' ELSE '旧改'
|
|
|
- END AS engin_type,
|
|
|
- a.completion_status,
|
|
|
- b.type,
|
|
|
- c.construct_addre,
|
|
|
- c.construct_according_drawings,
|
|
|
- c.segmented_compression_qualified,
|
|
|
- c.backfill_time,
|
|
|
- c.construct_phone,
|
|
|
- c.construct_time,
|
|
|
- c.head_name,
|
|
|
- c.head_phone,
|
|
|
- d.visit_type,
|
|
|
- d.corrosion_level AS corrosion_level,
|
|
|
- n.name as self_closing_valve_type,
|
|
|
- m.name as brand,
|
|
|
- e.`name` AS material_quality,
|
|
|
- f.`name` AS specifications,
|
|
|
- d.number,
|
|
|
- c.update_info_time as updateInfoTime,
|
|
|
- c.create_by as createBy,
|
|
|
- c.remark,
|
|
|
- d.remark as remarkd
|
|
|
- FROM
|
|
|
- z_engineering_civil a
|
|
|
- LEFT JOIN z_engineering_node b ON a.id = b.civli_id
|
|
|
- LEFT JOIN z_engineering_info c ON b.id = c.eng_info_id
|
|
|
- LEFT JOIN z_engineering_material d ON c.id = d.details_id
|
|
|
- LEFT JOIN z_engin_material_quality e ON e.id = d.material_quality
|
|
|
- LEFT JOIN z_engin_specifications f ON f.id = d.specifications
|
|
|
- LEFT JOIN z_area g ON g.id = a.area_id
|
|
|
- LEFT JOIN z_building h ON h.id = a.building_id
|
|
|
- LEFT JOIN z_unit i ON i.id = a.unit_id
|
|
|
- LEFT JOIN z_house j ON j.id = a.house_id
|
|
|
- LEFT JOIN sys_dict_data k ON k.dict_type = a.engin_type
|
|
|
- AND k.dict_value = a.engin_classification
|
|
|
- LEFT JOIN z_engin_material_quality l ON l.id = d.corrosion_level
|
|
|
- LEFT JOIN z_engin_material_quality m ON m.id = d.brand
|
|
|
- LEFT JOIN z_engin_material_quality n ON n.id = d.self_closing_valve_type
|
|
|
- WHERE
|
|
|
- a.create_time LIKE CONCAT(REPLACE(#{createTime}, '_', '-'),'%')
|
|
|
- <if test="p.district != null and p.district != ''">
|
|
|
- and a.district = #{p.district}
|
|
|
- </if>
|
|
|
- <if test="p.areaId != null and p.areaId != ''">
|
|
|
- and a.area_id = #{p.areaId}
|
|
|
- </if>
|
|
|
- <if test="p.buildingId != null and p.buildingId != ''">
|
|
|
- and a.building_id = #{p.buildingId}
|
|
|
- </if>
|
|
|
- <if test="p.unitId != null and p.unitId != ''">
|
|
|
- and a.unit_id = #{p.unitId}
|
|
|
- </if>
|
|
|
- <if test="p.enginType != null and p.enginType != ''">
|
|
|
- and a.engin_type = #{p.enginType}
|
|
|
- </if>
|
|
|
- <if test="p.enginClassification != null and p.enginClassification != ''">
|
|
|
- and a.engin_classification = #{p.enginClassification}
|
|
|
- </if>
|
|
|
- <if test="p.enginCycle != null and p.enginCycle != ''">
|
|
|
- and a.engin_cycle = 0
|
|
|
- </if>
|
|
|
- <if test="p.beginTime != null and p.beginTime != ''">
|
|
|
- and c.update_info_time between #{beginTime[0]} and #{beginTime[1]}
|
|
|
- </if>
|
|
|
- <if test="p.createBy != null and p.createBy != ''">
|
|
|
- and c.create_by like CONCAT(#{p.createBy},'%')
|
|
|
- </if>
|
|
|
- <foreach collection="tableNames" item="name">
|
|
|
- union
|
|
|
+ select * from (
|
|
|
SELECT
|
|
|
a.id,
|
|
|
(SELECT dict_label FROM `sys_dict_data` WHERE dict_type = 'district' AND dict_value = a.district) AS district,
|
|
@@ -413,10 +355,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
c.remark,
|
|
|
d.remark as remarkd
|
|
|
FROM
|
|
|
- z_engineering_civil a
|
|
|
- LEFT JOIN z_engineering_node_${name} b ON a.id = b.civli_id
|
|
|
- LEFT JOIN z_engineering_info_${name} c ON b.id = c.eng_info_id
|
|
|
- LEFT JOIN z_engineering_material_${name} d ON c.id = d.details_id
|
|
|
+ z_engineering_civil a
|
|
|
+ LEFT JOIN z_engineering_node b ON a.id = b.civli_id
|
|
|
+ LEFT JOIN z_engineering_info c ON b.id = c.eng_info_id
|
|
|
+ LEFT JOIN z_engineering_material d ON c.id = d.details_id
|
|
|
LEFT JOIN z_engin_material_quality e ON e.id = d.material_quality
|
|
|
LEFT JOIN z_engin_specifications f ON f.id = d.specifications
|
|
|
LEFT JOIN z_area g ON g.id = a.area_id
|
|
@@ -425,11 +367,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN z_house j ON j.id = a.house_id
|
|
|
LEFT JOIN sys_dict_data k ON k.dict_type = a.engin_type
|
|
|
AND k.dict_value = a.engin_classification
|
|
|
- LEFT JOIN z_engin_specifications l ON l.id = d.corrosion_level
|
|
|
+ LEFT JOIN z_engin_material_quality l ON l.id = d.corrosion_level
|
|
|
LEFT JOIN z_engin_material_quality m ON m.id = d.brand
|
|
|
LEFT JOIN z_engin_material_quality n ON n.id = d.self_closing_valve_type
|
|
|
WHERE
|
|
|
- a.create_time LIKE CONCAT(REPLACE(#{name}, '_', '-'),'%')
|
|
|
+ a.create_time LIKE CONCAT(REPLACE(#{createTime}, '_', '-'),'%')
|
|
|
<if test="p.district != null and p.district != ''">
|
|
|
and a.district = #{p.district}
|
|
|
</if>
|
|
@@ -457,7 +399,95 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="p.createBy != null and p.createBy != ''">
|
|
|
and c.create_by like CONCAT(#{p.createBy},'%')
|
|
|
</if>
|
|
|
- </foreach>
|
|
|
+ <foreach collection="tableNames" item="name">
|
|
|
+ union
|
|
|
+ SELECT
|
|
|
+ a.id,
|
|
|
+ (SELECT dict_label FROM `sys_dict_data` WHERE dict_type = 'district' AND dict_value = a.district) AS district,
|
|
|
+ g.`name` AS area_id,
|
|
|
+ h.`name` AS building_id,
|
|
|
+ i.`name` AS unit_id,
|
|
|
+ j.`name` AS house_id,
|
|
|
+ (SELECT dict_label FROM `sys_dict_data` WHERE dict_type = 'community_source' AND dict_value = j.`source`) AS source,
|
|
|
+ k.dict_label AS engin_classification,
|
|
|
+ CASE
|
|
|
+ a.engin_type
|
|
|
+ WHEN 'new_built' THEN
|
|
|
+ '新建' ELSE '旧改'
|
|
|
+ END AS engin_type,
|
|
|
+ a.completion_status,
|
|
|
+ b.type,
|
|
|
+ c.construct_addre,
|
|
|
+ c.construct_according_drawings,
|
|
|
+ c.segmented_compression_qualified,
|
|
|
+ c.backfill_time,
|
|
|
+ c.construct_phone,
|
|
|
+ c.construct_time,
|
|
|
+ c.head_name,
|
|
|
+ c.head_phone,
|
|
|
+ d.visit_type,
|
|
|
+ d.corrosion_level AS corrosion_level,
|
|
|
+ n.name as self_closing_valve_type,
|
|
|
+ m.name as brand,
|
|
|
+ e.`name` AS material_quality,
|
|
|
+ f.`name` AS specifications,
|
|
|
+ d.number,
|
|
|
+ c.update_info_time as updateInfoTime,
|
|
|
+ c.create_by as createBy,
|
|
|
+ c.remark,
|
|
|
+ d.remark as remarkd
|
|
|
+ FROM
|
|
|
+ z_engineering_civil a
|
|
|
+ LEFT JOIN z_engineering_node_${name} b ON a.id = b.civli_id
|
|
|
+ LEFT JOIN z_engineering_info_${name} c ON b.id = c.eng_info_id
|
|
|
+ LEFT JOIN z_engineering_material_${name} d ON c.id = d.details_id
|
|
|
+ LEFT JOIN z_engin_material_quality e ON e.id = d.material_quality
|
|
|
+ LEFT JOIN z_engin_specifications f ON f.id = d.specifications
|
|
|
+ LEFT JOIN z_area g ON g.id = a.area_id
|
|
|
+ LEFT JOIN z_building h ON h.id = a.building_id
|
|
|
+ LEFT JOIN z_unit i ON i.id = a.unit_id
|
|
|
+ LEFT JOIN z_house j ON j.id = a.house_id
|
|
|
+ LEFT JOIN sys_dict_data k ON k.dict_type = a.engin_type
|
|
|
+ AND k.dict_value = a.engin_classification
|
|
|
+ LEFT JOIN z_engin_specifications l ON l.id = d.corrosion_level
|
|
|
+ LEFT JOIN z_engin_material_quality m ON m.id = d.brand
|
|
|
+ LEFT JOIN z_engin_material_quality n ON n.id = d.self_closing_valve_type
|
|
|
+ WHERE
|
|
|
+ a.create_time LIKE CONCAT(REPLACE(#{name}, '_', '-'),'%')
|
|
|
+ <if test="p.district != null and p.district != ''">
|
|
|
+ and a.district = #{p.district}
|
|
|
+ </if>
|
|
|
+ <if test="p.areaId != null and p.areaId != ''">
|
|
|
+ and a.area_id = #{p.areaId}
|
|
|
+ </if>
|
|
|
+ <if test="p.buildingId != null and p.buildingId != ''">
|
|
|
+ and a.building_id = #{p.buildingId}
|
|
|
+ </if>
|
|
|
+ <if test="p.unitId != null and p.unitId != ''">
|
|
|
+ and a.unit_id = #{p.unitId}
|
|
|
+ </if>
|
|
|
+ <if test="p.enginType != null and p.enginType != ''">
|
|
|
+ and a.engin_type = #{p.enginType}
|
|
|
+ </if>
|
|
|
+ <if test="p.enginClassification != null and p.enginClassification != ''">
|
|
|
+ and a.engin_classification = #{p.enginClassification}
|
|
|
+ </if>
|
|
|
+ <if test="p.enginCycle != null and p.enginCycle != ''">
|
|
|
+ and a.engin_cycle = 0
|
|
|
+ </if>
|
|
|
+ <if test="p.beginTime != null and p.beginTime != ''">
|
|
|
+ and c.update_info_time between #{beginTime[0]} and #{beginTime[1]}
|
|
|
+ </if>
|
|
|
+ <if test="p.createBy != null and p.createBy != ''">
|
|
|
+ and c.create_by like CONCAT(#{p.createBy},'%')
|
|
|
+ </if>
|
|
|
+ </foreach>
|
|
|
+ ) z
|
|
|
+ ORDER BY
|
|
|
+ z.area_id,
|
|
|
+ CONVERT ( REPLACE ( z.building_id, '栋', '' ), UNSIGNED ),
|
|
|
+ CONVERT ( REPLACE ( z.unit_id, '单元', '' ), UNSIGNED ),
|
|
|
+ CONVERT ( REPLACE ( z.house_id, '号', '' ), UNSIGNED ) ASC
|
|
|
</select>
|
|
|
<select id="getTypeNumber" resultType="Long">
|
|
|
SELECT
|