<?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.thhy.staff.modules.biz.face.mapper.FaceDeviceMapper">
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
t.id as id,
|
t.detect_alive as detectAlive,
|
t.dev_sno as devSno,
|
t.is_first as isFirst,
|
t.name as name,
|
t.openIR_window as openIRWindow,
|
t.register_no as registerNo,
|
t.retry_interval as retryInterval,
|
t.sign_type as signType,
|
t.threshold as threshold,
|
t.through_type as throughType,
|
t.type as type
|
</sql>
|
|
<sql id="condition_query">
|
<where>
|
<trim suffixOverrides=" AND ">
|
<if test="detectAlive!=null and detectAlive!=''">
|
t.detect_alive = #{detectAlive} AND
|
</if>
|
<if test="devSno!=null and devSno!=''">
|
t.dev_sno = #{devSno} AND
|
</if>
|
<if test="isFirst!=null">
|
t.is_first = #{isFirst} AND
|
</if>
|
<if test="name!=null and name!=''">
|
t.name = #{name} AND
|
</if>
|
<if test="openIRWindow!=null">
|
t.openIR_window = #{openIRWindow} AND
|
</if>
|
<if test="registerNo!=null and registerNo!=''">
|
t.register_no = #{registerNo} AND
|
</if>
|
<if test="retryInterval!=null">
|
t.retry_interval = #{retryInterval} AND
|
</if>
|
<if test="signType!=null and signType!=''">
|
t.sign_type = #{signType} AND
|
</if>
|
<if test="threshold!=null">
|
t.threshold = #{threshold} AND
|
</if>
|
<if test="throughType!=null and throughType!=''">
|
t.through_type = #{throughType} AND
|
</if>
|
<if test="type!=null">
|
t.type = #{type} AND
|
</if>
|
</trim>
|
</where>
|
</sql>
|
|
<select id="queryById" resultType="com.thhy.staff.modules.biz.face.entity.FaceDevice">
|
select <include refid="Base_Column_List" />
|
from t_face_device t
|
where t.id=#{id}
|
</select>
|
|
<select id="queryVersionById" resultType="integer">
|
select version from t_face_device
|
where id=#{id}
|
</select>
|
|
<!--查询列表-->
|
<select id="findList" resultType="com.thhy.staff.modules.biz.face.entity.FaceDevice">
|
SELECT
|
<include refid="Base_Column_List" />
|
from t_face_device t
|
<include refid="condition_query" />
|
</select>
|
|
<!--查询列表-->
|
<select id="findAll" resultType="com.thhy.staff.modules.biz.face.entity.FaceDevice">
|
SELECT
|
<include refid="Base_Column_List" />
|
from t_face_device t
|
</select>
|
|
<select id="countByDevSn" resultType="int">
|
select count(id) from t_face_device where dev_sno = #{devSno}
|
</select>
|
|
<!--插入操作-->
|
<insert id="insert">
|
insert into t_face_device
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="detectAlive != null">
|
detect_alive,
|
</if>
|
<if test="devSno != null">
|
dev_sno,
|
</if>
|
<if test="id != null">
|
id,
|
</if>
|
<if test="isFirst != null">
|
is_first,
|
</if>
|
<if test="name != null">
|
name,
|
</if>
|
<if test="openIRWindow != null">
|
openIR_window,
|
</if>
|
<if test="registerNo != null">
|
register_no,
|
</if>
|
<if test="retryInterval != null">
|
retry_interval,
|
</if>
|
<if test="signType != null">
|
sign_type,
|
</if>
|
<if test="threshold != null">
|
threshold,
|
</if>
|
<if test="throughType != null">
|
through_type,
|
</if>
|
<if test="type != null">
|
type,
|
</if>
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="detectAlive != null">
|
#{detectAlive},
|
</if>
|
<if test="devSno != null">
|
#{devSno},
|
</if>
|
<if test="id != null">
|
#{id},
|
</if>
|
<if test="isFirst != null">
|
#{isFirst},
|
</if>
|
<if test="name != null">
|
#{name},
|
</if>
|
<if test="openIRWindow != null">
|
#{openIRWindow},
|
</if>
|
<if test="registerNo != null">
|
#{registerNo},
|
</if>
|
<if test="retryInterval != null">
|
#{retryInterval},
|
</if>
|
<if test="signType != null">
|
#{signType},
|
</if>
|
<if test="threshold != null">
|
#{threshold},
|
</if>
|
<if test="throughType != null">
|
#{throughType},
|
</if>
|
<if test="type != null">
|
#{type},
|
</if>
|
</trim>
|
</insert>
|
|
|
<!--更新操作-->
|
<update id="update">
|
update t_face_device
|
<set>
|
<if test="detectAlive != null">
|
detect_alive=#{detectAlive},
|
</if>
|
<if test="devSno != null">
|
dev_sno=#{devSno},
|
</if>
|
<if test="isFirst != null">
|
is_first=#{isFirst},
|
</if>
|
<if test="name != null">
|
name=#{name},
|
</if>
|
<if test="openIRWindow != null">
|
openIR_window=#{openIRWindow},
|
</if>
|
<if test="registerNo != null">
|
register_no=#{registerNo},
|
</if>
|
<if test="retryInterval != null">
|
retry_interval=#{retryInterval},
|
</if>
|
<if test="signType != null">
|
sign_type=#{signType},
|
</if>
|
<if test="threshold != null">
|
threshold=#{threshold},
|
</if>
|
<if test="throughType != null">
|
through_type=#{throughType},
|
</if>
|
<if test="type != null">
|
type=#{type},
|
</if>
|
</set>
|
where id=#{id}
|
</update>
|
|
<!--逻辑删除-->
|
<update id="deletelogic">
|
update t_face_device
|
SET is_use = 0
|
where id=#{id}
|
</update>
|
|
<!--根据ID删除-->
|
<delete id="deleteById">
|
delete from t_face_device
|
where id=#{id}
|
</delete>
|
|
</mapper>
|