|
|
@@ -1,237 +1,308 @@
|
|
|
<?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.KwsDeviceMapper">
|
|
|
- <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
|
|
|
- <!--@mbg.generated-->
|
|
|
- <!--@Table kws_device-->
|
|
|
- <id column="id" jdbcType="BIGINT" property="id" />
|
|
|
- <result column="attribute" jdbcType="INTEGER" property="attribute" />
|
|
|
- <result column="name" jdbcType="VARCHAR" property="name" />
|
|
|
- <result column="alias" jdbcType="VARCHAR" property="alias" />
|
|
|
- <result column="sn_code" jdbcType="VARCHAR" property="snCode" />
|
|
|
- <result column="model_id" jdbcType="BIGINT" property="modelId" />
|
|
|
- <result column="company_id" jdbcType="VARCHAR" property="companyId" />
|
|
|
- <result column="valid_time" jdbcType="TIMESTAMP" property="validTime" />
|
|
|
- <result column="secret_key" jdbcType="VARCHAR" property="secretKey" />
|
|
|
- <result column="inter_face" jdbcType="VARCHAR" property="interFace" />
|
|
|
- <result column="remark" jdbcType="VARCHAR" property="remark" />
|
|
|
- <result column="status" jdbcType="TINYINT" property="status" />
|
|
|
- <result column="create_by" jdbcType="BIGINT" property="createBy" />
|
|
|
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
- <result column="update_by" jdbcType="BIGINT" property="updateBy" />
|
|
|
- <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, `attribute`, `name`, `alias`, sn_code, model_id, valid_time, secret_key, inter_face,
|
|
|
- remark, `status`, create_by, create_time, update_by, update_time, del_flag,company_id
|
|
|
- </sql>
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
- <!--@mbg.generated-->
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from kws_device
|
|
|
- where id = #{id,jdbcType=BIGINT}
|
|
|
- </select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
- <!--@mbg.generated-->
|
|
|
- delete from kws_device
|
|
|
- where id = #{id,jdbcType=BIGINT}
|
|
|
- </delete>
|
|
|
- <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
|
|
|
- <!--@mbg.generated-->
|
|
|
- insert into kws_device (id, `attribute`, `name`,
|
|
|
- `alias`, sn_code, model_id,
|
|
|
- valid_time, secret_key, interface,
|
|
|
- remark, `status`, create_by,
|
|
|
- create_time, update_by, update_time,
|
|
|
- del_flag)
|
|
|
- values (#{id,jdbcType=BIGINT}, #{attribute,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
|
|
|
- #{alias,jdbcType=VARCHAR}, #{snCode,jdbcType=VARCHAR}, #{modelId,jdbcType=BIGINT},
|
|
|
- #{validTime,jdbcType=TIMESTAMP}, #{secretKey,jdbcType=VARCHAR}, #{interFace,jdbcType=VARCHAR},
|
|
|
- #{remark,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{createBy,jdbcType=BIGINT},
|
|
|
- #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP},
|
|
|
- #{delFlag,jdbcType=TINYINT})
|
|
|
- </insert>
|
|
|
- <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
|
|
|
- <!--@mbg.generated-->
|
|
|
- insert into kws_device
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
+ <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ <!--@Table kws_device-->
|
|
|
+ <id column="id" jdbcType="BIGINT" property="id"/>
|
|
|
+ <result column="attribute" jdbcType="INTEGER" property="attribute"/>
|
|
|
+ <result column="name" jdbcType="VARCHAR" property="name"/>
|
|
|
+ <result column="alias" jdbcType="VARCHAR" property="alias"/>
|
|
|
+ <result column="sn_code" jdbcType="VARCHAR" property="snCode"/>
|
|
|
+ <result column="model_id" jdbcType="BIGINT" property="modelId"/>
|
|
|
+ <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
|
|
|
+ <result column="valid_time" jdbcType="TIMESTAMP" property="validTime"/>
|
|
|
+ <result column="secret_key" jdbcType="VARCHAR" property="secretKey"/>
|
|
|
+ <result column="inter_face" jdbcType="VARCHAR" property="interFace"/>
|
|
|
+ <result column="remark" jdbcType="VARCHAR" property="remark"/>
|
|
|
+ <result column="status" jdbcType="TINYINT" property="status"/>
|
|
|
+ <result column="create_by" jdbcType="BIGINT" property="createBy"/>
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
+ <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
|
|
|
+ <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,
|
|
|
- </if>
|
|
|
- <if test="attribute != null">
|
|
|
`attribute`,
|
|
|
- </if>
|
|
|
- <if test="name != null">
|
|
|
`name`,
|
|
|
- </if>
|
|
|
- <if test="alias != null">
|
|
|
`alias`,
|
|
|
- </if>
|
|
|
- <if test="snCode != null">
|
|
|
sn_code,
|
|
|
- </if>
|
|
|
- <if test="modelId != null">
|
|
|
model_id,
|
|
|
- </if>
|
|
|
- <if test="validTime != null">
|
|
|
valid_time,
|
|
|
- </if>
|
|
|
- <if test="secretKey != null">
|
|
|
secret_key,
|
|
|
- </if>
|
|
|
- <if test="interFace != null">
|
|
|
- interface,
|
|
|
- </if>
|
|
|
- <if test="remark != null">
|
|
|
+ inter_face,
|
|
|
remark,
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
`status`,
|
|
|
- </if>
|
|
|
- <if test="createBy != null">
|
|
|
create_by,
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
create_time,
|
|
|
- </if>
|
|
|
- <if test="updateBy != null">
|
|
|
update_by,
|
|
|
- </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="attribute != null">
|
|
|
- #{attribute,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="name != null">
|
|
|
- #{name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="alias != null">
|
|
|
- #{alias,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="snCode != null">
|
|
|
- #{snCode,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="modelId != null">
|
|
|
- #{modelId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="validTime != null">
|
|
|
- #{validTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="secretKey != null">
|
|
|
- #{secretKey,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="interFace != null">
|
|
|
- #{interFace,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="remark != null">
|
|
|
- #{remark,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- #{status,jdbcType=TINYINT},
|
|
|
- </if>
|
|
|
- <if test="createBy != null">
|
|
|
- #{createBy,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="updateBy != null">
|
|
|
- #{updateBy,jdbcType=BIGINT},
|
|
|
- </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.KwsDevice">
|
|
|
- <!--@mbg.generated-->
|
|
|
- update kws_device
|
|
|
- <set>
|
|
|
- <if test="attribute != null">
|
|
|
- `attribute` = #{attribute,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="name != null">
|
|
|
- `name` = #{name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="alias != null">
|
|
|
- `alias` = #{alias,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="snCode != null">
|
|
|
- sn_code = #{snCode,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="modelId != null">
|
|
|
- model_id = #{modelId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="validTime != null">
|
|
|
- valid_time = #{validTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="secretKey != null">
|
|
|
- secret_key = #{secretKey,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="interFace != null">
|
|
|
- inter_face = #{interFace,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="remark != null">
|
|
|
- remark = #{remark,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- `status` = #{status,jdbcType=TINYINT},
|
|
|
- </if>
|
|
|
- <if test="createBy != null">
|
|
|
- create_by = #{createBy,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="updateBy != null">
|
|
|
- update_by = #{updateBy,jdbcType=BIGINT},
|
|
|
- </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.KwsDevice">
|
|
|
- <!--@mbg.generated-->
|
|
|
- update kws_device
|
|
|
- set `attribute` = #{attribute,jdbcType=INTEGER},
|
|
|
- `name` = #{name,jdbcType=VARCHAR},
|
|
|
- `alias` = #{alias,jdbcType=VARCHAR},
|
|
|
- sn_code = #{snCode,jdbcType=VARCHAR},
|
|
|
- model_id = #{modelId,jdbcType=BIGINT},
|
|
|
- valid_time = #{validTime,jdbcType=TIMESTAMP},
|
|
|
- secret_key = #{secretKey,jdbcType=VARCHAR},
|
|
|
- inter_face = #{interFace,jdbcType=VARCHAR},
|
|
|
- remark = #{remark,jdbcType=VARCHAR},
|
|
|
- `status` = #{status,jdbcType=TINYINT},
|
|
|
- create_by = #{createBy,jdbcType=BIGINT},
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
- update_by = #{updateBy,jdbcType=BIGINT},
|
|
|
- update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
- del_flag = #{delFlag,jdbcType=TINYINT}
|
|
|
- where id = #{id,jdbcType=BIGINT}
|
|
|
- </update>
|
|
|
+ company_id
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from kws_device
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ delete
|
|
|
+ from kws_device
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into kws_device (id, `attribute`, `name`,
|
|
|
+ `alias`, sn_code, model_id,
|
|
|
+ valid_time, secret_key, interface,
|
|
|
+ remark, `status`, create_by,
|
|
|
+ create_time, update_by, update_time,
|
|
|
+ del_flag)
|
|
|
+ values (#{id,jdbcType=BIGINT}, #{attribute,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
|
|
|
+ #{alias,jdbcType=VARCHAR}, #{snCode,jdbcType=VARCHAR}, #{modelId,jdbcType=BIGINT},
|
|
|
+ #{validTime,jdbcType=TIMESTAMP}, #{secretKey,jdbcType=VARCHAR}, #{interFace,jdbcType=VARCHAR},
|
|
|
+ #{remark,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{createBy,jdbcType=BIGINT},
|
|
|
+ #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ #{delFlag,jdbcType=TINYINT})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into kws_device
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="attribute != null">
|
|
|
+ `attribute`,
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ `name`,
|
|
|
+ </if>
|
|
|
+ <if test="alias != null">
|
|
|
+ `alias`,
|
|
|
+ </if>
|
|
|
+ <if test="snCode != null">
|
|
|
+ sn_code,
|
|
|
+ </if>
|
|
|
+ <if test="modelId != null">
|
|
|
+ model_id,
|
|
|
+ </if>
|
|
|
+ <if test="validTime != null">
|
|
|
+ valid_time,
|
|
|
+ </if>
|
|
|
+ <if test="secretKey != null">
|
|
|
+ secret_key,
|
|
|
+ </if>
|
|
|
+ <if test="interFace != null">
|
|
|
+ interface,
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">
|
|
|
+ remark,
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ `status`,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ create_by,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ update_by,
|
|
|
+ </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="attribute != null">
|
|
|
+ #{attribute,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ #{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="alias != null">
|
|
|
+ #{alias,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="snCode != null">
|
|
|
+ #{snCode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="modelId != null">
|
|
|
+ #{modelId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="validTime != null">
|
|
|
+ #{validTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="secretKey != null">
|
|
|
+ #{secretKey,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="interFace != null">
|
|
|
+ #{interFace,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">
|
|
|
+ #{remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ #{status,jdbcType=TINYINT},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ #{createBy,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ #{updateBy,jdbcType=BIGINT},
|
|
|
+ </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.KwsDevice">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ update kws_device
|
|
|
+ <set>
|
|
|
+ <if test="attribute != null">
|
|
|
+ `attribute` = #{attribute,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ `name` = #{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="alias != null">
|
|
|
+ `alias` = #{alias,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="snCode != null">
|
|
|
+ sn_code = #{snCode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="modelId != null">
|
|
|
+ model_id = #{modelId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="validTime != null">
|
|
|
+ valid_time = #{validTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="secretKey != null">
|
|
|
+ secret_key = #{secretKey,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="interFace != null">
|
|
|
+ inter_face = #{interFace,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">
|
|
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ `status` = #{status,jdbcType=TINYINT},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ create_by = #{createBy,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ update_by = #{updateBy,jdbcType=BIGINT},
|
|
|
+ </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.KwsDevice">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ update kws_device
|
|
|
+ set `attribute` = #{attribute,jdbcType=INTEGER},
|
|
|
+ `name` = #{name,jdbcType=VARCHAR},
|
|
|
+ `alias` = #{alias,jdbcType=VARCHAR},
|
|
|
+ sn_code = #{snCode,jdbcType=VARCHAR},
|
|
|
+ model_id = #{modelId,jdbcType=BIGINT},
|
|
|
+ valid_time = #{validTime,jdbcType=TIMESTAMP},
|
|
|
+ secret_key = #{secretKey,jdbcType=VARCHAR},
|
|
|
+ inter_face = #{interFace,jdbcType=VARCHAR},
|
|
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
|
+ `status` = #{status,jdbcType=TINYINT},
|
|
|
+ create_by = #{createBy,jdbcType=BIGINT},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ update_by = #{updateBy,jdbcType=BIGINT},
|
|
|
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ del_flag = #{delFlag,jdbcType=TINYINT}
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
|
|
|
- <select id="selectDeviceAllNotDeviceRelation" resultType="com.sckw.slope.detection.model.dto.DeviceDataDTO">
|
|
|
-
|
|
|
- </select>
|
|
|
+ <select id="selectDeviceAllNotDeviceRelation" resultType="com.sckw.slope.detection.model.dto.DeviceDataDTO">
|
|
|
+ SELECT c.id AS deviceId,
|
|
|
+ c.alias as deviceAlias,
|
|
|
+ c.`name` AS deviceName
|
|
|
+ FROM kws_project a
|
|
|
+ LEFT JOIN kws_device c ON a.mountain_id = c.mountain_id
|
|
|
+ LEFT JOIN kws_device_model d ON c.model_id = d.id
|
|
|
+ WHERE a.del_flag = 0
|
|
|
+ AND c.del_flag = 0
|
|
|
+ AND d.del_flag = 0
|
|
|
+ AND c.id NOT in (SELECT DISTINCT a.relate_device_id
|
|
|
+ FROM kws_device_relation a
|
|
|
+ LEFT JOIN kws_project b ON a.mountain_id = b.mountain_id)
|
|
|
+ AND c.id NOT in (SELECT DISTINCT a.device_id
|
|
|
+ FROM kws_device_relation a
|
|
|
+ LEFT JOIN kws_project b ON a.mountain_id = b.mountain_id)
|
|
|
+ <if test="projectId != null and projectId != ''">
|
|
|
+ AND a.id = #{projectId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDeviceAllAndProjectData"
|
|
|
+ resultType="com.sckw.slope.detection.model.vo.AffiliationDeviceVO">
|
|
|
+ SELECT a.id as deviceId,
|
|
|
+ a.`name` as name,
|
|
|
+ a.attribute as attribute,
|
|
|
+ a.alias as alias,
|
|
|
+ a.logic_alt as logicAlt,
|
|
|
+ a.logic_lat as logicLat,
|
|
|
+ a.logic_lng as logicLng
|
|
|
+ FROM kws_device a
|
|
|
+ LEFT JOIN kws_project_device b ON a.id = b.device_id
|
|
|
+ LEFT JOIN kws_project c ON b.project_id = c.id
|
|
|
+ WHERE c.id = #{projectId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDeviceAllByProjectAndMountainId" resultType="com.sckw.slope.detection.model.dto.ThresholdSelectDTO">
|
|
|
+ SELECT b.id AS deviceId,
|
|
|
+ b.alias AS deviceAlias,
|
|
|
+ b.`name` AS deviceName
|
|
|
+ FROM kws_project_device a
|
|
|
+ LEFT JOIN kws_device b ON a.device_id = b.id
|
|
|
+ WHERE a.del_flag = 0
|
|
|
+ AND b.del_flag = 0
|
|
|
+ AND a.mountain_id = b.mountain_id
|
|
|
+ <if test="projectId != null and projectId != ''">
|
|
|
+ and a.project_id = #{projectId}
|
|
|
+ </if>
|
|
|
+ <if test="mountainId != null and mountainId != ''">
|
|
|
+ and a.mountain_id = #{mountainId}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status.size() > 0">
|
|
|
+ and b.status in
|
|
|
+ <foreach collection="status" separator="," open="(" close=")" item="status">
|
|
|
+ #{status}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|