| | |
| | | //初始化数据 |
| | | @GetMapping(value = "/initTbData") |
| | | public R initTbData(){ |
| | | tbAttResBaseService.initTbData(); |
| | | return R.status(true); |
| | | String message = tbAttResBaseService.initTbData(); |
| | | return R.success(message); |
| | | } |
| | | |
| | | |
| | |
| | | Integer initTbAttResWaterDelivery(); |
| | | |
| | | Integer initTbAttResPowerStation(); |
| | | |
| | | Integer initTbAttResMgrSysB(); |
| | | |
| | | Integer initTbAttResSafetyMonitor(); |
| | | } |
| | |
| | | LEFT JOIN SJZT_MD."att_res_flse_lim" beforeArfl on beforeArfl."res_guid" = tarb."guid" and beforeArfl."flood_season_name" = '前汛期' |
| | | LEFT JOIN SJZT_MD."att_res_flse_lim" midArfl on midArfl."res_guid" = tarb."guid" and midArfl."flood_season_name" = '中汛期' |
| | | LEFT JOIN SJZT_MD."att_res_flse_lim" afterArfl on afterArfl."res_guid" = tarb."guid" and afterArfl."flood_season_name" = '后汛期' |
| | | WHERE |
| | | tarb."final_state" = -1 |
| | | and arsc."res_guid" is not null |
| | | and beforeArfl."res_guid" is not null |
| | | and midArfl."res_guid" is not null |
| | | and afterArfl."res_guid" is not null |
| | | WHERE tarb."final_state" = -1 |
| | | </sql> |
| | | |
| | | |
| | |
| | | <insert id="initTbAttResStagChar"> |
| | | INSERT INTO SJZT_MD."tb_att_res_stag_char" |
| | | ( |
| | | "guid", |
| | | "res_guid", |
| | | "con_area", |
| | | "moyear_rain_avg", |
| | | "moyear_fl_avg", |
| | | "adjust_prop", |
| | | |
| | | "chec_fl_stag", |
| | | "des_fl_stag", |
| | | "fl_con_top_stag", |
| | | "cor_norm_stag", |
| | | "dead_stag", |
| | | |
| | | "total_cap", |
| | | "flpr_cap", |
| | | "fl_stor_cap", |
| | | "adjust_stor_cap", |
| | | "dead_cap", |
| | | |
| | | "des_flood_flow_max", |
| | | "chec_flood_flow_max", |
| | | "down_waco_safe_disc", |
| | | |
| | | "des_fl_sta", |
| | | "des_fl_flow", |
| | | |
| | | "des_fl_1h_cap", |
| | | "des_fl_3h_cap", |
| | | "des_fl_6h_cap", |
| | | "des_fl_12h_cap", |
| | | "des_fl_1day_cap", |
| | | "des_fl_3day_cap", |
| | | |
| | | "des_fl_3day_cap", |
| | | "chec_fl_sta", |
| | | "chec_fl_flow", |
| | | "chec_fl_1h_cap", |
| | | "chec_fl_3h_cap", |
| | | |
| | | "chec_fl_6h_cap", |
| | | "chec_fl_12h_cap", |
| | | "chec_fl_1day_cap", |
| | | "chec_fl_3day_cap", |
| | | |
| | | |
| | | "before_flood_stag", |
| | | |
| | | "before_flood_start", |
| | | "before_flood_end", |
| | | |
| | | "mid_flood_stag", |
| | | "mid_flood_start", |
| | | "mid_flood_end", |
| | |
| | | "after_flood_stag", |
| | | "after_flood_start", |
| | | "after_flood_end", |
| | | |
| | | "check_state", |
| | | "create_time" |
| | | |
| | | ) |
| | | <include refid="getAttResStagChar"></include> |
| | | |
| | |
| | | </insert> |
| | | |
| | | |
| | | <sql id="getTbAttResMgrSysB"> |
| | | SELECT |
| | | basic."guid", |
| | | basic."res_guid", |
| | | basic."m_unit_name", |
| | | basic."c_unit_name", |
| | | |
| | | CASE |
| | | WHEN basic."m_unit_nature" = 1 THEN '其他' |
| | | WHEN basic."m_unit_nature" = 2 THEN '企业' |
| | | WHEN basic."m_unit_nature" = 3 THEN '民间组织' |
| | | ELSE '其他' |
| | | END, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | '0' as "check_state", |
| | | NOW() as "create_time" |
| | | |
| | | FROM SJZT_MD."tb_att_res_base" tarb |
| | | LEFT JOIN SJZT_MD."att_res_mgr_sys_b" basic on basic."res_guid" = tarb."guid" |
| | | WHERE tarb."final_state" = -1 and basic."res_guid" is not null |
| | | </sql> |
| | | |
| | | <insert id="initTbAttResMgrSysB"> |
| | | INSERT INTO SJZT_MD."tb_att_res_mgr_sys_b" |
| | | ( |
| | | "guid", |
| | | "res_guid", |
| | | "m_unit_name", |
| | | "c_unit_name", |
| | | "m_unit_nature", |
| | | |
| | | "m_unit_person_number", |
| | | "person_economic_source", |
| | | "maintenance_economic_source", |
| | | "check_state", |
| | | "create_time" |
| | | ) |
| | | <include refid="getTbAttResMgrSysB"></include> |
| | | |
| | | |
| | | </insert> |
| | | <sql id="getTbAttResSafetyMonitor"> |
| | | SELECT |
| | | basic."guid", |
| | | basic."res_guid", |
| | | basic."latest_safety_appraisal_time", |
| | | basic."safety_appraisal_type", |
| | | basic."tb_control_z", |
| | | basic."exist_pblm", |
| | | '否', |
| | | basic."latest_reinforce_time", |
| | | NULL, |
| | | '0' as "check_state", |
| | | NOW() as "create_time" |
| | | FROM SJZT_MD."tb_att_res_base" tarb |
| | | LEFT JOIN SJZT_MD."att_res_danger_manage_special" basic on basic."res_guid" = tarb."guid" |
| | | WHERE tarb."final_state" = -1 and basic."res_guid" is not null |
| | | </sql> |
| | | |
| | | <insert id="initTbAttResSafetyMonitor"> |
| | | INSERT INTO SJZT_MD."tb_att_res_safety_monitor" |
| | | ( |
| | | "guid", |
| | | "res_guid", |
| | | "safety_appraisal_time", |
| | | "safety_appraisal_result", |
| | | "control_rz", |
| | | "survey_problem", |
| | | "is_reinforce", |
| | | "reinforce_tm", |
| | | "completion_time", |
| | | "check_state", |
| | | "create_time" |
| | | ) |
| | | <include refid="getTbAttResSafetyMonitor"></include> |
| | | </insert> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | Boolean updateFinalState(String resGuid, int state); |
| | | |
| | | void initTbData(); |
| | | String initTbData(); |
| | | } |
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void initTbData() { |
| | | public String initTbData() { |
| | | //初始化基础信心 |
| | | initTbAttResBase(); |
| | | Integer tbAttresBase = initTbAttResBase(); |
| | | |
| | | //初始化水文特征 |
| | | initTbAttResStagChar(); |
| | | Integer tbAttResStagChar = initTbAttResStagChar(); |
| | | |
| | | //初始化挡水建筑物 |
| | | initTbAttResWaterBlock(); |
| | | Integer tbAttResWaterBlock= initTbAttResWaterBlock(); |
| | | |
| | | //初始化正常溢洪道 |
| | | initTbAttResRsbNorspi(); |
| | | Integer tbAttResRsbNorspi= initTbAttResRsbNorspi(); |
| | | |
| | | //初始化泄洪洞 |
| | | initTbAttResRsbSpillway(); |
| | | Integer tbAttResRsbSpillway= initTbAttResRsbSpillway(); |
| | | |
| | | //初始化非常溢洪道 |
| | | initTbAttResRsbVerspi(); |
| | | Integer tbAttResRsbVerspi=initTbAttResRsbVerspi(); |
| | | |
| | | //初始化输水建筑物 |
| | | initTbAttResWaterDelivery(); |
| | | Integer tbAttResWaterDelivery=initTbAttResWaterDelivery(); |
| | | |
| | | //初始化电站 |
| | | initTbAttResPowerStation(); |
| | | Integer tbAttResPowerStation=initTbAttResPowerStation(); |
| | | |
| | | //初始化管理体制 |
| | | Integer tbAttResMgrSysB=initTbAttResMgrSysB(); |
| | | |
| | | //初始化除险加固 |
| | | Integer tbAttResSafetyMonitor=initTbAttResSafetyMonitor(); |
| | | |
| | | String message = StringUtil.format( |
| | | "基础信息更新数量为{}," + |
| | | "水文特征更新数量为{}," + |
| | | "挡水建筑物更新数量为{}," + |
| | | "正常溢洪道更新数量为{}," + |
| | | "泄洪洞更新数量为{}," + |
| | | "非常溢洪道更新数量为{}," + |
| | | "输水建筑物更新数量为{}," + |
| | | "电站更新数量为{}," + |
| | | "管理体制更新数量为{}," + |
| | | "除险加固更新数量为{}",tbAttresBase,tbAttResStagChar,tbAttResWaterBlock,tbAttResRsbNorspi,tbAttResRsbSpillway,tbAttResRsbVerspi,tbAttResWaterDelivery,tbAttResPowerStation,tbAttResMgrSysB,tbAttResSafetyMonitor |
| | | ); |
| | | |
| | | return message; |
| | | } |
| | | |
| | | private Integer initTbAttResSafetyMonitor() { |
| | | return baseMapper.initTbAttResSafetyMonitor(); |
| | | } |
| | | |
| | | private Integer initTbAttResMgrSysB() { |
| | | return baseMapper.initTbAttResMgrSysB(); |
| | | } |
| | | |
| | | private Integer initTbAttResPowerStation() { |