张晓波
2023-10-12 c3e0c3ee12df1ffb544aa63c6c3a60486cbd1e40
删除大屏 mq
已修改1个文件
已添加13个文件
已删除28个文件
742 ■■■■■ 文件已修改
hd/pipe/StaffManage/src/main/java/com/thhy/staff/config/EmqxConfig.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/java/com/thhy/staff/config/EmqxProperties.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceDeviceController.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/entity/FaceDevice.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/entity/FaceResult.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/entity/FaceUtils.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/mapper/FaceDeviceMapper.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/FaceDeviceService.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/FaceServer.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/impl/FaceDeviceServiceImpl.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/impl/FaceServerImpl.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/application-dev.yml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libAudioIntercom.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCAlarm.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCCoreDevCfg.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCDisplay.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCGeneralCfgMgr.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCIndustry.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCPlayBack.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCPreview.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCVoiceTalk.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libStreamTransClient.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libSystemTransform.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libanalyzedata.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libiconv2.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDK_Log_Switch.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/examples.jar 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/jna.jar 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/json.jar 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/libAudioRender.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/libHCCore.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/libNPQos.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/libPlayCtrl.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/libSuperRender.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/libcrypto.so.1.1 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/libhcnetsdk.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/libhpr.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/libopenal.so.1 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/libssl.so.1.1 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/lib/libz.so 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/resources/mapping/FaceDeviceMapper.xml 228 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/StaffManage/src/main/java/com/thhy/staff/config/EmqxConfig.java
对比新文件
@@ -0,0 +1,43 @@
package com.thhy.staff.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.io.Serializable;
@Data
@Configuration
@ConfigurationProperties(prefix = "emqx")
public class EmqxConfig {
    private String host;
    private String port;
    private String username;
    private String password;
    private int qos;
    private String topic;
    private String willTopic;
    private String willContent;
    @Override
    public String toString() {
        return "{" +
                "host:'" + host + '\'' +
                ", port:'" + port + '\'' +
                ", username:'" + username + '\'' +
                ", password:'" + password + '\'' +
                ", qos:" + qos +
                ", topic:'" + topic + '\'' +
                ", willTopic:'" + willTopic + '\'' +
                ", willContent:'" + willContent + '\'' +
                '}';
    }
}
hd/pipe/StaffManage/src/main/java/com/thhy/staff/config/EmqxProperties.java
对比新文件
@@ -0,0 +1,22 @@
package com.thhy.staff.config;
import lombok.Data;
@Data
public class EmqxProperties {
    private String host;
    private String port;
    private String username;
    private String password;
    private int qos;
    private String topic;
    private String willTopic;
    private String willContent;
}
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java
对比新文件
@@ -0,0 +1,23 @@
package com.thhy.staff.modules.biz.face.controller;
import com.thhy.general.common.BasicResult;
import com.thhy.staff.modules.biz.face.entity.FaceResult;
import com.thhy.staff.modules.biz.face.service.FaceServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("face")
public class FaceController {
    @Autowired
    private FaceServer faceServer;
    @RequestMapping("/device/login")
    public FaceResult login(@RequestBody String mess){
        FaceResult faceResult = faceServer.login(mess);
        return faceResult;
    }
}
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceDeviceController.java
对比新文件
@@ -0,0 +1,54 @@
package com.thhy.staff.modules.biz.face.controller;
import com.github.pagehelper.PageInfo;
import com.thhy.general.common.BasicResult;
import com.thhy.general.utils.PagingUtils;
import com.thhy.staff.modules.biz.face.entity.FaceDevice;
import com.thhy.staff.modules.biz.face.service.FaceDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
 * @author zhang_xiao_bo
 * @since 2023-10-12 10:27:42
 */
@RestController
@RequestMapping("faceDevice")
public class FaceDeviceController {
    @Autowired
    private FaceDeviceService faceDeviceService;
    @RequestMapping("findList")
    public BasicResult findList(@RequestBody(required = false) FaceDevice faceDevice,HttpServletRequest req){
        PagingUtils.setPageParam(req);
        List<FaceDevice> faceDeviceList = faceDeviceService.findList(faceDevice);
        PageInfo<FaceDevice> pageInfo = new PageInfo<>(faceDeviceList);
        return BasicResult.success(pageInfo);
    }
    @RequestMapping("addFaceDevice")
    public BasicResult addFaceDevice(@RequestBody FaceDevice faceDevice){
        faceDeviceService.addFaceDevice(faceDevice);
        return BasicResult.success();
    }
    /**
    @RequestMapping("update")
    public BasicResult update(@RequestBody FaceDevice faceDevice){
        faceDeviceService.update(faceDevice);
        return BasicResult.success();
    }**/
    @RequestMapping("delete")
    public BasicResult delete(@RequestBody FaceDevice faceDevice){
        faceDeviceService.delete(faceDevice.getId());
        return BasicResult.success();
    }
}
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/entity/FaceDevice.java
对比新文件
@@ -0,0 +1,99 @@
package com.thhy.staff.modules.biz.face.entity;
import com.thhy.general.annotations.Idkey;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
 *
 * @author zhang_xiao_bo
 * @since 2023-10-12 10:27:42
 */
@Data
@Accessors(chain = true)
public class FaceDevice implements Serializable {
    /**
     * 检测活体,close:不开启活体检测,IRAlive:IRAlive模式
     */
    private String detectAlive;
    /**
     * 设备MAC地址
     */
    private String devSno;
    @Idkey
    private String id;
    /**
     * 是否首次登录。如果在中途切换其它平台账号,再次登录此参数为true
     */
    private Integer isFirst;
    /**
     * 设备管理
     */
    private String name;
    /**
     * 是否开启IR小窗口
     */
    private Integer openIRWindow;
    /**
     * 设备注册号
     */
    private String registerNo;
    /**
     * 人脸识别去重时间, 单位:秒
     */
    private double retryInterval;
    /**
     * 签名类型
     */
    private String signType;
    /**
     * 识别阀值
     */
    private double threshold;
    /**
     * 1出2入
     */
    private String throughType;
    /**
     * 1门禁机
     */
    private Integer type;
}
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/entity/FaceResult.java
对比新文件
@@ -0,0 +1,39 @@
package com.thhy.staff.modules.biz.face.entity;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.thhy.general.utils.DeepCopyUtils;
import com.thhy.general.utils.UUIDUtils;
import com.thhy.staff.config.EmqxConfig;
import com.thhy.staff.config.EmqxProperties;
import lombok.Data;
import java.io.Serializable;
@Data
public class FaceResult implements Serializable {
    private int code;
    private String msg;
    private boolean success;
    private String dev_sno;
    private String token;
    private JSONObject mqinfo;
    public FaceResult() {
    }
    public FaceResult(boolean success,FaceDevice faceDevice,String emqxConfig){
        this.success = success;
        this.code = 0;
        this.msg = "登录成功";
        this.dev_sno = faceDevice.getDevSno();
        this.mqinfo = JSON.parseObject(emqxConfig);
        this.token = UUIDUtils.create();
    }
}
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/entity/FaceUtils.java
对比新文件
@@ -0,0 +1,33 @@
package com.thhy.staff.modules.biz.face.entity;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
public class FaceUtils {
    public static FaceDevice toFaceDevice(String json){
        JSONObject jsonObject = JSON.parseObject(json);
        FaceDevice faceDevice = JSON.toJavaObject(jsonObject,FaceDevice.class);
        return faceDevice;
    }
    public static void main(String[] args) {
        String mess = "{\n" +
                "    \"detectAlive\": \"IRAlive\",\n" +
                "    \"dev_sno\": \"FF:0C:F4:12:67:05\",\n" +
                "    \"device_ip\": \"192.168.1.135\",\n" +
                "    \"distance\": 4,\n" +
                "    \"isFirst\": true,\n" +
                "    \"name\": \"Terminal\",\n" +
                "    \"openIRWindow\": false,\n" +
                "    \"register_no\": \"12\",\n" +
                "    \"retryInterval\": 2,\n" +
                "    \"sign_type\": \"dev_sign\",\n" +
                "    \"threshold\": 70,\n" +
                "    \"throughType\": \"2\",\n" +
                "    \"type\": 1\n" +
                "}";
        FaceDevice faceDevice = toFaceDevice(mess);
    }
}
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/mapper/FaceDeviceMapper.java
对比新文件
@@ -0,0 +1,35 @@
package com.thhy.staff.modules.biz.face.mapper;
import com.thhy.staff.modules.biz.face.entity.FaceDevice;
import org.springframework.stereotype.Component;
import java.io.Serializable;
import java.util.List;
/**
 *  Mapper 接口
 * @author zhang_xiao_bo
 * @since 2023-10-12 10:27:42
 */
@Component
public interface FaceDeviceMapper {
    FaceDevice queryById(Serializable id);
    Integer queryVersionById(Serializable id);
    List<FaceDevice> findList(FaceDevice facedevice);
    List<FaceDevice> findAll();
    int countByDevSn(String devSn);
    void insert(FaceDevice facedevice);
    void update(FaceDevice facedevice);
    void deletelogic(Serializable id);
    void deleteById(Serializable id);
}
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/FaceDeviceService.java
对比新文件
@@ -0,0 +1,24 @@
package com.thhy.staff.modules.biz.face.service;
import com.thhy.staff.modules.biz.face.entity.FaceDevice;
import java.io.Serializable;
import java.util.List;
/**
 *  服务类
 * @author zhang_xiao_bo
 * @since 2023-10-12 10:27:42
 */
public interface FaceDeviceService {
    FaceDevice get(Serializable id);
    List<FaceDevice> findList(FaceDevice faceDevice);
    void addFaceDevice(FaceDevice faceDevice);
    void update(FaceDevice faceDevice);
    void delete(Serializable id);
}
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/FaceServer.java
对比新文件
@@ -0,0 +1,8 @@
package com.thhy.staff.modules.biz.face.service;
import com.thhy.staff.modules.biz.face.entity.FaceResult;
public interface FaceServer {
    FaceResult login(String mess);
}
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/impl/FaceDeviceServiceImpl.java
对比新文件
@@ -0,0 +1,66 @@
package com.thhy.staff.modules.biz.face.service.impl;
import com.thhy.staff.modules.biz.face.entity.FaceDevice;
import com.thhy.staff.modules.biz.face.mapper.FaceDeviceMapper;
import com.thhy.staff.modules.biz.face.service.FaceDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
/**
 *  服务实现类
 * @author zhang_xiao_bo
 * @since 2023-10-12 10:27:42
 */
@Service
public class FaceDeviceServiceImpl implements FaceDeviceService {
    @Autowired
    private FaceDeviceMapper faceDeviceMapper;
    public FaceDevice get(Serializable id){
        return faceDeviceMapper.queryById(id);
    }
    public List<FaceDevice> findList(FaceDevice faceDevice){
        return faceDeviceMapper.findList(faceDevice);
    }
    /**
     * 增加和修改
     * @param faceDevice
     */
    @Transactional
    public void addFaceDevice(FaceDevice faceDevice){
        if(faceDevice.getId() == null){
            //增加操作
            faceDeviceMapper.insert(faceDevice);
        }else{
            //修改操作
            //faceDevice.setUpdateTime(new Date());
            faceDeviceMapper.update(faceDevice);
        }
    }
    /**
     * 修改
     * @param faceDevice
     */
    public void update(FaceDevice faceDevice){
        faceDeviceMapper.update(faceDevice);
    }
    /**
     * 删除
     * @param id
     */
    public void delete(Serializable id){
        faceDeviceMapper.deletelogic(id);
    }
}
hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/impl/FaceServerImpl.java
对比新文件
@@ -0,0 +1,43 @@
package com.thhy.staff.modules.biz.face.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.thhy.general.utils.DeepCopyUtils;
import com.thhy.staff.config.EmqxConfig;
import com.thhy.staff.config.EmqxProperties;
import com.thhy.staff.modules.biz.face.entity.FaceDevice;
import com.thhy.staff.modules.biz.face.entity.FaceResult;
import com.thhy.staff.modules.biz.face.mapper.FaceDeviceMapper;
import com.thhy.staff.modules.biz.face.service.FaceServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class FaceServerImpl implements FaceServer {
    @Autowired
    private FaceDeviceMapper faceDeviceMapper;
    @Autowired
    private EmqxConfig emqxConfig;
    private Logger logger = LoggerFactory.getLogger(FaceServer.class);
    @Override
    public FaceResult login(String mess) {
        JSONObject jsonObject = JSONObject.parseObject(mess);
        FaceDevice faceDevice = JSON.toJavaObject(jsonObject,FaceDevice.class);
        int devCount = faceDeviceMapper.countByDevSn(faceDevice.getDevSno());
        if (devCount<1) {
            faceDeviceMapper.insert(faceDevice);
        }else{
            logger.info("设备"+faceDevice.getDevSno()+"已经存在");
        }
        FaceResult faceResult = new FaceResult(true,faceDevice,emqxConfig.toString());
        return faceResult;
    }
}
hd/pipe/StaffManage/src/main/resources/application-dev.yml
@@ -19,4 +19,15 @@
        file-extension: yml
        group: sunacos
global:
  filePrefix: https://pipe.thhy-tj.com/
  filePrefix: https://pipe.thhy-tj.com/
emqx:
  host: 111.30.93.212
  port: 1883
  username: io
  password: io
  qos: 1
  topic: FF:AA:F4:12:67:05
  willTopic: FF:AA:F4:12:67:05-W
  willContent: FF:AA:F4:12:67:05-offline
netty:
  port: 10001
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libAudioIntercom.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCAlarm.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCCoreDevCfg.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCDisplay.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCGeneralCfgMgr.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCIndustry.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCPlayBack.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCPreview.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libHCVoiceTalk.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libStreamTransClient.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libSystemTransform.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libanalyzedata.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDKCom/libiconv2.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/HCNetSDK_Log_Switch.xml
文件已删除
hd/pipe/StaffManage/src/main/resources/lib/examples.jar
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/jna.jar
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/json.jar
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/libAudioRender.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/libHCCore.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/libNPQos.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/libPlayCtrl.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/libSuperRender.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/libcrypto.so.1.1
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/libhcnetsdk.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/libhpr.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/libopenal.so.1
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/libssl.so.1.1
Binary files differ
hd/pipe/StaffManage/src/main/resources/lib/libz.so
Binary files differ
hd/pipe/StaffManage/src/main/resources/mapping/FaceDeviceMapper.xml
对比新文件
@@ -0,0 +1,228 @@
<?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>