| | |
| | | WHERE "guid" = #{tbAttResBase.guid} |
| | | </update> |
| | | |
| | | |
| | | <!--查询水库基础填报数据--> |
| | | <select id="getTbAttResBaseInfo" resultType="java.util.Map"> |
| | | SELECT 'tb_att_res_base' AS name,ifnull("check_state",-1) as value FROM "tb_att_res_base" WHERE "guid" = #{resGuid} |
| | |
| | | (SELECT if(ifnull(sum("check_state"),-1)>0,1,0) as value FROM "tb_file_storage_location" WHERE "res_guid" = #{guid} limit 1) |
| | | ) a |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!--初始化水库基础信息--> |
| | | <update id="initTbAttResBase"> |
| | | UPDATE SJZT_MD."tb_att_res_base" tarb |
| | | JOIN SJZT_MD."att_res_base" arb on tarb."guid" = arb."guid" |
| | | JOIN SJZT_ODS."yg_rsvr_b" yrb on yrb."id" = tarb."guid" |
| | | JOIN ( |
| | | select |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | REPLACE( |
| | | "res_func",'防洪','1' |
| | | ),'灌溉','2' |
| | | ),'供水','3' |
| | | ),'发电','4' |
| | | ),'航运','5' |
| | | ),'防凌','6' |
| | | ),'生态','7' |
| | | ),'旅游','8' |
| | | ),'养殖','9' |
| | | ),'其他','10' |
| | | ) "res_func","guid" |
| | | FROM SJZT_MD."att_res_base" |
| | | ) arbResFunc on arbResFunc."guid" = tarb."guid" |
| | | |
| | | join ( |
| | | SELECT |
| | | rrbl."res_guid", |
| | | abb."name" |
| | | FROM |
| | | SJZT_MD."rel_res_bas_loc" rrbl |
| | | LEFT JOIN SJZT_MD."att_bas_base" abb ON abb."code" = rrbl."bas_guid" |
| | | ) bas on bas."res_guid" = tarb."guid" |
| | | |
| | | SET |
| | | tarb."res_scal" = |
| | | case |
| | | when arb."eng_scal" = '大(1)型' THEN 1 |
| | | when arb."eng_scal" = '大(2)型' THEN 2 |
| | | when arb."eng_scal" = '中型' THEN 3 |
| | | when arb."eng_scal" = '小(1)型' THEN 4 |
| | | when arb."eng_scal" = '小(2)型' THEN 5 |
| | | END, |
| | | |
| | | tarb."build_address" = arb."res_loc", |
| | | tarb."eng_grad" = arb."eng_grad", |
| | | tarb."lgtd" = arb."center_long", |
| | | tarb."lttd" = arb."center_lat", |
| | | |
| | | tarb."elevation_system" = |
| | | case |
| | | when yrb."height_base_std_tp" = 1 THEN '56黄海高程' |
| | | when yrb."height_base_std_tp" = 2 THEN '85黄海高程' |
| | | when yrb."height_base_std_tp" = 3 THEN '吴淞高程' |
| | | when yrb."height_base_std_tp" = 4 THEN '珠江高程' |
| | | when yrb."height_base_std_tp" = 5 THEN '其他' |
| | | END, |
| | | |
| | | tarb."bas_code" = arb."bas_name", |
| | | tarb."river_sys_code" = |
| | | case |
| | | when arb."bas_guid" = '乌江水系' THEN '0035FE' |
| | | when arb."bas_guid" = '汉江水系' THEN '0035FG' |
| | | when arb."bas_guid" = '洞庭湖水系' THEN '0035FF' |
| | | when arb."bas_guid" = '淮河干流水系' THEN '0034EA' |
| | | when arb."bas_guid" = '长江干流水系' THEN '0035FA' |
| | | END, |
| | | tarb."com_control_bas" = bas."name", |
| | | tarb."res_func" = arbResFunc."res_func", |
| | | --工程始建时间,下闸蓄水时间没找到 |
| | | tarb."industry_dept" = |
| | | case |
| | | when arb."industry_dept" = '水利部门' THEN '1' |
| | | when arb."industry_dept" = '能源部门' THEN '2' |
| | | when arb."industry_dept" = '交通部门' THEN '3' |
| | | when arb."industry_dept" = '住建部门' THEN '4' |
| | | when arb."industry_dept" = '农业部门' THEN '5' |
| | | when arb."industry_dept" = '林业部门' THEN '6' |
| | | when arb."industry_dept" = '旅游部门' THEN '7' |
| | | when arb."industry_dept" = '司法部门' THEN '8' |
| | | when arb."industry_dept" = '国资委' THEN '9' |
| | | when arb."industry_dept" = '其他' THEN '10,' |
| | | END |
| | | WHERE tarb."final_state" = -1 |
| | | |
| | | |
| | | </update> |
| | | |
| | | |
| | | |
| | | <sql id="getAttResStagChar"> |
| | | SELECT |
| | | tarb."guid", |
| | | arsc."con_area", |
| | | NULL, |
| | | arsc."moyear_fl_age", |
| | | NULL, |
| | | arsc."tb_chec_fl_stag", |
| | | arsc."tb_des_fl_stag", |
| | | arsc."tb_flpr_high_stag", |
| | | arsc."tb_norm_pool_stag", |
| | | arsc."tb_dead_stag", |
| | | arsc."tb_tot_cap", |
| | | arsc."stor_fl_cap", |
| | | arsc."flco_cap", |
| | | arsc."ben_res_cap", |
| | | arsc."tb_dead_cap", |
| | | arsc."des_fl_flow_max", |
| | | arsc."chec_fl_flow_max", |
| | | null, |
| | | |
| | | arsc."des_fl_stand", |
| | | arsc."des_fl_flow", |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | |
| | | arsc."chec_fl_stand", |
| | | arsc."chec_fl_flow", |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | NULL, |
| | | |
| | | beforeArfl."tb_flse_lim_stag", |
| | | NULL, |
| | | NULL, |
| | | |
| | | midArfl."tb_flse_lim_stag", |
| | | NULL, |
| | | NULL, |
| | | |
| | | afterArfl."tb_flse_lim_stag", |
| | | NULL, |
| | | NULL, |
| | | |
| | | '0' as "check_state", |
| | | NOW() as "create_time" |
| | | |
| | | |
| | | FROM |
| | | SJZT_MD."tb_att_res_base" tarb |
| | | LEFT JOIN SJZT_MD."att_res_stag_char" arsc on arsc."res_guid" = tarb."guid" |
| | | 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 |
| | | </sql> |
| | | |
| | | |
| | | |
| | | <insert id="initTbAttResStagChar"> |
| | | INSERT INTO SJZT_MD."tb_att_res_stag_char" |
| | | ( |
| | | "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", |
| | | |
| | | "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> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |