| | |
| | | and trgis."check_state" = 3 |
| | | )checkResNum, |
| | | ( |
| | | SELECT COUNT(*) FROM |
| | | ( |
| | | select trgis.*,trgi.dangerNum from SJZT_MD."tb_res_general_investigation_state" trgis |
| | | left join ( |
| | | select * from ( |
| | | select "tb_state_id",count(*) dangerNum from SJZT_MD."tb_res_general_investigation" |
| | | where "hazard_rating" = '有危害' group by "tb_state_id" |
| | | ) |
| | | ) trgi on trgi."tb_state_id" = trgis."guid" |
| | | ) trgis |
| | | left join SJZT_MD."tb_res_general_investigation" trgi on trgi."tb_state_id" = trgis."res_guid" and trgi."hazard_rating" = '有危害' |
| | | LEFT JOIN sjzt_MD."att_res_base" ARB ON ARB."code" = trgis."res_guid" |
| | | LEFT JOIN YWXT."att_ad_base" town ON town."ad_code" = arb."interior_ad_guid" |
| | | LEFT JOIN YWXT."att_ad_base" county ON county."ad_code" = town."p_ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" city ON city."ad_code" = county."p_ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" province ON province."ad_code" = city."p_ad_code" |
| | | where 1=1 |
| | | and (town."ad_code" = aab."guid" or county."ad_code" = aab."guid" or city."ad_code" = aab."guid" or province."ad_code" = aab."guid") |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | and trgis."tb_year" = #{params.tbYear} |
| | | </if> |
| | | and trgis."check_state" = 3 and trgis.dangerNum is not null |
| | | )resMayiNum, |
| | | ( |
| | | SELECT COUNT(*) |
| | | FROM SJZT_MD."tb_res_dyke" trd |
| | | LEFT JOIN YWXT."att_ad_base" county ON county."ad_code" = trd."ad_code" |
| | |
| | | and (tdis."check_state" = 2 or tdis."check_state" = 3) |
| | | )checkDykeNum, |
| | | IFNULL( |
| | | ( |
| | | SELECT SUM(CASE WHEN trd."dyke_length" THEN trd."dyke_length" ELSE 0 END) FROM ( |
| | | SELECT TRD.* FROM SJZT_MD."tb_dyke_investigation_state" tdis |
| | | LEFT JOIN SJZT_MD."tb_res_dyke" trd on (trd."guid" = tdis."dyke_guid") |
| | | <where> |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | and tdis."tb_year" = #{params.tbYear} |
| | | </if> |
| | | and tdis."check_state" = 2 |
| | | </where> |
| | | ) trd |
| | | LEFT JOIN ywxt."att_ad_base" county on county."ad_code" = trd."ad_code" |
| | | LEFT JOIN ywxt."att_ad_base" city on city."ad_code" = county."p_ad_code" |
| | | LEFT JOIN ywxt."att_ad_base" province on province."ad_code" = city."p_ad_code" |
| | | where (county."ad_code" = aab."guid" or city."ad_code" = aab."guid" or province."ad_code" = aab."guid") |
| | | ),0 |
| | | ) AS tbDykeLength, |
| | | IFNULL( |
| | | ( |
| | | SELECT |
| | | SUM(CASE WHEN trd."dyke_length" THEN trd."dyke_length" ELSE 0 END) |