|
@@ -446,4 +446,80 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</if>
|
|
|
</foreach>
|
|
|
</select>
|
|
|
+ <select id="getTypeNumber" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ COUNT( DISTINCT c.id)
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.*
|
|
|
+ FROM
|
|
|
+ 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}
|
|
|
+ </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 engin_type = #{p.enginType}
|
|
|
+ </if>
|
|
|
+ <if test="p.enginClassification != null and p.enginClassification != ''">
|
|
|
+ and engin_classification = #{p.enginClassification}
|
|
|
+ </if>
|
|
|
+ <if test="p.enginCycle != null and p.enginCycle != ''">
|
|
|
+ and engin_cycle = 0
|
|
|
+ </if>
|
|
|
+ <if test="p.beginTime != null and p.beginTime != ''">
|
|
|
+ and update_info_time between #{beginTime[0]} and #{beginTime[1]}
|
|
|
+ </if>
|
|
|
+ <if test="p.type != null and p.type != ''">
|
|
|
+ and b.type =#{p.type}
|
|
|
+ </if>
|
|
|
+ <foreach collection="tableNames" item="name">
|
|
|
+ union
|
|
|
+ SELECT
|
|
|
+ a.*
|
|
|
+ FROM
|
|
|
+ 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}
|
|
|
+ </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 a.update_info_time between #{beginTime[0]} and #{beginTime[1]}
|
|
|
+ </if>
|
|
|
+ <if test="p.type != null and p.type != ''">
|
|
|
+ and b.type =#{p.type}
|
|
|
+ </if>
|
|
|
+ </foreach>
|
|
|
+ ) as c
|
|
|
+ </select>
|
|
|
</mapper>
|