| | |
| | | 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> |