|
|
|
@ -7,10 +7,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<resultMap type="AlertMessage" id="AlertMessageResult"> |
|
|
|
<resultMap type="AlertMessage" id="AlertMessageResult"> |
|
|
|
<result property="id" column="id" /> |
|
|
|
<result property="id" column="id" /> |
|
|
|
<result property="equId" column="equ_id" /> |
|
|
|
<result property="equId" column="equ_id" /> |
|
|
|
|
|
|
|
|
|
|
|
<result property="type" column="type" /> |
|
|
|
<result property="type" column="type" /> |
|
|
|
<result property="equType" column="equ_type" /> |
|
|
|
<result property="equType" column="equ_type" /> |
|
|
|
|
|
|
|
|
|
|
|
<result property="solution" column="solution" /> |
|
|
|
<result property="solution" column="solution" /> |
|
|
|
<result property="level" column="level" /> |
|
|
|
<result property="level" column="level" /> |
|
|
|
<result property="occurTime" column="occur_time" /> |
|
|
|
<result property="occurTime" column="occur_time" /> |
|
|
|
@ -19,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<result property="handleTime" column="handle_time" /> |
|
|
|
<result property="handleTime" column="handle_time" /> |
|
|
|
<result property="status" column="status" /> |
|
|
|
<result property="status" column="status" /> |
|
|
|
<result property="batch" column="batch" /> |
|
|
|
<result property="batch" column="batch" /> |
|
|
|
|
|
|
|
<result property="message" column="message" /> |
|
|
|
|
|
|
|
|
|
|
|
</resultMap> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
@ -30,12 +29,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
|
|
|
|
|
|
|
|
<insert id="batchInsert" parameterType="java.util.List"> |
|
|
|
<insert id="batchInsert" parameterType="java.util.List"> |
|
|
|
INSERT INTO alert_message |
|
|
|
INSERT INTO alert_message |
|
|
|
(equ_id, type, equ_type, solution, level, occur_time, handler, handle_time, status,batch) |
|
|
|
(equ_id, type, equ_type, solution, level, occur_time, handler, handle_time, status,batch,message) |
|
|
|
VALUES |
|
|
|
VALUES |
|
|
|
<foreach collection="list" item="msg" separator=","> |
|
|
|
<foreach collection="list" item="msg" separator=","> |
|
|
|
(#{msg.equId},#{msg.type}, #{msg.equType}, |
|
|
|
(#{msg.equId},#{msg.type}, #{msg.equType}, |
|
|
|
#{msg.solution}, #{msg.level}, #{msg.occurTime}, |
|
|
|
#{msg.solution}, #{msg.level}, #{msg.occurTime}, |
|
|
|
#{msg.handler}, #{msg.handleTime}, #{msg.status}, #{msg.batch}) |
|
|
|
#{msg.handler}, #{msg.handleTime}, #{msg.status}, #{msg.batch}, #{msg.message}) |
|
|
|
</foreach> |
|
|
|
</foreach> |
|
|
|
</insert> |
|
|
|
</insert> |
|
|
|
|
|
|
|
|
|
|
|
@ -52,7 +51,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
am.handler, |
|
|
|
am.handler, |
|
|
|
am.handle_time, |
|
|
|
am.handle_time, |
|
|
|
am.status, |
|
|
|
am.status, |
|
|
|
am.batch |
|
|
|
am.batch, |
|
|
|
|
|
|
|
am.message |
|
|
|
FROM alert_message am |
|
|
|
FROM alert_message am |
|
|
|
LEFT JOIN equ_base eb ON am.equ_id = eb.id |
|
|
|
LEFT JOIN equ_base eb ON am.equ_id = eb.id |
|
|
|
</sql> |
|
|
|
</sql> |
|
|
|
@ -84,6 +84,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
ORDER BY am.batch DESC |
|
|
|
ORDER BY am.batch DESC |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 查询最新预警信息(按时间排序,取前N条) --> |
|
|
|
|
|
|
|
<select id="selectStaticAlertMessageList" resultType="homeEquAlertMessage"> |
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
a.level, |
|
|
|
|
|
|
|
a.occur_time AS occurTime, |
|
|
|
|
|
|
|
a.status, |
|
|
|
|
|
|
|
a.message, |
|
|
|
|
|
|
|
e.name, |
|
|
|
|
|
|
|
e.location |
|
|
|
|
|
|
|
FROM alert_message a |
|
|
|
|
|
|
|
LEFT JOIN equ_base e ON a.equ_id = e.id |
|
|
|
|
|
|
|
ORDER BY a.occur_time DESC |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectAlertMessageById" parameterType="Long" resultMap="AlertMessageResult"> |
|
|
|
<select id="selectAlertMessageById" parameterType="Long" resultMap="AlertMessageResult"> |
|
|
|
<include refid="selectAlertMessageVo"/> |
|
|
|
<include refid="selectAlertMessageVo"/> |
|
|
|
where am.id = #{id} |
|
|
|
where am.id = #{id} |
|
|
|
|