<?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="com.nanometer.smartlab.dao.SysAlarmPersonDao">
|
<resultMap id="sysAlarmPerson" type="com.nanometer.smartlab.entity.SysAlarmPerson">
|
<id property="id" column="id"/>
|
<result property="containerCode" column="container_code"></result>
|
<result property="warningId" column="warning_id"></result>
|
<result property="warningTime" column="warning_time"></result>
|
<result property="warningLevel" column="warning_level" typeHandler="com.nanometer.smartlab.entity.handler.WarningLevelHandler"></result>
|
<result property="userId" column="user_id"></result>
|
<result property="warningPoint" column="warning_point"></result>
|
<result property="refId" column="daping_alarm_id"/>
|
</resultMap>
|
|
<insert id="insertSysAlarmPerson" parameterType="com.nanometer.smartlab.entity.SysAlarmPerson" useGeneratedKeys = "true" keyProperty = "id">
|
insert into sys_warning(container_code, warning_id, warning_time, warning_level, user_id, warning_point,daping_alarm_id,memo)
|
values (#{containerCode}, #{warningId}, #{warningTime}, #{warningLevel}, #{userId}, #{warningPoint},#{refId},#{memo} )
|
</insert>
|
|
|
<select id="repeatedJudgment" resultType="java.lang.Integer">
|
select count(1)
|
from sys_warning
|
where container_code = #{containerCode}
|
and warning_time = #{warningTime}
|
and warning_level = #{warningLevel}
|
</select>
|
<select id="selectByCode" resultType="com.nanometer.smartlab.entity.SysAlarmPerson">
|
select
|
id,
|
container_code as containerCode,
|
warning_id as warningId,
|
daping_alarm_id as refId
|
from sys_warning
|
where container_code = #{containerCode}
|
and warning_id = #{warningId}
|
</select>
|
</mapper>
|