|
@@ -1,7 +1,7 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.zdsz.mapper.ZEngineeringCivilMapper">
|
|
|
|
|
|
<resultMap type="com.ruoyi.zdsz.domain.ZEngineeringCivil" id="ZEngineeringCivilResult">
|
|
@@ -24,19 +24,133 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
</resultMap>
|
|
|
+ <select id="exportObtainQualifiedRoom" resultType="com.ruoyi.zdsz.domain.vo.ZEngineeringCivilObtainQualifiedRoom">
|
|
|
+ SELECT
|
|
|
+ concat( IFNULL( area, '' ), IFNULL( building, '' ), IFNULL( unit, '' ), IFNULL( house, '' ) ) ardds,
|
|
|
+ GROUP_CONCAT( type ) type
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ <foreach collection="tableNames" item="name" separator=" union all ">
|
|
|
+ select
|
|
|
+ e.dict_label,
|
|
|
+ e.dict_value,
|
|
|
+ ( SELECT NAME FROM z_area WHERE id = a.area_id ) area,
|
|
|
+ a.area_id area_id,
|
|
|
+ ( SELECT NAME FROM z_building WHERE id = a.building_id ) building,
|
|
|
+ ( SELECT IF(NAME='无',null,NAME) FROM z_unit WHERE id = a.unit_id ) unit,
|
|
|
+ ( SELECT NAME FROM z_house WHERE id = a.house_id ) house,
|
|
|
+ concat(b.type,'合格') type,
|
|
|
+ c.update_info_time time
|
|
|
+ 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 sys_dict_data e ON e.dict_value = a.district
|
|
|
+ WHERE
|
|
|
+ a.engin_type = 'old_renovation'
|
|
|
+ AND engin_classification = 'indoor_engin'
|
|
|
+ AND a.del_flag = 0
|
|
|
+ AND b.del_flag = 0
|
|
|
+ AND c.del_flag = 0
|
|
|
+ AND d.del_flag = 0
|
|
|
+ AND c.state = '1'
|
|
|
+ <if test="p.beginTime != null and p.beginTime != ''">
|
|
|
+ AND c.update_info_time BETWEEN concat( #{p.beginTime[0]}, ' 00:00:00' ) AND concat( #{p.beginTime[1]}, ' 23:59:59' )
|
|
|
+ </if>
|
|
|
+ </foreach>
|
|
|
+ ) z
|
|
|
+ where 1=1
|
|
|
+ <if test="p.district != null and p.district != ''">
|
|
|
+ AND z.dict_value = #{p.district}
|
|
|
+ </if>
|
|
|
+ <if test="p.areaId != null and p.areaId != ''">
|
|
|
+ AND z.area_id = #{p.areaId}
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ z.area,
|
|
|
+ z.building,
|
|
|
+ z.unit,
|
|
|
+ z.house
|
|
|
+ HAVING
|
|
|
+ type LIKE '%拆旧管%'
|
|
|
+ AND type LIKE '%立杠%'
|
|
|
+ AND type LIKE '%表后管%'
|
|
|
+ AND type LIKE '%挂表%'
|
|
|
+ AND type LIKE '%阀管%'
|
|
|
+ ORDER BY
|
|
|
+ z.area,
|
|
|
+ z.building,
|
|
|
+ z.unit,
|
|
|
+ z.house
|
|
|
+ </select>
|
|
|
+ <select id="exportBottomLeg" resultType="com.ruoyi.zdsz.domain.vo.ZEngineeringCivilBottomLegExport">
|
|
|
+ SELECT
|
|
|
+ concat( IFNULL( area, '' ), IFNULL( building, '' ), IFNULL( unit, '' ) ) 'ardds',
|
|
|
+ GROUP_CONCAT( concat( construct_addre, '第', number, '根',state ) ORDER BY number ) 'bottom_leg',
|
|
|
+ GROUP_CONCAT( time ORDER BY number ) '日期',
|
|
|
+ sum( if(state='合格',1,0) ) 'acceptance_number',
|
|
|
+ sum( if(state='不合格',1,0) ) 'disqualification_number'
|
|
|
+
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ <foreach collection="tableNames" item="name" separator=" union all ">
|
|
|
+ SELECT
|
|
|
+ e.dict_label,
|
|
|
+ e.dict_value,
|
|
|
+ ( SELECT NAME FROM z_area WHERE id = a.area_id ) area,
|
|
|
+ a.area_id AS area_id,
|
|
|
+ ( SELECT NAME FROM z_building WHERE id = a.building_id ) building,
|
|
|
+ ( SELECT IF(NAME='无',null,NAME) FROM z_unit WHERE id = a.unit_id ) unit,
|
|
|
+ DATE_FORMAT( d.update_info_time, '%Y年%m月%d日 %H:%i:%S' ) time,
|
|
|
+ d.update_info_time AS update_info_time,
|
|
|
+ c.construct_addre,
|
|
|
+ d.number,
|
|
|
+ IF( c.state = '0', '不合格', '合格' ) state
|
|
|
+ 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 sys_dict_data e ON e.dict_value = a.district
|
|
|
+ WHERE
|
|
|
+ a.engin_type = 'old_renovation'
|
|
|
+ AND engin_classification = 'bottom_leg'
|
|
|
+ AND b.type = '底腿'
|
|
|
+ AND a.del_flag = 0
|
|
|
+ AND b.del_flag = 0
|
|
|
+ AND c.del_flag = 0
|
|
|
+ AND d.del_flag = 0
|
|
|
+ AND ( c.state = '0' OR c.state = '1' )
|
|
|
+ </foreach>
|
|
|
+ ) z
|
|
|
+ where 1=1
|
|
|
+ <if test="p.district != null and p.district != ''">
|
|
|
+ AND z.dict_value = #{p.district}
|
|
|
+ </if>
|
|
|
+ <if test="p.areaId != null and p.areaId != ''">
|
|
|
+ AND z.area_id = #{p.areaId}
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ z.area,
|
|
|
+ z.building,
|
|
|
+ z.unit
|
|
|
+ </select>
|
|
|
|
|
|
<select id="selectByDistrictStatistics" resultType="java.util.Map">
|
|
|
- select aas.name AS name,
|
|
|
- MAX(CASE aas.statu WHEN '未施工' THEN aas.num ELSE 0 END ) weishigong,
|
|
|
- MAX(CASE aas.statu WHEN '施工中' THEN aas.num ELSE 0 END ) shigongzhong ,
|
|
|
- MAX(CASE aas.statu WHEN '竣工' THEN aas.num ELSE 0 END ) jungong
|
|
|
- FROM (SELECT
|
|
|
- (SELECT name FROM z_area WHERE id = al.zarea) AS name,
|
|
|
- IF(ISNULL(al.completion_status),'未施工',al.completion_status) AS statu,
|
|
|
- COUNT(ISNULL(al.completion_status)) AS num
|
|
|
- FROM (SELECT zh.id zid, zh.area_id zarea,zec.* FROM z_house zh
|
|
|
- LEFT JOIN z_engineering_civil zec on zec.house_id = zh.id
|
|
|
- WHERE zh.area_id in (SELECT id FROM z_area WHERE district = #{district} AND del_flag = '0')) al GROUP BY al.zarea,al.completion_status) aas group by aas.name
|
|
|
+ select aas.name AS name,
|
|
|
+ MAX(CASE aas.statu WHEN '未施工' THEN aas.num ELSE 0 END) weishigong,
|
|
|
+ MAX(CASE aas.statu WHEN '施工中' THEN aas.num ELSE 0 END) shigongzhong,
|
|
|
+ MAX(CASE aas.statu WHEN '竣工' THEN aas.num ELSE 0 END) jungong
|
|
|
+ FROM (SELECT (SELECT name FROM z_area WHERE id = al.zarea) AS name,
|
|
|
+ IF(ISNULL(al.completion_status), '未施工', al.completion_status) AS statu,
|
|
|
+ COUNT(ISNULL(al.completion_status)) AS num
|
|
|
+ FROM (SELECT zh.id zid, zh.area_id zarea, zec.*
|
|
|
+ FROM z_house zh
|
|
|
+ LEFT JOIN z_engineering_civil zec on zec.house_id = zh.id
|
|
|
+ WHERE zh.area_id in (SELECT id FROM z_area WHERE district = #{district} AND del_flag = '0')) al
|
|
|
+ GROUP BY al.zarea, al.completion_status) aas
|
|
|
+ group by aas.name
|
|
|
</select>
|
|
|
|
|
|
<select id="queryPageList" resultType="com.ruoyi.zdsz.domain.vo.ZEngineeringCivilVo">
|
|
@@ -107,10 +221,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="p.enginCycle != null and p.enginCycle != ''">
|
|
|
and engin_cycle = 0
|
|
|
</if>
|
|
|
- order by a.update_info_time desc
|
|
|
- LIMIT #{page},#{size}
|
|
|
+ order by a.update_info_time asc
|
|
|
+ LIMIT #{page},#{size}
|
|
|
) AS at)
|
|
|
- order by a.update_info_time desc
|
|
|
+ order by a.update_info_time asc
|
|
|
</select>
|
|
|
<select id="queryAllList" resultType="com.ruoyi.zdsz.domain.vo.ZEngineeringCivilVo">
|
|
|
select
|
|
@@ -164,8 +278,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
CONVERT ( REPLACE ( e.name, '号', '' ), UNSIGNED ) ASC
|
|
|
</select>
|
|
|
<select id="queryPageIdList" resultType="com.ruoyi.zdsz.domain.vo.ZEngineeringCivilVo">
|
|
|
- select
|
|
|
- #{total} as total,
|
|
|
+ select
|
|
|
+ #{total} as total,
|
|
|
a.*,
|
|
|
if(b.name is null , '未知' ,b.NAME) AS areaName,
|
|
|
if(c.name is null , '未知' ,c.NAME) AS buildingName,
|
|
@@ -178,10 +292,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
left join z_unit d on d.id = a.unit_id
|
|
|
left join z_house e on e.id = a.house_id
|
|
|
left join sys_dict_data f on f.dict_type = a.engin_type and f.dict_value = a.engin_classification
|
|
|
- where a.id in <foreach collection="idList" item="name" open="(" separator="," close=")">
|
|
|
- #{name}
|
|
|
- </foreach>
|
|
|
- order by a.update_info_time desc
|
|
|
+ where a.id in
|
|
|
+ <foreach collection="idList" item="name" open="(" separator="," close=")">
|
|
|
+ #{name}
|
|
|
+ </foreach>
|
|
|
+ order by a.update_info_time asc
|
|
|
</select>
|
|
|
<select id="getObtainRoomcCompletionInformationList" resultType="com.ruoyi.zdsz.domain.vo.roomStatusVo">
|
|
|
select
|
|
@@ -200,7 +315,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</if>
|
|
|
LIMIT 1),'未施工')) AS roomStatus,
|
|
|
b.create_time,
|
|
|
- CAST(CONCAT( REPLACE ( bd.NAME, '栋', '' ),REPLACE ( c.NAME, '单元', '' )) AS SIGNED) AS unitOrder
|
|
|
+ CONCAT( REPLACE ( bd.NAME, '栋', '' ),REPLACE ( c.NAME, '单元', '' )) AS unitOrder
|
|
|
FROM
|
|
|
z_house a
|
|
|
LEFT JOIN z_engineering_civil b ON a.id = b.house_id
|
|
@@ -224,7 +339,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
and a.unit_id = #{unitId}
|
|
|
</if>
|
|
|
order by
|
|
|
- unitOrder,
|
|
|
+ CAST(unitOrder AS SIGNED),
|
|
|
+ unitName,
|
|
|
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(a.`name`,')',''),'(',''),')',''),'(',''),'号','') ASC
|
|
|
</select>
|
|
|
|
|
@@ -363,13 +479,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</if>
|
|
|
WHERE
|
|
|
zh.del_flag = 0
|
|
|
- AND zh.area_id in
|
|
|
+ AND zh.area_id in
|
|
|
<foreach collection="idList" item="name" open="(" separator="," close=")">
|
|
|
#{name}
|
|
|
</foreach>
|
|
|
ORDER BY za.id ASC
|
|
|
</select>
|
|
|
- <select id="getAreaCompletionInformationList2" resultType="com.ruoyi.zdsz.domain.vo.areaWillDoneVo">
|
|
|
+ <select id="getAreaCompletionInformationList2" resultType="com.ruoyi.zdsz.domain.vo.areaWillDoneVo">
|
|
|
SELECT
|
|
|
za.id as areaId,
|
|
|
za.NAME,
|
|
@@ -393,68 +509,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
ORDER BY za.id ASC
|
|
|
</select>
|
|
|
<select id="getsumStatus" resultType="java.util.Map">
|
|
|
- select
|
|
|
- MAX(CASE aas.statu WHEN '未施工' THEN aas.num ELSE 0 END ) weishigong,
|
|
|
- MAX(CASE aas.statu WHEN '施工中' THEN aas.num ELSE 0 END ) shigongzhong ,
|
|
|
- MAX(CASE aas.statu WHEN '竣工' THEN aas.num ELSE 0 END ) jungong
|
|
|
- FROM (
|
|
|
- SELECT
|
|
|
-
|
|
|
- al.completion_status AS statu,
|
|
|
+ select MAX(CASE aas.statu WHEN '未施工' THEN aas.num ELSE 0 END) weishigong,
|
|
|
+ MAX(CASE aas.statu WHEN '施工中' THEN aas.num ELSE 0 END) shigongzhong,
|
|
|
+ MAX(CASE aas.statu WHEN '竣工' THEN aas.num ELSE 0 END) jungong
|
|
|
+ FROM (SELECT al.completion_status AS statu,
|
|
|
COUNT(ISNULL(al.completion_status)) AS num
|
|
|
- FROM (
|
|
|
- SELECT
|
|
|
- IF(ISNULL(zec.completion_status),'未施工',zec.completion_status) completion_status
|
|
|
- FROM z_house zh
|
|
|
- LEFT JOIN z_engineering_civil zec on zec.house_id = zh.id and zec.del_flag = '0'
|
|
|
- WHERE zh.area_id IN (SELECT id FROM z_area za WHERE za.district = #{district} and za.del_flag = '0')
|
|
|
- ) al GROUP BY al.completion_status) aas
|
|
|
+ FROM (SELECT IF(ISNULL(zec.completion_status), '未施工', zec.completion_status) completion_status
|
|
|
+ FROM z_house zh
|
|
|
+ LEFT JOIN z_engineering_civil zec on zec.house_id = zh.id and zec.del_flag = '0'
|
|
|
+ WHERE zh.area_id IN
|
|
|
+ (SELECT id FROM z_area za WHERE za.district = #{district} and za.del_flag = '0')) al
|
|
|
+ GROUP BY al.completion_status) aas
|
|
|
</select>
|
|
|
<select id="getHouseMessage" resultType="com.ruoyi.zdsz.domain.vo.areaMessageVo">
|
|
|
- SELECT
|
|
|
- a.`name` AS houseId,
|
|
|
- b.`name` AS unitId,
|
|
|
- c.`name` AS buildingId,
|
|
|
- d.name AS areaId,
|
|
|
- e.dict_label AS district
|
|
|
- FROM
|
|
|
- z_house a
|
|
|
- LEFT JOIN z_unit b ON a.unit_id=b.id
|
|
|
- LEFT JOIN z_building c ON a.building_id=c.id
|
|
|
- LEFT JOIN z_area d ON a.area_id=d.id
|
|
|
- LEFT JOIN sys_dict_data e ON e.dict_value=d.district
|
|
|
- WHERE
|
|
|
- a.id = #{id}
|
|
|
- </select>
|
|
|
+ SELECT a.`name` AS houseId,
|
|
|
+ b.`name` AS unitId,
|
|
|
+ c.`name` AS buildingId,
|
|
|
+ d.name AS areaId,
|
|
|
+ e.dict_label AS district
|
|
|
+ FROM z_house a
|
|
|
+ LEFT JOIN z_unit b ON a.unit_id = b.id
|
|
|
+ LEFT JOIN z_building c ON a.building_id = c.id
|
|
|
+ LEFT JOIN z_area d ON a.area_id = d.id
|
|
|
+ LEFT JOIN sys_dict_data e ON e.dict_value = d.district
|
|
|
+ WHERE a.id = #{id}
|
|
|
+ </select>
|
|
|
<select id="getAreaMessage" resultType="com.ruoyi.zdsz.domain.vo.areaMessageVo">
|
|
|
- SELECT
|
|
|
- a.`name` AS buildingId,
|
|
|
- d.name AS areaId,
|
|
|
- e.dict_label AS district
|
|
|
- FROM
|
|
|
- z_building a
|
|
|
- LEFT JOIN z_area d ON a.area_id=d.id
|
|
|
- LEFT JOIN sys_dict_data e ON e.dict_value=d.district
|
|
|
- WHERE
|
|
|
- a.id = #{id}
|
|
|
+ SELECT a.`name` AS buildingId,
|
|
|
+ d.name AS areaId,
|
|
|
+ e.dict_label AS district
|
|
|
+ FROM z_building a
|
|
|
+ LEFT JOIN z_area d ON a.area_id = d.id
|
|
|
+ LEFT JOIN sys_dict_data e ON e.dict_value = d.district
|
|
|
+ WHERE a.id = #{id}
|
|
|
</select>
|
|
|
<select id="getAreaName" resultType="com.ruoyi.zdsz.domain.vo.areaMessageVo">
|
|
|
- SELECT
|
|
|
- a.`name` AS areaId,
|
|
|
- e.dict_label AS district
|
|
|
- FROM
|
|
|
- z_area a
|
|
|
- LEFT JOIN sys_dict_data e ON e.dict_value = a.district
|
|
|
- WHERE
|
|
|
- a.id = #{id}
|
|
|
+ SELECT a.`name` AS areaId,
|
|
|
+ e.dict_label AS district
|
|
|
+ FROM z_area a
|
|
|
+ LEFT JOIN sys_dict_data e ON e.dict_value = a.district
|
|
|
+ WHERE a.id = #{id}
|
|
|
</select>
|
|
|
<select id="getTableNames" resultType="String">
|
|
|
- SELECT
|
|
|
- table_name as tableName
|
|
|
- FROM
|
|
|
- information_schema.TABLES
|
|
|
- WHERE
|
|
|
- table_name like CONCAT(#{tableName},'%') GROUP BY table_name
|
|
|
+ SELECT table_name as tableName
|
|
|
+ FROM information_schema.TABLES
|
|
|
+ WHERE table_name like CONCAT(#{tableName}, '%')
|
|
|
+ GROUP BY table_name
|
|
|
</select>
|
|
|
<select id="getsumId" resultType="com.ruoyi.zdsz.domain.bo.ZEngineeringInfoBo">
|
|
|
SELECT
|
|
@@ -462,12 +562,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
FROM
|
|
|
z_engineering_info
|
|
|
WHERE
|
|
|
- 1=1
|
|
|
+ 1=1
|
|
|
<if test="createTime != null and createTime != ''">
|
|
|
and update_info_time between #{createTime[0]} and #{createTime[1]}
|
|
|
</if>
|
|
|
<if test="UserName != null and UserName != ''">
|
|
|
- and create_by like CONCAT('%',#{UserName},'%')
|
|
|
+ and create_by like CONCAT('%',#{UserName},'%')
|
|
|
</if>
|
|
|
<foreach collection="tableNames" item="name">
|
|
|
union
|
|
@@ -478,7 +578,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
WHERE
|
|
|
1=1
|
|
|
<if test="createTime != null and createTime != ''">
|
|
|
- and update_info_time between #{createTime[0]} and #{createTime[1]}
|
|
|
+ and update_info_time between #{createTime[0]} and #{createTime[1]}
|
|
|
</if>
|
|
|
<if test="UserName != null and UserName != ''">
|
|
|
and create_by like CONCAT('%',#{UserName},'%')
|
|
@@ -488,14 +588,99 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
<select id="getexportList" resultType="com.ruoyi.zdsz.domain.vo.ZEngineeringCivilExportVo">
|
|
|
select * from (
|
|
|
+ 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 #{p.beginTime[0]} and #{p.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
|
|
|
a.id,
|
|
|
- (SELECT dict_label FROM `sys_dict_data` WHERE dict_type = 'district' AND dict_value = a.district) AS district,
|
|
|
+ (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,
|
|
|
+ (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
|
|
@@ -524,10 +709,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 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
|
|
|
+ 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
|
|
@@ -536,11 +721,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_material_quality l ON l.id = d.corrosion_level
|
|
|
+ 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(#{createTime}, '_', '-'),'%')
|
|
|
+ a.create_time LIKE CONCAT(REPLACE(#{name}, '_', '-'),'%')
|
|
|
<if test="p.district != null and p.district != ''">
|
|
|
and a.district = #{p.district}
|
|
|
</if>
|
|
@@ -563,94 +748,200 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
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]}
|
|
|
+ and c.update_info_time between #{p.beginTime[0]} and #{p.beginTime[1]}
|
|
|
+ </if>
|
|
|
+ <if test="p.createBy != null and p.createBy != ''">
|
|
|
+ and c.create_by like CONCAT(#{p.createBy},'%')
|
|
|
+ </if>
|
|
|
+ </foreach>
|
|
|
+ union SELECT
|
|
|
+ a.id,
|
|
|
+ b.dict_label as district,
|
|
|
+ a.area_name as area_id,
|
|
|
+ a.building_name as building_id,
|
|
|
+ a.unit_name as unit_id,
|
|
|
+ a.house_name as house_id,
|
|
|
+ e.dict_label as source,
|
|
|
+ '室内' AS engin_classification,
|
|
|
+ CASE
|
|
|
+ a.engin_type
|
|
|
+ WHEN 'new_built' THEN
|
|
|
+ '新建' ELSE '旧改'
|
|
|
+ END as engin_type,
|
|
|
+ concat(c.dict_label,'——',a.remark) as completion_status,
|
|
|
+ null AS type,
|
|
|
+ null AS construct_addre,
|
|
|
+ null AS construct_according_drawings,
|
|
|
+ null AS segmented_compression_qualified,
|
|
|
+ null AS backfill_time,
|
|
|
+ null AS construct_phone,
|
|
|
+ null AS construct_time,
|
|
|
+ null AS head_name,
|
|
|
+ null AS head_phone,
|
|
|
+ null AS visit_type,
|
|
|
+ null AS corrosion_level,
|
|
|
+ null AS self_closing_valve_type,
|
|
|
+ null AS brand,
|
|
|
+ null AS material_quality,
|
|
|
+ null AS specifications,
|
|
|
+ null AS number,
|
|
|
+ null AS updateInfoTime,
|
|
|
+ null AS createBy,
|
|
|
+ null AS remark,
|
|
|
+ null AS remarkd
|
|
|
+ FROM
|
|
|
+ z_engin_not_installed a
|
|
|
+ LEFT JOIN sys_dict_data b ON a.district = b.dict_value AND b.dict_type = 'district'
|
|
|
+ LEFT JOIN sys_dict_data c ON a.type = c.dict_value and c.dict_type = 'not_installed_type'
|
|
|
+ left join z_house d on a.house_id=d.id
|
|
|
+ LEFT JOIN sys_dict_data e ON d.source = e.dict_value and e.dict_type = 'community_source'
|
|
|
+ where a.del_flag = 0
|
|
|
+ and d.del_flag = 0
|
|
|
+ <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.houseId != null and p.houseId != ''">
|
|
|
+ and a.unit_id = #{p.houseId}
|
|
|
+ </if>
|
|
|
+ <if test="p.enginType != null and p.enginType != ''">
|
|
|
+ and a.engin_type = #{p.enginType}
|
|
|
+ </if>
|
|
|
+ <if test="p.beginTime != null and p.beginTime != ''">
|
|
|
+ and a.create_time between #{p.beginTime[0]} and #{p.beginTime[1]}
|
|
|
+ </if>
|
|
|
+ <if test="p.createBy != null and p.createBy != ''">
|
|
|
+ and a.create_by like CONCAT(#{p.createBy},'%')
|
|
|
+ </if>
|
|
|
+ ) 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="getexportListColor" resultType="com.ruoyi.zdsz.domain.vo.ZEngineeringCivilExportVo">
|
|
|
+ select * from (
|
|
|
+ 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,
|
|
|
+ (select r.review_status from z_engineering_review r where b.id=r.eng_info_id ORDER BY r.review_time desc LIMIT 1
|
|
|
+ ) AS reviewStatus
|
|
|
+ FROM
|
|
|
+ z_engineering_civil a
|
|
|
+ LEFT JOIN z_engineering_node b ON a.id = b.civli_id
|
|
|
+ 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
|
|
|
+ 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.createBy != null and p.createBy != ''">
|
|
|
+ and c.create_by like CONCAT(#{p.createBy},'%')
|
|
|
+ </if>
|
|
|
+ <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,
|
|
|
+ (select r.review_status from z_engineering_review_${name} r where b.id=r.eng_info_id ORDER BY r.review_time
|
|
|
+ desc LIMIT 1 ) AS reviewStatus
|
|
|
+ FROM
|
|
|
+ z_engineering_civil a
|
|
|
+ LEFT JOIN z_engineering_node_${name} b ON a.id = b.civli_id
|
|
|
+ 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
|
|
|
+ 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.createBy != null and p.createBy != ''">
|
|
|
and c.create_by like CONCAT(#{p.createBy},'%')
|
|
|
</if>
|
|
|
- <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>
|
|
|
+ </foreach>
|
|
|
) z
|
|
|
ORDER BY
|
|
|
z.area_id,
|
|
@@ -666,8 +957,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
SELECT
|
|
|
a.*
|
|
|
FROM
|
|
|
- z_engineering_civil a
|
|
|
- LEFT JOIN z_engineering_node b ON a.id=b.civli_id
|
|
|
+ z_engineering_civil a
|
|
|
+ LEFT JOIN z_engineering_node b ON a.id=b.civli_id
|
|
|
where 1=1
|
|
|
<if test="p.district != null and p.district != ''">
|
|
|
and a.district = #{p.district}
|
|
@@ -691,7 +982,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
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]}
|
|
|
+ and a.update_info_time between #{p.beginTime[0]} and #{p.beginTime[1]}
|
|
|
</if>
|
|
|
<if test="p.type != null and p.type != ''">
|
|
|
and b.type =#{p.type}
|
|
@@ -701,8 +992,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
SELECT
|
|
|
a.*
|
|
|
FROM
|
|
|
- z_engineering_civil a
|
|
|
- LEFT JOIN z_engineering_node_${name} b ON a.id=b.civli_id
|
|
|
+ z_engineering_civil a
|
|
|
+ LEFT JOIN z_engineering_node_${name} b ON a.id=b.civli_id
|
|
|
where 1=1
|
|
|
<if test="p.district != null and p.district != ''">
|
|
|
and a.district = #{p.district}
|
|
@@ -726,12 +1017,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
and a.engin_cycle = 0
|
|
|
</if>
|
|
|
<if test="p.beginTime != null and p.beginTime != ''">
|
|
|
- and a.update_info_time between #{beginTime[0]} and #{beginTime[1]}
|
|
|
+ and a.update_info_time between #{p.beginTime[0]} and #{p.beginTime[1]}
|
|
|
</if>
|
|
|
<if test="p.type != null and p.type != ''">
|
|
|
and b.type =#{p.type}
|
|
|
</if>
|
|
|
</foreach>
|
|
|
- ) as c
|
|
|
+ ) as c
|
|
|
+ </select>
|
|
|
+ <select id="getexportNotInstalled" resultType="com.ruoyi.zdsz.domain.vo.ZEngineeringCivilExportVo">
|
|
|
+
|
|
|
</select>
|
|
|
</mapper>
|