| | |
| | | (CASE WHEN tmp.totalDangerNum>0 THEN 1 ELSE 2 END) as hasDanger, |
| | | tmp.totalDangerNum, |
| | | tmp.termiteNum, |
| | | tmp.otherNum |
| | | tmp.otherNum, |
| | | tmp.totalDangerLength |
| | | from sjzt_md."tb_res_dyke" trd |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis on trd."guid" = tdis."dyke_guid" |
| | | left join YWXT."att_ad_base" aa on aa."guid" = trd."ad_code" |
| | |
| | | select |
| | | temp2."tb_state_id", |
| | | temp2."dyke_guid", |
| | | temp2.totalDangerNum, |
| | | temp2.termiteNum, |
| | | temp2.otherNum, |
| | | sum(temp2.totalDangerNum) as totalDangerNum, |
| | | sum(temp2.termiteNum) as termiteNum, |
| | | sum(temp2.otherNum) as otherNum, |
| | | SUM(CASE WHEN temp2.dangerLength THEN temp2.dangerLength ELSE 0 END) AS totalDangerLength |
| | | from( |
| | | SELECT |
| | |
| | | )TEMP1 |
| | | )temp2 group by |
| | | temp2."tb_state_id", |
| | | temp2."dyke_guid", |
| | | temp2.totalDangerNum, |
| | | temp2.termiteNum, |
| | | temp2.otherNum |
| | | temp2."dyke_guid" |
| | | ) tmp on tmp."tb_state_id" = tdis."guid" |
| | | where 1 = 1 |
| | | <if test="vo.name !=null and vo.name !=''"> |