From 10234ae97b1031e0d4bf816efb5eaaee7e52dff7 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Tue, 23 Jan 2024 11:34:12 +0800
Subject: [PATCH] 大坝业务一张图接口逻辑修改
---
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/mapper/DamSecurityMapper.xml | 641 ++++++++++++++++++++++++----------------------------
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/mapper/DamSecurityMapper.java | 6
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/controller/DamSecurityController.java | 20 +
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/service/impl/DamSecurityServiceImpl.java | 26 +
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/service/IDamSecurityService.java | 2
5 files changed, 341 insertions(+), 354 deletions(-)
diff --git a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/controller/DamSecurityController.java b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/controller/DamSecurityController.java
index d63ec9a..f255202 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/controller/DamSecurityController.java
+++ b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/controller/DamSecurityController.java
@@ -151,15 +151,27 @@
return R.data(list);
}
+// /**
+// * 业务一张图 大坝安全监测
+// * @param adCode
+// * @return
+// */
+// @ApiOperation(value = "大坝安全统计-大坝安全监测", notes = "大坝安全统计-大坝安全监测")
+// @GetMapping(value = "/damResInfoCount")
+// public R damResInfoCount(String adCode){
+// List<DamStatisticsRes> list = damSecurityService.damResInfoCount(adCode);
+// return R.data(list);
+// }
+
/**
- * 业务一张图 大坝安全监测
+ * 业务一张图 大坝安全监测(优化)
* @param adCode
* @return
*/
@ApiOperation(value = "大坝安全统计-大坝安全监测", notes = "大坝安全统计-大坝安全监测")
@GetMapping(value = "/damResInfoCount")
- public R damResInfoCount(String adCode){
- List<DamStatisticsRes> list = damSecurityService.damResInfoCount(adCode);
+ public R damResInfoCountOptimize(String adCode){
+ List<DamStatisticsRes> list = damSecurityService.damResInfoCountOptimize(adCode);
return R.data(list);
}
@@ -175,7 +187,7 @@
return R.data(list);
}
- @GetMapping(value = "/getDamInfoCountByRegion")
+ @GetMapping(value = "/getDamInfoCountByRegion")//已修改逻辑
public R getDamInfoCountByRegion(DamStatisticsRegion damStatisticsRegion){
List<DamStatisticsRegion> list = damSecurityService.getDamInfoCountByRegion(damStatisticsRegion);
return R.data(list);
diff --git a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/mapper/DamSecurityMapper.java b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/mapper/DamSecurityMapper.java
index a60d0bc..dfb6f16 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/mapper/DamSecurityMapper.java
+++ b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/mapper/DamSecurityMapper.java
@@ -59,4 +59,10 @@
List<DamStatisticsRegion> getDamSlRegionNormal(@Param("dam") DamStatisticsRegion damStatisticsRegion);
List<DamStatisticsRegion> getDamWyRegionNormal(@Param("dam") DamStatisticsRegion damStatisticsRegion);
+
+ DamStatisticsRes damResInfoCountSy(@Param("adCode") String adCode);
+
+ DamStatisticsRes damResInfoCountSl(@Param("adCode") String adCode);
+
+ DamStatisticsRes damResInfoCountWy(@Param("adCode") String adCode);
}
diff --git a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/mapper/DamSecurityMapper.xml b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/mapper/DamSecurityMapper.xml
index bd2582a..809085d 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/mapper/DamSecurityMapper.xml
+++ b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/mapper/DamSecurityMapper.xml
@@ -1488,24 +1488,21 @@
FROM(
- SELECT "res_cd", COUNT(*) syStation
+ SELECT
+ distinct (dri."res_cd")
FROM
- (
- SELECT b."guid" as "res_cd",'sy' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spprmp" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ sjzt_dw."dim_res_info_a" dri
+ LEFT JOIN sjzt_ods."dsm_spg_spprmp" dss ON dri."oth_reg_cd" = dss."rscd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1=1
+
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
) resList
@@ -1557,24 +1554,21 @@
FROM(
- SELECT "res_cd", COUNT(*) syStation
+ SELECT
+ distinct (dri."res_cd")
FROM
- (
- SELECT b."guid" as "res_cd",'sy' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spprmp" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ sjzt_dw."dim_res_info_a" dri
+ LEFT JOIN sjzt_ods."dsm_spg_spprmp" dss ON dri."oth_reg_cd" = dss."rscd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1=1
+
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
) resList
@@ -1625,24 +1619,21 @@
FROM(
- SELECT "res_cd", COUNT(*) syStation
+ SELECT
+ distinct (dri."res_cd")
FROM
- (
- SELECT b."guid" as "res_cd",'sy' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spprmp" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ sjzt_dw."dim_res_info_a" dri
+ LEFT JOIN sjzt_ods."dsm_spg_spprmp" dss ON dri."oth_reg_cd" = dss."rscd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1=1
+
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
) resList
@@ -1693,24 +1684,21 @@
FROM(
- SELECT "res_cd", COUNT(*) syStation
- FROM
- (
- SELECT b."guid" as "res_cd",'sy' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spprmp" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
- LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
- LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
- LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
- LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1=1
- <if test=" dam.adCode!= null and dam.adCode !='' ">
- AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
- </if>
- GROUP BY "res_cd"
+ SELECT
+ distinct (dri."res_cd")
+ FROM
+ sjzt_dw."dim_res_info_a" dri
+ LEFT JOIN sjzt_ods."dsm_spg_spprmp" dss ON dri."oth_reg_cd" = dss."rscd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
+ LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
+ LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
+
+ where dss."rscd" is not null
+ <if test=" dam.adCode!= null and dam.adCode !='' ">
+ AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
+ </if>
) resList
@@ -1763,31 +1751,18 @@
FROM(
- SELECT
- "res_cd",
- COUNT(*) slStation
- FROM (
- SELECT
- b."guid" as "res_cd",
- 'sl' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spqn" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE
- b."guid" IS NOT NULL
- AND a."mstm" >=now()-30 and a."mstm"<= now()
-
-
- group by b."guid"
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct(dri."res_cd")
+ from sjzt_dw."dim_res_info_a" dri
+ left join sjzt_ods."dsm_spg_spqnmp" dss on trim(dss."rscd") = dri."oth_reg_cd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
) resList
@@ -1839,32 +1814,18 @@
FROM(
- SELECT
- "res_cd",
- COUNT(*) slStation
- FROM (
- SELECT
- b."guid" as "res_cd",
- 'sl' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spqn" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE
- b."guid" IS NOT NULL
- AND a."mstm" >=now()-30 and a."mstm"<= now()
-
-
- group by b."guid"
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct(dri."res_cd")
+ from sjzt_dw."dim_res_info_a" dri
+ left join sjzt_ods."dsm_spg_spqnmp" dss on trim(dss."rscd") = dri."oth_reg_cd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- where 1=1
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
) resList
@@ -1915,33 +1876,18 @@
FROM(
-
- SELECT
- "res_cd",
- COUNT(*) slStation
- FROM (
- SELECT
- b."guid" as "res_cd",
- 'sl' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spqn" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE
- b."guid" IS NOT NULL
- AND a."mstm" >=now()-30 and a."mstm"<= now()
-
-
- group by b."guid"
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct(dri."res_cd")
+ from sjzt_dw."dim_res_info_a" dri
+ left join sjzt_ods."dsm_spg_spqnmp" dss on trim(dss."rscd") = dri."oth_reg_cd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- where 1=1
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
) resList
@@ -1992,32 +1938,18 @@
- SELECT
- "res_cd",
- COUNT(*) slStation
- FROM (
- SELECT
- b."guid" as "res_cd",
- 'sl' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spqn" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE
- b."guid" IS NOT NULL
- AND a."mstm" >=now()-30 and a."mstm"<= now()
-
-
- group by b."guid"
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct(dri."res_cd")
+ from sjzt_dw."dim_res_info_a" dri
+ left join sjzt_ods."dsm_spg_spqnmp" dss on trim(dss."rscd") = dri."oth_reg_cd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- where 1=1
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
) resList
@@ -2069,26 +2001,16 @@
FROM(
- SELECT "res_cd",COUNT(*) wyStation
- FROM
- (
- SELECT b."guid" as "res_cd",'wy' as "sys_resource"
- FROM
- (
- SELECT "station_code" from sjzt_md."att_mqtt_calc_data" group by "station_code"
- ) a LEFT JOIN SJZT_MD."att_res_base" b on substr(a."station_code",0,length(a."station_code")-2) = b."guid"
- where b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct("res_cd") from sjzt_md."att_wy_cd_base" awcb
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = awcb."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1= 1
+ where awcb."cd" != '00'
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
) resList
@@ -2140,26 +2062,16 @@
FROM(
- SELECT "res_cd",COUNT(*) wyStation
- FROM
- (
- SELECT b."guid" as "res_cd",'wy' as "sys_resource"
- FROM
- (
- SELECT "station_code" from sjzt_md."att_mqtt_calc_data" group by "station_code"
- ) a LEFT JOIN SJZT_MD."att_res_base" b on substr(a."station_code",0,length(a."station_code")-2) = b."guid"
- where b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct("res_cd") from sjzt_md."att_wy_cd_base" awcb
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = awcb."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1= 1
+ where awcb."cd" != '00'
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
) resList
@@ -2211,26 +2123,16 @@
- SELECT "res_cd",COUNT(*) wyStation
- FROM
- (
- SELECT b."guid" as "res_cd",'wy' as "sys_resource"
- FROM
- (
- SELECT "station_code" from sjzt_md."att_mqtt_calc_data" group by "station_code"
- ) a LEFT JOIN SJZT_MD."att_res_base" b on substr(a."station_code",0,length(a."station_code")-2) = b."guid"
- where b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct("res_cd") from sjzt_md."att_wy_cd_base" awcb
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = awcb."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1= 1
+ where awcb."cd" != '00'
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
) resList
@@ -2282,26 +2184,16 @@
- SELECT "res_cd",COUNT(*) wyStation
- FROM
- (
- SELECT b."guid" as "res_cd",'wy' as "sys_resource"
- FROM
- (
- SELECT "station_code" from sjzt_md."att_mqtt_calc_data" group by "station_code"
- ) a LEFT JOIN SJZT_MD."att_res_base" b on substr(a."station_code",0,length(a."station_code")-2) = b."guid"
- where b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct("res_cd") from sjzt_md."att_wy_cd_base" awcb
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = awcb."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1= 1
+ where awcb."cd" != '00'
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
) resList
@@ -2640,24 +2532,21 @@
- SELECT "res_cd", COUNT(*) syStation
+ SELECT
+ distinct (dri."res_cd")
FROM
- (
- SELECT b."guid" as "res_cd",'sy' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spprmp" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ sjzt_dw."dim_res_info_a" dri
+ LEFT JOIN sjzt_ods."dsm_spg_spprmp" dss ON dri."oth_reg_cd" = dss."rscd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1=1
+
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
@@ -2739,24 +2628,26 @@
SELECT normalList."res_cd" as resCd FROM (
SELECT allList."res_cd",errorList."name" FROM (
- SELECT "res_cd", COUNT(*) syStation
+
+
+ SELECT
+ distinct (dri."res_cd")
FROM
- (
- SELECT b."guid" as "res_cd",'sy' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spprmp" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ sjzt_dw."dim_res_info_a" dri
+ LEFT JOIN sjzt_ods."dsm_spg_spprmp" dss ON dri."oth_reg_cd" = dss."rscd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1=1
+
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
+
+
+
) allList LEFT JOIN
(
@@ -2835,24 +2726,29 @@
SELECT normalList."res_cd" as resCd FROM (
SELECT allList."res_cd",errorList."name" FROM (
- SELECT "res_cd", COUNT(*) syStation
+
+
+
+
+ SELECT
+ distinct (dri."res_cd")
FROM
- (
- SELECT b."guid" as "res_cd",'sy' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spprmp" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ sjzt_dw."dim_res_info_a" dri
+ LEFT JOIN sjzt_ods."dsm_spg_spprmp" dss ON dri."oth_reg_cd" = dss."rscd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1=1
+
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
+
+
+
+
) allList LEFT JOIN
(
@@ -2929,24 +2825,29 @@
SELECT normalList."res_cd" as resCd FROM (
SELECT allList."res_cd",errorList."name" FROM (
- SELECT "res_cd", COUNT(*) syStation
+
+
+
+
+ SELECT
+ distinct (dri."res_cd")
FROM
- (
- SELECT b."guid" as "res_cd",'sy' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spprmp" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ sjzt_dw."dim_res_info_a" dri
+ LEFT JOIN sjzt_ods."dsm_spg_spprmp" dss ON dri."oth_reg_cd" = dss."rscd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1=1
+
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
+
+
+
+
) allList LEFT JOIN
(
@@ -3028,32 +2929,18 @@
- SELECT
- "res_cd",
- COUNT(*) slStation
- FROM (
- SELECT
- b."guid" as "res_cd",
- 'sl' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spqn" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE
- b."guid" IS NOT NULL
- AND a."mstm" >=now()-30 and a."mstm"<= now()
-
-
- group by b."guid"
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct(dri."res_cd")
+ from sjzt_dw."dim_res_info_a" dri
+ left join sjzt_ods."dsm_spg_spqnmp" dss on trim(dss."rscd") = dri."oth_reg_cd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- where 1=1
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
@@ -3139,32 +3026,18 @@
- SELECT
- "res_cd",
- COUNT(*) slStation
- FROM (
- SELECT
- b."guid" as "res_cd",
- 'sl' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spqn" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE
- b."guid" IS NOT NULL
- AND a."mstm" >=now()-30 and a."mstm"<= now()
-
-
- group by b."guid"
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct(dri."res_cd")
+ from sjzt_dw."dim_res_info_a" dri
+ left join sjzt_ods."dsm_spg_spqnmp" dss on trim(dss."rscd") = dri."oth_reg_cd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- where 1=1
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
@@ -3249,32 +3122,18 @@
- SELECT
- "res_cd",
- COUNT(*) slStation
- FROM (
- SELECT
- b."guid" as "res_cd",
- 'sl' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spqn" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE
- b."guid" IS NOT NULL
- AND a."mstm" >=now()-30 and a."mstm"<= now()
-
-
- group by b."guid"
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct(dri."res_cd")
+ from sjzt_dw."dim_res_info_a" dri
+ left join sjzt_ods."dsm_spg_spqnmp" dss on trim(dss."rscd") = dri."oth_reg_cd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- where 1=1
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
@@ -3357,32 +3216,18 @@
- SELECT
- "res_cd",
- COUNT(*) slStation
- FROM (
- SELECT
- b."guid" as "res_cd",
- 'sl' as "sys_resource"
- FROM sjzt_ods."dsm_spg_spqn" a
- LEFT JOIN SJZT_MD."att_res_base" b on a."rscd" = b."res_reg_code"
- WHERE
- b."guid" IS NOT NULL
- AND a."mstm" >=now()-30 and a."mstm"<= now()
-
-
- group by b."guid"
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct(dri."res_cd")
+ from sjzt_dw."dim_res_info_a" dri
+ left join sjzt_ods."dsm_spg_spqnmp" dss on trim(dss."rscd") = dri."oth_reg_cd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- where 1=1
+ where dss."rscd" is not null
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
@@ -3474,26 +3319,16 @@
- SELECT "res_cd",COUNT(*) wyStation
- FROM
- (
- SELECT b."guid" as "res_cd",'wy' as "sys_resource"
- FROM
- (
- SELECT "station_code" from sjzt_md."att_mqtt_calc_data" group by "station_code"
- ) a LEFT JOIN SJZT_MD."att_res_base" b on substr(a."station_code",0,length(a."station_code")-2) = b."guid"
- where b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct("res_cd") from sjzt_md."att_wy_cd_base" awcb
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = awcb."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1= 1
+ where awcb."cd" != '00'
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
@@ -3579,26 +3414,16 @@
- SELECT "res_cd",COUNT(*) wyStation
- FROM
- (
- SELECT b."guid" as "res_cd",'wy' as "sys_resource"
- FROM
- (
- SELECT "station_code" from sjzt_md."att_mqtt_calc_data" group by "station_code"
- ) a LEFT JOIN SJZT_MD."att_res_base" b on substr(a."station_code",0,length(a."station_code")-2) = b."guid"
- where b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct("res_cd") from sjzt_md."att_wy_cd_base" awcb
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = awcb."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1= 1
+ where awcb."cd" != '00'
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
@@ -3685,26 +3510,16 @@
- SELECT "res_cd",COUNT(*) wyStation
- FROM
- (
- SELECT b."guid" as "res_cd",'wy' as "sys_resource"
- FROM
- (
- SELECT "station_code" from sjzt_md."att_mqtt_calc_data" group by "station_code"
- ) a LEFT JOIN SJZT_MD."att_res_base" b on substr(a."station_code",0,length(a."station_code")-2) = b."guid"
- where b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct("res_cd") from sjzt_md."att_wy_cd_base" awcb
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = awcb."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1= 1
+ where awcb."cd" != '00'
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
@@ -3788,26 +3603,16 @@
- SELECT "res_cd",COUNT(*) wyStation
- FROM
- (
- SELECT b."guid" as "res_cd",'wy' as "sys_resource"
- FROM
- (
- SELECT "station_code" from sjzt_md."att_mqtt_calc_data" group by "station_code"
- ) a LEFT JOIN SJZT_MD."att_res_base" b on substr(a."station_code",0,length(a."station_code")-2) = b."guid"
- where b."guid" is not null
- ) temp
- LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp."res_cd"
+ SELECT distinct("res_cd") from sjzt_md."att_wy_cd_base" awcb
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = awcb."res_cd"
LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
- WHERE 1= 1
+ where awcb."cd" != '00'
<if test=" dam.adCode!= null and dam.adCode !='' ">
AND (province."ad_code" =#{dam.adCode} or city."ad_code" = #{dam.adCode} or county."ad_code" = #{dam.adCode})
</if>
- GROUP BY "res_cd"
@@ -3853,4 +3658,152 @@
</select>
+
+
+ <select id="damResInfoCountSy" resultType="cn.gistack.sm.damSecurity.vo.DamStatisticsRes">
+ SELECT
+ base.total,
+ base.errorNum,
+ (base.total-base.errorNum) as normalNum,
+ base.typeName,
+ base.type FROM (
+ SELECT
+ COUNT(*) total,
+ '渗压' AS typeName ,
+ '1' AS type,
+ (SELECT COUNT(*) FROM
+ (
+ SELECT DAM_ID FROM YWXT.NKY_ALARM_GET temp
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp.dam_id
+ LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
+ LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
+ WHERE
+ TYPE = 1
+ AND DATE_FORMAT(time,'%Y-%m-%d')>= CURDATE()
+ <if test=" adCode!= null and adCode !='' ">
+ AND (province."ad_code" =#{adCode} or city."ad_code" = #{adCode} or county."ad_code" = #{adCode})
+ </if>
+ GROUP BY DAM_ID
+ )
+ ) errorNum
+ FROM
+ (
+ SELECT
+ distinct (dri."res_cd")
+ FROM
+ sjzt_dw."dim_res_info_a" dri
+ LEFT JOIN sjzt_ods."dsm_spg_spprmp" dss ON dri."oth_reg_cd" = dss."rscd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
+ LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
+ LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
+
+ where dss."rscd" is not null
+ <if test=" adCode!= null and adCode !='' ">
+ AND (province."ad_code" =#{adCode} or city."ad_code" = #{adCode} or county."ad_code" = #{adCode})
+ </if>
+ )
+ )base
+
+
+
+ </select>
+ <select id="damResInfoCountSl" resultType="cn.gistack.sm.damSecurity.vo.DamStatisticsRes">
+ SELECT
+ base.total,
+ base.errorNum,
+ (base.total-base.errorNum) as normalNum,
+ base.typeName,
+ base.type FROM (
+ SELECT
+ COUNT(*) total,
+ '渗流' AS typeName ,
+ '2' AS type,
+ (SELECT COUNT(*) FROM
+ (
+ SELECT DAM_ID FROM YWXT.NKY_ALARM_GET temp
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp.dam_id
+ LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
+ LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
+ WHERE
+ TYPE = 2
+ AND DATE_FORMAT(time,'%Y-%m-%d')>= CURDATE()
+ <if test=" adCode!= null and adCode !='' ">
+ AND (province."ad_code" =#{adCode} or city."ad_code" = #{adCode} or county."ad_code" = #{adCode})
+ </if>
+ GROUP BY DAM_ID
+ )
+ ) errorNum
+ FROM
+ (
+ select distinct(dri."res_cd")
+ from sjzt_dw."dim_res_info_a" dri
+ left join sjzt_ods."dsm_spg_spqnmp" dss on trim(dss."rscd") = dri."oth_reg_cd"
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = dri."res_cd"
+ LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
+ LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
+ where dss."rscd" is not null
+ <if test=" adCode!= null and adCode !='' ">
+ AND (province."ad_code" =#{adCode} or city."ad_code" = #{adCode} or county."ad_code" = #{adCode})
+ </if>
+ )
+ )base
+
+
+ </select>
+ <select id="damResInfoCountWy" resultType="cn.gistack.sm.damSecurity.vo.DamStatisticsRes">
+ SELECT
+ base.total,
+ base.errorNum,
+ (base.total-base.errorNum) as normalNum,
+ base.typeName,
+ base.type FROM (
+ SELECT
+ COUNT(*) total,
+ '位移' AS typeName ,
+ '3' AS type,
+ (SELECT COUNT(*) FROM
+ (
+ SELECT DAM_ID FROM YWXT.NKY_ALARM_GET temp
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = temp.dam_id
+ LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
+ LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
+ WHERE
+ (TYPE = 3 or type = 4 or type = 5)
+ AND DATE_FORMAT(time,'%Y-%m-%d')>= CURDATE()
+ <if test=" adCode!= null and adCode !='' ">
+ AND (province."ad_code" =#{adCode} or city."ad_code" = #{adCode} or county."ad_code" = #{adCode})
+ </if>
+ GROUP BY DAM_ID
+ )
+ ) errorNum
+ FROM
+ (
+
+ select distinct("res_cd") from sjzt_md."att_wy_cd_base" awcb
+ LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = awcb."res_cd"
+ LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid"
+ LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code"
+ LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
+ where awcb."cd" != '00'
+ <if test=" adCode!= null and adCode !='' ">
+ AND (province."ad_code" =#{adCode} or city."ad_code" = #{adCode} or county."ad_code" = #{adCode})
+ </if>
+ )
+ )base
+
+
+ </select>
+
+
</mapper>
diff --git a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/service/IDamSecurityService.java b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/service/IDamSecurityService.java
index e4e4e95..a6ac9d9 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/service/IDamSecurityService.java
+++ b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/service/IDamSecurityService.java
@@ -65,4 +65,6 @@
List<LevelPo> levelMonitorPie(DamMonitor damMonitor);
List<DamStatisticsRegion> getDamInfoCountByRegion(DamStatisticsRegion damStatisticsRegion);
+
+ List<DamStatisticsRes> damResInfoCountOptimize(String adCode);
}
diff --git a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/service/impl/DamSecurityServiceImpl.java b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/service/impl/DamSecurityServiceImpl.java
index 207d34a..6ef5123 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/service/impl/DamSecurityServiceImpl.java
+++ b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/service/impl/DamSecurityServiceImpl.java
@@ -142,11 +142,11 @@
if (damStatisticsRegion.getStatus().equals("total")){
//点击总数
if (damStatisticsRegion.getType().equals("sy")){
- list = damSecurityMapper.getDamSyRegion(damStatisticsRegion);
+ list = damSecurityMapper.getDamSyRegion(damStatisticsRegion);//已修改逻辑
}else if (damStatisticsRegion.getType().equals("sl")){
- list = damSecurityMapper.getDamSlRegion(damStatisticsRegion);
+ list = damSecurityMapper.getDamSlRegion(damStatisticsRegion);//1
}else if (damStatisticsRegion.getType().equals("wy")){
- list = damSecurityMapper.getDamWyRegion(damStatisticsRegion);
+ list = damSecurityMapper.getDamWyRegion(damStatisticsRegion);//1
}
}else if (damStatisticsRegion.getStatus().equals("error")){
//点异常
@@ -154,14 +154,28 @@
}else if (damStatisticsRegion.getStatus().equals("normal")){
//点正常
if (damStatisticsRegion.getType().equals("sy")){
- list = damSecurityMapper.getDamSyRegionNormal(damStatisticsRegion);
+ list = damSecurityMapper.getDamSyRegionNormal(damStatisticsRegion);//1
}else if (damStatisticsRegion.getType().equals("sl")){
- list = damSecurityMapper.getDamSlRegionNormal(damStatisticsRegion);
+ list = damSecurityMapper.getDamSlRegionNormal(damStatisticsRegion);//1
}else if (damStatisticsRegion.getType().equals("wy")){
- list = damSecurityMapper.getDamWyRegionNormal(damStatisticsRegion);
+ list = damSecurityMapper.getDamWyRegionNormal(damStatisticsRegion);//1
}
}
return list;
}
+
+ @Override
+ public List<DamStatisticsRes> damResInfoCountOptimize(String adCode) {
+
+ List<DamStatisticsRes> list = new ArrayList<>();
+ DamStatisticsRes sy = damSecurityMapper.damResInfoCountSy(adCode);
+ DamStatisticsRes sl = damSecurityMapper.damResInfoCountSl(adCode);
+ DamStatisticsRes wy = damSecurityMapper.damResInfoCountWy(adCode);
+
+ list.add(sy);
+ list.add(sl);
+ list.add(wy);
+ return list;
+ }
}
--
Gitblit v1.9.3