kongzy
2024-07-01 47a751cb301d05276ae5d75145d57b2d090fe4e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?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>