| | |
| | | ORDER BY NAG.TIME DESC |
| | | |
| | | </select> |
| | | <select id="pageMonitorWy" resultType="cn.gistack.nky.vo.AlarmGetVO"> |
| | | |
| | | SELECT |
| | | NAG.ID, |
| | | NAG.DAM_ID, |
| | | NAG.POINT_ID, |
| | | NAG.TYPE, |
| | | ( |
| | | CASE |
| | | WHEN NAG.TYPE=1 THEN '渗压' |
| | | WHEN NAG.TYPE=2 THEN '渗流' |
| | | WHEN (NAG.TYPE=3 OR NAG.TYPE=4 OR NAG.TYPE=5) THEN '位移' |
| | | END) AS typeName, |
| | | NAG.TIME, |
| | | NAG.VALUE, |
| | | NAG."DESC", |
| | | NAG.CREATE_TIME, |
| | | NAG.TASK_CATEGORY, |
| | | NAG.LEVEL, |
| | | NAG.BAOJINGZHI, |
| | | NAG.ORIGIN_ID, |
| | | NAG.FORWARD, |
| | | NAG."REVERSE", |
| | | NAG.RATIO, |
| | | NAG.STATUS, |
| | | province."guid" as provinceCode, |
| | | province."ad_name" as provinceName, |
| | | city."guid" as cityCode, |
| | | city."ad_name" as cityName, |
| | | county."guid" as countyCode, |
| | | county."ad_name" as countyName, |
| | | |
| | | arb."name" as reservoirName, |
| | | awcb."cd_nm" as cdName |
| | | |
| | | FROM NKY_ALARM_GET NAG |
| | | |
| | | LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = NAG.DAM_ID |
| | | LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code" |
| | | LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code" |
| | | LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code" |
| | | |
| | | |
| | | LEFT JOIN SJZT_MD."rel_res_bas_loc" rrbl ON rrbl."res_guid" = NAG.DAM_ID |
| | | |
| | | LEFT JOIN SJZT_MD."att_bas_base" abb ON abb."code" = rrbl."bas_guid" |
| | | LEFT JOIN SJZT_MD."att_bas_base" pabb ON abb."p_code" = pabb."code" |
| | | LEFT JOIN SJZT_MD."att_wy_cd_base" awcb ON awcb."res_cd" = NAG.DAM_ID AND NAG.POINT_ID = awcb."cd" |
| | | WHERE 1=1 |
| | | <if test=" vo.adCode != null and vo.adCode !='' "> |
| | | AND (province."ad_code" =#{vo.adCode} or city."ad_code" = #{vo.adCode} or county."ad_code" = #{vo.adCode}) |
| | | </if> |
| | | |
| | | <if test="vo.startTime != null and vo.startTime != ''"> |
| | | AND DATE_FORMAT(NAG.time,'%Y-%m-%d') >= #{vo.startTime} |
| | | </if> |
| | | |
| | | <if test="vo.endTime != null and vo.endTime !='' "> |
| | | AND DATE_FORMAT(NAG.time,'%Y-%m-%d') <= #{vo.endTime} |
| | | </if> |
| | | |
| | | <if test="vo.level != null and vo.level !='' "> |
| | | AND NAG.level = #{vo.level} |
| | | </if> |
| | | |
| | | <if test="vo.status != null and vo.status !='' "> |
| | | AND NAG.status = #{vo.status} |
| | | </if> |
| | | <if test="vo.type != null and vo.type !='' and vo.type == 3"> |
| | | AND (NAG.type = '3' or NAG.type = '4' or NAG.type = '5') |
| | | </if> |
| | | |
| | | <if test="vo.pointId != null and vo.pointId !='' "> |
| | | AND NAG.POINT_id = #{vo.pointId} |
| | | </if> |
| | | |
| | | <if test="vo.basGuids != null and vo.basGuids !='' "> |
| | | AND( |
| | | abb."code" in |
| | | <foreach collection="vo.basGuids.split(',')" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | or pabb."code" in |
| | | <foreach collection="vo.basGuids.split(',')" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | |
| | | <if test="vo.labels != null and vo.labels != '' "> |
| | | AND( 1!=1 |
| | | <foreach collection="vo.labels.split(',')" item="item" open="" separator="" close="" index="index"> |
| | | OR #{item} in (arb."label") |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | |
| | | <if test="vo.engScal != null and vo.engScal !='' "> |
| | | AND arb."eng_scal" = #{vo.engScal} |
| | | </if> |
| | | ORDER BY NAG.TIME DESC |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |