Browse Source

feat: 调整统计使用的基础表

master_tdsql
hxh 1 year ago
parent
commit
f144a93ef5
  1. 2
      shuili-system/src/main/java/com/kms/yxgh/common/mapper/IndicatorMapper.java
  2. 6
      shuili-system/src/main/java/com/kms/yxgh/common/mapper/MonitoringStationMapper.java
  3. 8
      shuili-system/src/main/java/com/kms/yxgh/common/mapper/VideoWarningMapper.java

2
shuili-system/src/main/java/com/kms/yxgh/common/mapper/IndicatorMapper.java

@ -28,7 +28,7 @@ public interface IndicatorMapper extends BaseMapper<Indicator> {
@Select("<script> " +
"select jc.stcd, jc.upstream_level, jc.downstream_level, jc.opening, jc.gate_flow, jc.rain_fall, jc.bypass_osmotic_pressure, jc.osmotic_pressure_gauge_elevation, jc.boost_pressure, jc.seam, jc.crack_opening_degree, jc.deformation_x, jc.deformation_y, jc.oil_temperature, jc.collection_time, jc.year, jc.month, jc.day, jc.hour, " +
"cz.stcd_name, cz.code, cz.type, " +
"case cz.type when '1' then (select dike_name from bs_sgc_df_gcda where dike_code = cz.code and expr_date is null) when '2' then (select waga_name from bs_sgc_sz_jbxx where waga_code = cz.code and expr_date is null) end as name " +
"case cz.type when '1' then (select dike_name from att_dike_base where dike_code = cz.code and expr_date is null) when '2' then (select waga_name from att_waga_base where waga_code = cz.code and expr_date is null) end as name " +
"from bs_sgc_stc_jc jc " +
"left join bs_sgc_stc_cz cz on jc.stcd = cz.stcd " +
"where 1=1 " +

6
shuili-system/src/main/java/com/kms/yxgh/common/mapper/MonitoringStationMapper.java

@ -19,11 +19,11 @@ import org.springframework.stereotype.Repository;
public interface MonitoringStationMapper extends BaseMapper<MonitoringStation> {
@Select("<script>" +
"select count(1) from bs_sgc_stc_cz monitoring_station " +
"left join bs_sgc_df_gcda on monitoring_station.code = bs_sgc_df_gcda.dike_code and bs_sgc_df_gcda.expr_date is null " +
"left join bs_sgc_sz_jbxx on monitoring_station.code = bs_sgc_sz_jbxx.waga_code and bs_sgc_sz_jbxx.expr_date is null " +
"left join att_dike_base on monitoring_station.code = att_dike_base.dike_code and att_dike_base.expr_date is null " +
"left join att_waga_base on monitoring_station.code = att_waga_base.waga_code and att_waga_base.expr_date is null " +
"where 1=1 " +
"<if test='data.getAdcd() != null and data.getAdcd() != \"\"'> " +
"and ( bs_sgc_df_gcda.adcd like concat(#{data.adcd},'%') or bs_sgc_sz_jbxx.adcd like concat(#{data.adcd},'%') ) " +
"and ( att_dike_base.adcd like concat(#{data.adcd},'%') or att_waga_base.adcd like concat(#{data.adcd},'%') ) " +
"</if> " +
"</script>")
Integer count(@Param("data") WarningQueDto data);

8
shuili-system/src/main/java/com/kms/yxgh/common/mapper/VideoWarningMapper.java

@ -23,8 +23,8 @@ import org.springframework.stereotype.Repository;
public interface VideoWarningMapper extends BaseMapper<VideoWarning> {
@Select("<script>" +
"SELECT a.id,a.code,a.type,a.name,a.warning_time," +
" (case when a.type = 1 then (select dike_name from bs_sgc_df_gcda where dike_code = a.code and expr_date is null) " +
" when a.type = 2 then (select waga_name from bs_sgc_sz_jbxx where waga_code = a.code and expr_date is null ) end) as objName " +
" (case when a.type = 1 then (select dike_name from att_dike_base where dike_code = a.code and expr_date is null) " +
" when a.type = 2 then (select waga_name from att_waga_base where waga_code = a.code and expr_date is null ) end) as objName " +
" FROM bs_sgc_stc_spfx a " +
"WHERE 1=1" +
"<if test='dto.code != null and dto.code != \"\"'>" +
@ -50,8 +50,8 @@ public interface VideoWarningMapper extends BaseMapper<VideoWarning> {
@Select("<script>" +
"SELECT a.id,a.code,a.type,a.name,a.warning_time ," +
" (case when a.type = 1 then (select dike_name from bs_sgc_df_gcda where dike_code = a.code and expr_date is null) " +
" when a.type = 2 then (select waga_name from bs_sgc_sz_jbxx where waga_code = a.code and expr_date is null ) end) as objName, " +
" (case when a.type = 1 then (select dike_name from att_dike_base where dike_code = a.code and expr_date is null) " +
" when a.type = 2 then (select waga_name from att_waga_base where waga_code = a.code and expr_date is null ) end) as objName, " +
" FROM bs_sgc_stc_spfx a order by a.create_time desc" +
" where a.id = #{id}" +
"</script>")

Loading…
Cancel
Save