| | |
| | | ifnull(tmp.totalDangerDw,0) totalDangerDw, |
| | | ( |
| | | select sum(tdud."danger_length") from sjzt_md."tb_dyke_unit_danger" tdud |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis on (tdud."dyke_id" = tdis."dyke_guid") |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis |
| | | on ( |
| | | tdud."dyke_id" = tdis."dyke_guid" |
| | | <if test="vo.tbYear !=null and vo.tbYear !=''"> |
| | | AND tdis."tb_year" = #{vo.tbYear} |
| | | </if> |
| | | <if test="vo.tbQuarter !=null and vo.tbQuarter !=''"> |
| | | AND tdis."tb_quarter" = #{vo.tbQuarter} |
| | | </if> |
| | | ) |
| | | where trd."guid" = tdud."dyke_id" and tdud."danger_level" = 1 and tdis."check_state" > 1 |
| | | ) as firstLength, |
| | | ( |
| | | select sum(tdud."danger_length") from sjzt_md."tb_dyke_unit_danger" tdud |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis on (tdud."dyke_id" = tdis."dyke_guid") |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis |
| | | on ( |
| | | tdud."dyke_id" = tdis."dyke_guid" |
| | | <if test="vo.tbYear !=null and vo.tbYear !=''"> |
| | | AND tdis."tb_year" = #{vo.tbYear} |
| | | </if> |
| | | <if test="vo.tbQuarter !=null and vo.tbQuarter !=''"> |
| | | AND tdis."tb_quarter" = #{vo.tbQuarter} |
| | | </if> |
| | | ) |
| | | where trd."guid" = tdud."dyke_id" and tdud."danger_level" = 2 and tdis."check_state" > 1 |
| | | ) as secondLength, |
| | | ( |
| | | select sum(tdud."danger_length") from sjzt_md."tb_dyke_unit_danger" tdud |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis on (tdud."dyke_id" = tdis."dyke_guid") |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis |
| | | on ( |
| | | tdud."dyke_id" = tdis."dyke_guid" |
| | | <if test="vo.tbYear !=null and vo.tbYear !=''"> |
| | | AND tdis."tb_year" = #{vo.tbYear} |
| | | </if> |
| | | <if test="vo.tbQuarter !=null and vo.tbQuarter !=''"> |
| | | AND tdis."tb_quarter" = #{vo.tbQuarter} |
| | | </if> |
| | | ) |
| | | where trd."guid" = tdud."dyke_id" and tdud."danger_level" = 3 and tdis."check_state" > 1 |
| | | ) as thirdLength |
| | | |
| | | from sjzt_md."tb_res_dyke" trd |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis on trd."guid" = tdis."dyke_guid" |
| | | <if test="vo.tbYear !=null and vo.tbYear !=''"> |
| | | AND tdis."tb_year" = #{vo.tbYear} |
| | | </if> |
| | | <if test="vo.tbQuarter !=null and vo.tbQuarter !=''"> |
| | | AND tdis."tb_quarter" = #{vo.tbQuarter} |
| | | </if> |
| | | |
| | | left join YWXT."att_ad_base" aa on aa."guid" = trd."ad_code" |
| | | left join YWXT."att_ad_base" ab on ab."ad_code" = aa."p_ad_code" |
| | | left join YWXT."att_ad_base" ac on ac."ad_code" = ab."p_ad_code" |
| | |
| | | <if test="vo.tbYear !=null and vo.tbYear !=''"> |
| | | AND tdi."tb_year" = #{vo.tbYear} |
| | | </if> |
| | | <if test="vo.tbQuarter !=null and vo.tbQuarter !=''"> |
| | | AND tdi."tb_quarter" = #{vo.tbQuarter} |
| | | </if> |
| | | group by tdi."tb_state_id",tdi."dyke_guid",tdi."unit" |
| | | )TEMP1 |
| | | )temp2 group by |