فهرست منبع

新增alarminfo实体

lengfaqiang 2 سال پیش
والد
کامیت
04cfb49541

+ 20 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsAlarmInfoMapper.java

@@ -0,0 +1,20 @@
+package com.sckw.slope.detection.dao.mysql;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsAlarmInfo;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+@DS("mysql")
+public interface KwsAlarmInfoMapper extends BaseMapper<KwsAlarmInfo> {
+    int deleteByPrimaryKey(Long id);
+
+    int insertSelective(KwsAlarmInfo record);
+
+    KwsAlarmInfo selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(KwsAlarmInfo record);
+
+    int updateByPrimaryKey(KwsAlarmInfo record);
+}

+ 62 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsAlarmInfo.java

@@ -0,0 +1,62 @@
+package com.sckw.slope.detection.model.dos.mysql;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 告警具体详情
+ */
+@Data
+@TableName("kws_alarm_info")
+public class KwsAlarmInfo implements Serializable {
+
+    private Long id;
+
+    /**
+     * 矿山id
+     */
+
+    private String mountainId;
+
+    /**
+     * 公司id
+     */
+
+    private String companyId;
+
+    /**
+     * 告警等级:1,2,3
+     */
+    private Integer level;
+
+    /**
+     * 1短信告警  2邮箱告警
+     */
+    private Integer type;
+
+    /**
+     * 手机号或邮箱
+     */
+
+    private String valueDesc;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 修改时间
+     */
+    private LocalDateTime updateTime;
+
+    /**
+     * 是否删除:0未删除1删除
+     */
+    private int delFlag;
+
+    private static final long serialVersionUID = 1L;
+}

+ 7 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/repository/KwsAlarmInfoRepository.java

@@ -0,0 +1,7 @@
+package com.sckw.slope.detection.service.repository;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sckw.slope.detection.model.dos.mysql.KwsAlarmInfo;
+
+public interface KwsAlarmInfoRepository extends IService<KwsAlarmInfo> {
+}

+ 17 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/repository/impl/KwsAlarmInfoImpl.java

@@ -0,0 +1,17 @@
+package com.sckw.slope.detection.service.repository.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sckw.slope.detection.dao.mysql.KwsAlarmInfoMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsAlarmInfo;
+import com.sckw.slope.detection.service.repository.KwsAlarmInfoRepository;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-11-30 17:11:03
+ */
+@Service
+public class KwsAlarmInfoImpl extends ServiceImpl<KwsAlarmInfoMapper, KwsAlarmInfo> implements KwsAlarmInfoRepository {
+
+}

+ 151 - 0
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsAlarmInfoMapper.xml

@@ -0,0 +1,151 @@
+<?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.sckw.slope.detection.dao.mysql.KwsAlarmInfoMapper">
+  <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsAlarmInfo">
+    <!--@mbg.generated-->
+    <!--@Table kws_alarm_info-->
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="mountain_id" jdbcType="VARCHAR" property="mountainId" />
+    <result column="company_id" jdbcType="VARCHAR" property="companyId" />
+    <result column="level" jdbcType="INTEGER" property="level" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="value_desc" jdbcType="VARCHAR" property="valueDesc" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, mountain_id, company_id, `level`, `type`, value_desc, create_time, update_time, 
+    del_flag
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    <!--@mbg.generated-->
+    select 
+    <include refid="Base_Column_List" />
+    from kws_alarm_info
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    <!--@mbg.generated-->
+    delete from kws_alarm_info
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsAlarmInfo">
+    <!--@mbg.generated-->
+    insert into kws_alarm_info (id, mountain_id, company_id, 
+      `level`, `type`, value_desc, 
+      create_time, update_time, del_flag
+      )
+    values (#{id,jdbcType=BIGINT}, #{mountainId,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, 
+      #{level,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{valueDesc,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsAlarmInfo">
+    <!--@mbg.generated-->
+    insert into kws_alarm_info
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="mountainId != null">
+        mountain_id,
+      </if>
+      <if test="companyId != null">
+        company_id,
+      </if>
+      <if test="level != null">
+        `level`,
+      </if>
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="valueDesc != null">
+        value_desc,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="delFlag != null">
+        del_flag,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="mountainId != null">
+        #{mountainId,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null">
+        #{companyId,jdbcType=VARCHAR},
+      </if>
+      <if test="level != null">
+        #{level,jdbcType=INTEGER},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="valueDesc != null">
+        #{valueDesc,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="delFlag != null">
+        #{delFlag,jdbcType=TINYINT},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsAlarmInfo">
+    <!--@mbg.generated-->
+    update kws_alarm_info
+    <set>
+      <if test="mountainId != null">
+        mountain_id = #{mountainId,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null">
+        company_id = #{companyId,jdbcType=VARCHAR},
+      </if>
+      <if test="level != null">
+        `level` = #{level,jdbcType=INTEGER},
+      </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="valueDesc != null">
+        value_desc = #{valueDesc,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="delFlag != null">
+        del_flag = #{delFlag,jdbcType=TINYINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsAlarmInfo">
+    <!--@mbg.generated-->
+    update kws_alarm_info
+    set mountain_id = #{mountainId,jdbcType=VARCHAR},
+      company_id = #{companyId,jdbcType=VARCHAR},
+      `level` = #{level,jdbcType=INTEGER},
+      `type` = #{type,jdbcType=INTEGER},
+      value_desc = #{valueDesc,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      del_flag = #{delFlag,jdbcType=TINYINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>