|
@@ -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.ZAreaMapper">
|
|
|
|
|
|
<resultMap type="com.ruoyi.zdsz.domain.ZArea" id="ZAreaResult">
|
|
@@ -22,29 +22,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="getByName" resultType="com.ruoyi.zdsz.domain.ZArea">
|
|
|
- select * from z_area
|
|
|
+ select *
|
|
|
+ from z_area
|
|
|
where name = #{name}
|
|
|
and del_flag = '0'
|
|
|
</select>
|
|
|
|
|
|
<select id="getArea" resultType="com.ruoyi.zdsz.domain.vo.ZAreaVo">
|
|
|
- select id as id,
|
|
|
- name as name
|
|
|
+ select id as id,
|
|
|
+ name as name
|
|
|
from z_area
|
|
|
where del_flag = '0'
|
|
|
<if test="district != null and district != ''">
|
|
|
and district = #{district}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <select id="selectGExportsList" resultType="com.ruoyi.zdsz.domain.vo.GImportVo">
|
|
|
+ SELECT za.name AS areaName,
|
|
|
+ sd.dict_label AS district,
|
|
|
+ zb.name AS buildName,
|
|
|
+ zn.name AS unitName,
|
|
|
+ zh.name AS houseName
|
|
|
+ FROM z_area za
|
|
|
+ LEFT JOIN sys_dict_data sd on sd.dict_type = 'district' and za.district = sd.dict_value
|
|
|
+ LEFT JOIN z_building zb on zb.area_id = za.id and zb.del_flag = 0
|
|
|
+ LEFT JOIN z_unit zn on zn.building_id = zb.id and zn.del_flag = 0
|
|
|
+ LEFT JOIN z_house zh on zh.unit_id = zn.id and zh.del_flag = 0
|
|
|
+ WHERE za.del_flag = 0
|
|
|
+ </select>
|
|
|
<select id="getExport" resultType="com.ruoyi.zdsz.domain.vo.GExportsVo">
|
|
|
- SELECT a.name AS areaName,
|
|
|
- a.district AS district,
|
|
|
+ SELECT a.name AS areaName,
|
|
|
+ a.district AS district,
|
|
|
a.calculate_district AS calculateDistrict,
|
|
|
- a.scale AS scale,
|
|
|
- a.belonging_pack AS belongingPack,
|
|
|
+ a.scale AS scale,
|
|
|
+ a.belonging_pack AS belongingPack,
|
|
|
COUNT(b.area_id) AS count
|
|
|
FROM z_area a
|
|
|
- LEFT JOIN z_engineering_civil b ON (b.area_id = a.id AND b.del_flag = '0')
|
|
|
+ LEFT JOIN z_engineering_civil b
|
|
|
+ ON (b.area_id = a.id AND b.del_flag = '0')
|
|
|
WHERE a.del_flag = '0'
|
|
|
AND a.calculate_district = #{calculateDistrict}
|
|
|
AND a.belonging_pack = #{belongingPack}
|
|
@@ -52,10 +67,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
</select>
|
|
|
<select id="getDictNameOfAffiliatedPackage" resultType="string">
|
|
|
- SELECT
|
|
|
- CONCAT(a.dict_label,'-工程任务单(',b.dict_label,')') AS name
|
|
|
+ SELECT CONCAT(a.dict_label, '-工程任务单(', b.dict_label, ')') AS name
|
|
|
FROM `sys_dict_data` a
|
|
|
- LEFT JOIN sys_dict_data b ON (b.dict_type = 'belonging_pack' AND b.dict_value = #{belongingPack})
|
|
|
- WHERE a.dict_type = 'district' AND a.dict_value = #{calculateDistrict}
|
|
|
+ LEFT JOIN sys_dict_data b ON (b.dict_type = 'belonging_pack' AND b.dict_value = #{belongingPack})
|
|
|
+ WHERE a.dict_type = 'district'
|
|
|
+ AND a.dict_value = #{calculateDistrict}
|
|
|
</select>
|
|
|
</mapper>
|