<?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.KwsAlarmDetailMapper">
  <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsAlarmDetail">
    <!--@mbg.generated-->
    <!--@Table kws_alarm_detail-->
    <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="project_id" jdbcType="BIGINT" property="projectId" />-->
    <result column="alarm_id" jdbcType="BIGINT" property="alarmId" />
    <result column="pid" jdbcType="BIGINT" property="pid" />
    <result column="val" jdbcType="VARCHAR" property="val" />
<!--    <result column="item_name" jdbcType="VARCHAR" property="itemName" />-->
    <result column="lat" jdbcType="VARCHAR" property="lat" />
    <result column="lng" jdbcType="VARCHAR" property="lng" />
    <result column="alt" jdbcType="VARCHAR" property="alt" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="status" jdbcType="TINYINT" property="status" />
    <result column="is_history" jdbcType="TINYINT" property="isHistory" />
    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, mountain_id, company_id, alarm_id,
    lat, lng, alt, create_time, update_time, `status`,val,pid,is_history,del_flag
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select 
    <include refid="Base_Column_List" />
    from kws_alarm_detail
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from kws_alarm_detail
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsAlarmDetail">
    <!--@mbg.generated-->
    insert into kws_alarm_detail
    <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="alarmId != null">
        alarm_id,
      </if>
      <if test="level != null">
        `level`,
      </if>
      <if test="title != null">
        title,
      </if>
      <if test="content != null">
        content,
      </if>
      <if test="type != null">
        `type`,
      </if>
      <if test="lat != null">
        lat,
      </if>
      <if test="lng != null">
        lng,
      </if>
      <if test="alt != null">
        alt,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="status != null">
        `status`,
      </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="alarmId != null">
        #{alarmId,jdbcType=BIGINT},
      </if>
      <if test="level != null">
        #{level,jdbcType=INTEGER},
      </if>
      <if test="title != null">
        #{title,jdbcType=VARCHAR},
      </if>
      <if test="content != null">
        #{content,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
      <if test="lat != null">
        #{lat,jdbcType=VARCHAR},
      </if>
      <if test="lng != null">
        #{lng,jdbcType=VARCHAR},
      </if>
      <if test="alt != null">
        #{alt,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        #{status,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsAlarmDetail">
    <!--@mbg.generated-->
    update kws_alarm_detail
    <set>
      <if test="mountainId != null">
        mountain_id = #{mountainId,jdbcType=VARCHAR},
      </if>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        project_id = #{projectId,jdbcType=BIGINT},
      </if>
      <if test="alarmId != null">
        alarm_id = #{alarmId,jdbcType=BIGINT},
      </if>
      <if test="level != null">
        `level` = #{level,jdbcType=INTEGER},
      </if>
      <if test="title != null">
        title = #{title,jdbcType=VARCHAR},
      </if>
      <if test="content != null">
        content = #{content,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        `type` = #{type,jdbcType=INTEGER},
      </if>
      <if test="lat != null">
        lat = #{lat,jdbcType=VARCHAR},
      </if>
      <if test="lng != null">
        lng = #{lng,jdbcType=VARCHAR},
      </if>
      <if test="alt != null">
        alt = #{alt,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="status != null">
        `status` = #{status,jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsAlarmDetail">
    <!--@mbg.generated-->
    update kws_alarm_detail
    set mountain_id = #{mountainId,jdbcType=VARCHAR},
      company_id = #{companyId,jdbcType=VARCHAR},
      project_id = #{projectId,jdbcType=BIGINT},
      alarm_id = #{alarmId,jdbcType=BIGINT},
      `level` = #{level,jdbcType=INTEGER},
      title = #{title,jdbcType=VARCHAR},
      content = #{content,jdbcType=VARCHAR},
      `type` = #{type,jdbcType=INTEGER},
      lat = #{lat,jdbcType=VARCHAR},
      lng = #{lng,jdbcType=VARCHAR},
      alt = #{alt,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      `status` = #{status,jdbcType=TINYINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>