<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="cn.gistack.nky.mapper.AlarmGetMapper">
|
|
<resultMap id="vo" type="cn.gistack.nky.vo.AlarmGetVO">
|
<id column="id" property="id"/>
|
<result property="damId" column="dam_id"/>
|
<result property="type" column="type"/>
|
<result property="status" column="status"/>
|
<result property="baojingzhi" column="baojingzhi"/>
|
<result property="createTime" column="create_time"/>
|
<result property="desc" column="desc"/>
|
<result property="level" column="level"/>
|
<result property="originId" column="origin_id"/>
|
<result property="pointId" column="point_id"/>
|
<result property="value" column="value"/>
|
<result property="time" column="time"/>
|
<result property="taskCategory" column="task_category"/>
|
<result property="forward" column="forward" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
<result property="reverse" column="reverse" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
<result property="ratio" column="ratio" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
</resultMap>
|
|
|
<select id="getAlarmDetail" resultMap="vo">
|
SELECT * FROM NKY_ALARM_GET
|
WHERE 1=1
|
<if test="vo.startTime != null and vo.startTime != ''">
|
AND DATE_FORMAT(time,'%Y-%m-%d') >= #{vo.startTime}
|
</if>
|
<if test="vo.endTime != null and vo.endTime !='' ">
|
AND DATE_FORMAT(time,'%Y-%m-%d') <= #{vo.endTime}
|
</if>
|
<if test="vo.level != null and vo.level !='' ">
|
AND level = #{vo.level}
|
</if>
|
<if test="vo.status != null and vo.status !='' ">
|
AND status = #{vo.status}
|
</if>
|
<if test="vo.type != null and vo.type !='' ">
|
AND type = #{vo.type}
|
</if>
|
AND dam_id = #{vo.damId}
|
</select>
|
<select id="getAlarmDetailPage" resultType="cn.gistack.nky.vo.AlarmGetVO">
|
SELECT
|
ID,DAM_ID,POINT_ID,TYPE,
|
(
|
CASE
|
WHEN TYPE=1 THEN '渗压'
|
WHEN TYPE=2 THEN '渗流'
|
WHEN (TYPE=3 OR TYPE=4 OR TYPE=5) THEN '位移'
|
END) AS typeName,
|
"TIME","VALUE","DESC",CREATE_TIME,TASK_CATEGORY,"LEVEL",BAOJINGZHI,ORIGIN_ID,FORWARD,"REVERSE",RATIO,STATUS
|
|
FROM YWXT.NKY_ALARM_GET
|
WHERE 1=1
|
<if test="vo.startTime != null and vo.startTime != ''">
|
AND DATE_FORMAT(time,'%Y-%m-%d') >= #{vo.startTime}
|
</if>
|
<if test="vo.endTime != null and vo.endTime !='' ">
|
AND DATE_FORMAT(time,'%Y-%m-%d') <= #{vo.endTime}
|
</if>
|
<if test="vo.level != null and vo.level !='' ">
|
AND level = #{vo.level}
|
</if>
|
<if test="vo.status != null and vo.status !='' ">
|
AND status = #{vo.status}
|
</if>
|
<if test="vo.type != null and vo.type !='' and vo.type == 1 ">
|
AND type = #{vo.type}
|
</if>
|
<if test="vo.type != null and vo.type !='' and vo.type == 2">
|
AND type = #{vo.type}
|
</if>
|
<if test="vo.type != null and vo.type !='' and vo.type == 3">
|
AND (type = '3' or type = '4' or type = '5')
|
</if>
|
<if test="vo.pointId != null and vo.pointId !='' ">
|
AND POINT_id = #{vo.pointId}
|
</if>
|
AND dam_id = #{vo.damId}
|
</select>
|
</mapper>
|