| | |
| | | tmp.totalDangerNum, |
| | | tmp.termiteNum, |
| | | tmp.otherNum, |
| | | ifnull(tmp.totalDanger,0) totalDanger, |
| | | ifnull(tmp.totalDangerSr,0) totalDangerSr, |
| | | ifnull(tmp.totalDangerCb,0) totalDangerCb, |
| | | ifnull(tmp.totalDangerDw,0) totalDangerDw, |
| | | |
| | | case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS townCode, |
| | | case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS townName, |
| | |
| | | |
| | | SUM(CASE WHEN (trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS totalDangerNum, |
| | | SUM(CASE WHEN (trgi."investigation_variety" = '白蚁' and trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS termiteNum, |
| | | SUM(CASE WHEN (trgi."investigation_variety" != '白蚁' and trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS otherNum |
| | | SUM(CASE WHEN (trgi."investigation_variety" != '白蚁' and trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS otherNum, |
| | | SUM(CASE WHEN (trgi."is_danger" != '否') THEN 1 ELSE 0 END) AS totalDanger, |
| | | SUM(CASE WHEN (json_value(trgi."danger_info", '$.sr') != '') THEN json_value(trgi."danger_info", '$.sr') ELSE 0 END) AS totalDangerSr, |
| | | SUM(CASE WHEN (json_value(trgi."danger_info", '$.cb') != '') THEN json_value(trgi."danger_info", '$.cb') ELSE 0 END) AS totalDangerCb, |
| | | SUM(CASE WHEN (json_value(trgi."danger_info", '$.dw') != '') THEN json_value(trgi."danger_info", '$.dw') ELSE 0 END) AS totalDangerDw |
| | | from sjzt_md."tb_res_general_investigation" trgi |
| | | where 1=1 |
| | | <if test="attResBase.tbYear !=null and attResBase.tbYear !=''"> |
| | |
| | | <!--获取水库对应责任人分页数据--> |
| | | <select id="getAttResBaseUserPage" resultType="cn.gistack.sm.sjztmd.dto.AttResBaseUserDTO"> |
| | | select |
| | | arb."guid", arb."name", arb."res_loc" as place, arb."res_reg_code" as resRegCode, arb."eng_scal" as engScal, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,2) as cityName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,3) as countyName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,4) as townName, |
| | | arb."guid", arb."name", arb."res_loc" as place, arb."res_reg_code" as resRegCode, arb."eng_scal" as engScal,arb."center_long" as lon,arb."center_lat" as lat, |
| | | dri."city_nm" cityName,dri."county_nm" countyName,dri."town_nm" townName, |
| | | aab."ad_name" as adName, |
| | | trmp1."user_unit" areaUnitName,trmp1."user_name" areaUsername,trmp1."user_phone" areaPhone,trmp1."position" |
| | | areaPosition,trmp1."guid" areaUserGuid, |
| | |
| | | trmp5."user_unit" patrolUnitName,trmp5."user_name" patrolUsername,trmp5."user_phone" |
| | | patrolPhone,trmp5."position" patrolPosition,trmp5."guid" patrolUserGuid |
| | | from SJZT_MD."att_res_base" arb |
| | | left join "SJZT_DW"."dim_res_info_a" dri on arb."guid" = dri."guid" |
| | | left join "SJZT_MD"."att_ad_base" aab on aab."guid" = arb."interior_ad_guid" |
| | | left join "SJZT_MD"."att_ad_base" aa on aab."p_ad_code" = aa."ad_code" |
| | | left join "SJZT_MD"."att_ad_base" ab on aa."p_ad_code" = ab."ad_code" |