Browse Source

海康威视平台对接,打卡人员

LIVE_YE 10 months ago
parent
commit
de0010f845

BIN
ruoyi-admin/lib/ClientDemo.exe


BIN
ruoyi-admin/lib/ClientDemoDll/calib.dll


+ 26 - 0
ruoyi-admin/src/main/java/com/ruoyi/Common/CommonUtil.java

@@ -0,0 +1,26 @@
+package com.ruoyi.Common;
+
+public class CommonUtil {
+
+    //SDK时间解析
+    public static String parseTime(int time)
+    {
+        int dwYear=(time>>26)+2000;
+        int dwMonth=(time>>22)&15;
+        int dwDay=(time>>17)&31;
+        int dwHour=(time>>12)&31;
+        int dwMinute=(time>>6)&63;
+        int dwSecond=(time>>0)&63;
+        
+        String sTime = String.format("%04d", dwYear) +
+                String.format("%02d", dwMonth) +
+                String.format("%02d", dwDay) +
+                String.format("%02d", dwHour) +
+                String.format("%02d", dwMinute) +
+                String.format("%02d", dwSecond);
+//        System.out.println(sTime);
+        return sTime;
+    }
+
+
+}

+ 230 - 0
ruoyi-admin/src/main/java/com/ruoyi/hksdk/ClientDemo.java

@@ -0,0 +1,230 @@
+package com.ruoyi.hksdk;
+
+import com.ruoyi.Common.osSelect;
+import com.ruoyi.alarm.Alarm;
+import com.sun.jna.Native;
+import com.sun.jna.Pointer;
+
+import java.util.Timer;
+
+import static com.ruoyi.alarm.Alarm.login_V40;
+
+
+/**
+ * @create 2020-12-24-17:55
+ */
+public class ClientDemo {
+
+    int iErr = 0;
+    static HCNetSDK hCNetSDK = null;
+    static PlayCtrl playControl = null;
+    static int lUserID = -1;//用户句柄
+    static int lDChannel;  //预览通道号
+    static boolean bSaveHandle = false;
+    Timer Playbacktimer;//回放用定时器
+
+    static FExceptionCallBack_Imp fExceptionCallBack;
+    static int FlowHandle;
+
+    static class FExceptionCallBack_Imp implements HCNetSDK.FExceptionCallBack {
+        public void invoke(int dwType, int lUserID, int lHandle, Pointer pUser) {
+            System.out.println("异常事件类型:" + dwType);
+            return;
+        }
+    }
+
+    /**
+     * 动态库加载
+     *
+     * @return
+     */
+    private static boolean createSDKInstance() {
+        if (hCNetSDK == null) {
+            synchronized (HCNetSDK.class) {
+                String strDllPath = "";
+                try {
+                    if (osSelect.isWindows())
+                        //win系统加载库路径
+                        strDllPath = System.getProperty("user.dir") + "\\ruoyi-admin\\lib\\HCNetSDK.dll";
+
+                    else if (osSelect.isLinux())
+                        //Linux系统加载库路径
+                        strDllPath = System.getProperty("user.dir") + "/lib/libhcnetsdk.so";
+                    hCNetSDK = (HCNetSDK) Native.loadLibrary(strDllPath, HCNetSDK.class);
+                } catch (Exception ex) {
+                    System.out.println("loadLibrary: " + strDllPath + " Error: " + ex.getMessage());
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    /**
+     * 播放库加载
+     *
+     * @return
+     */
+    private static boolean createPlayInstance() {
+        if (playControl == null) {
+            synchronized (PlayCtrl.class) {
+                String strPlayPath = "";
+                try {
+                    if (osSelect.isWindows())
+                        //win系统加载库路径
+                        strPlayPath = System.getProperty("user.dir") + "\\ruoyi-admin\\lib\\PlayCtrl.dll";
+                    else if (osSelect.isLinux())
+                        //Linux系统加载库路径
+                        strPlayPath = System.getProperty("user.dir") + "/lib/libPlayCtrl.so";
+                    playControl = (PlayCtrl) Native.loadLibrary(strPlayPath, PlayCtrl.class);
+
+                } catch (Exception ex) {
+                    System.out.println("loadLibrary: " + strPlayPath + " Error: " + ex.getMessage());
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+
+    public static void main(String[] args) throws InterruptedException {
+
+        if (hCNetSDK == null && playControl == null) {
+            if (!createSDKInstance()) {
+                System.out.println("Load SDK fail");
+                return;
+            }
+            if (!createPlayInstance()) {
+                System.out.println("Load PlayCtrl fail");
+                return;
+            }
+        }
+        //linux系统建议调用以下接口加载组件库
+        if (osSelect.isLinux()) {
+            HCNetSDK.BYTE_ARRAY ptrByteArray1 = new HCNetSDK.BYTE_ARRAY(256);
+            HCNetSDK.BYTE_ARRAY ptrByteArray2 = new HCNetSDK.BYTE_ARRAY(256);
+            //这里是库的绝对路径,请根据实际情况修改,注意改路径必须有访问权限
+            String strPath1 = System.getProperty("user.dir") + "/lib/libcrypto.so.1.1";
+            String strPath2 = System.getProperty("user.dir") + "/lib/libssl.so.1.1";
+
+            System.arraycopy(strPath1.getBytes(), 0, ptrByteArray1.byValue, 0, strPath1.length());
+            ptrByteArray1.write();
+            hCNetSDK.NET_DVR_SetSDKInitCfg(3, ptrByteArray1.getPointer());
+
+            System.arraycopy(strPath2.getBytes(), 0, ptrByteArray2.byValue, 0, strPath2.length());
+            ptrByteArray2.write();
+            hCNetSDK.NET_DVR_SetSDKInitCfg(4, ptrByteArray2.getPointer());
+
+            String strPathCom = System.getProperty("user.dir") + "/lib/";
+            HCNetSDK.NET_DVR_LOCAL_SDK_PATH struComPath = new HCNetSDK.NET_DVR_LOCAL_SDK_PATH();
+            System.arraycopy(strPathCom.getBytes(), 0, struComPath.sPath, 0, strPathCom.length());
+            struComPath.write();
+            hCNetSDK.NET_DVR_SetSDKInitCfg(2, struComPath.getPointer());
+        }
+
+        //SDK初始化,一个程序只需要调用一次
+        boolean initSuc = hCNetSDK.NET_DVR_Init();
+
+        //异常消息回调
+        if (fExceptionCallBack == null) {
+            fExceptionCallBack = new FExceptionCallBack_Imp();
+        }
+        Pointer pUser = null;
+        if (!hCNetSDK.NET_DVR_SetExceptionCallBack_V30(0, 0, fExceptionCallBack, pUser)) {
+            return;
+        }
+        System.out.println("设置异常消息回调成功");
+
+        //启动SDK写日志
+        hCNetSDK.NET_DVR_SetLogToFile(3, "./sdkLog", false);
+
+        int userId = Alarm.login_V40( "114.99.127.243", (short) 1049, "admin", "lsly168S+");  //登录设备
+
+
+        //注释掉的代码也可以参考,去掉注释可以运行
+        //VideoDemo.getIPChannelInfo(lUserID); //获取IP通道             
+
+        //实时取流
+        VideoDemo.realPlay(lUserID, lDChannel);
+
+        //按时间回放和下载
+//          new VideoDemo().playBackBytime(lUserID,33);
+
+        //按时间下载录像
+//        new VideoDemo().dowmloadRecordByTime(lUserID);
+
+        //按时间回放和下载录像,需要等待回放和下载完成后调用注销和释放接口
+//        while (true)
+//        {
+//
+//        }
+
+        //按录像文件回放和下载
+//        VideoDemo.downloadRecordByFile(lUserID, 33);//录像文件查找下载
+//
+//        VideoDemo.playBackByfile(lUserID,33);
+        Thread.sleep(3000);
+
+        //退出程序时调用,每一台设备分别注销
+        if (hCNetSDK.NET_DVR_Logout(lUserID)) {
+            System.out.println("注销成功");
+        }
+
+        //SDK反初始化,释放资源,只需要退出时调用一次
+        hCNetSDK.NET_DVR_Cleanup();
+        return;
+
+    }
+
+    /**
+     * 设备登录V40 与V30功能一致
+     *
+     * @param ip   设备IP
+     * @param port SDK端口,默认设备的8000端口
+     * @param user 设备用户名
+     * @param psw  设备密码
+     */
+    public int login_V40(String ip, short port, String user, String psw) {
+        //注册
+        HCNetSDK.NET_DVR_USER_LOGIN_INFO m_strLoginInfo = new HCNetSDK.NET_DVR_USER_LOGIN_INFO();//设备登录信息
+        HCNetSDK.NET_DVR_DEVICEINFO_V40 m_strDeviceInfo = new HCNetSDK.NET_DVR_DEVICEINFO_V40();//设备信息
+
+        String m_sDeviceIP = ip;//设备ip地址
+        m_strLoginInfo.sDeviceAddress = new byte[HCNetSDK.NET_DVR_DEV_ADDRESS_MAX_LEN];
+        System.arraycopy(m_sDeviceIP.getBytes(), 0, m_strLoginInfo.sDeviceAddress, 0, m_sDeviceIP.length());
+
+        String m_sUsername = user;//设备用户名
+        m_strLoginInfo.sUserName = new byte[HCNetSDK.NET_DVR_LOGIN_USERNAME_MAX_LEN];
+        System.arraycopy(m_sUsername.getBytes(), 0, m_strLoginInfo.sUserName, 0, m_sUsername.length());
+
+        String m_sPassword = psw;//设备密码
+        m_strLoginInfo.sPassword = new byte[HCNetSDK.NET_DVR_LOGIN_PASSWD_MAX_LEN];
+        System.arraycopy(m_sPassword.getBytes(), 0, m_strLoginInfo.sPassword, 0, m_sPassword.length());
+
+        m_strLoginInfo.wPort = port;
+        m_strLoginInfo.bUseAsynLogin = false; //是否异步登录:0- 否,1- 是
+        m_strLoginInfo.byLoginMode = 0;  //0- SDK私有协议,1- ISAPI协议
+        m_strLoginInfo.write();
+
+        lUserID = hCNetSDK.NET_DVR_Login_V40(m_strLoginInfo, m_strDeviceInfo);
+        if (lUserID == -1) {
+            System.out.println("登录失败,错误码为" + hCNetSDK.NET_DVR_GetLastError());
+            return lUserID;
+        } else {
+            System.out.println(ip + ":设备登录成功!");
+            //相机一般只有一个通道号,热成像相机有2个通道号,通道号为1或1,2
+            //byStartDChan为IP通道起始通道号, 预览回放NVR的IP通道时需要根据起始通道号进行取值
+            if ((int) m_strDeviceInfo.struDeviceV30.byStartDChan == 1 && (int) m_strDeviceInfo.struDeviceV30.byStartDChan == 33) {
+                //byStartDChan为IP通道起始通道号, 预览回放NVR的IP通道时需要根据起始通道号进行取值,NVR起始通道号一般是33或者1开始
+                lDChannel = (int) m_strDeviceInfo.struDeviceV30.byStartDChan;
+                System.out.println("预览起始通道号:" + lDChannel);
+            }
+            return lUserID;
+        }
+    }
+
+}
+
+
+

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/clock/ClockUserInfoController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.clock;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.ClockUserInfo;
+import com.ruoyi.system.service.IClockUserInfoService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 打卡人员信息Controller
+ *
+ * @author ruoyi
+ * @date 2024-08-06
+ */
+@RestController
+@RequestMapping("/system/info")
+public class ClockUserInfoController extends BaseController
+{
+    @Autowired
+    private IClockUserInfoService clockUserInfoService;
+
+/**
+ * 查询打卡人员信息列表
+ */
+@PreAuthorize("@ss.hasPermi('system:info:list')")
+@GetMapping("/list")
+    public TableDataInfo list(ClockUserInfo clockUserInfo)
+    {
+        startPage();
+        List<ClockUserInfo> list = clockUserInfoService.selectClockUserInfoList(clockUserInfo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出打卡人员信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:export')")
+    @Log(title = "打卡人员信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ClockUserInfo clockUserInfo)
+    {
+        List<ClockUserInfo> list = clockUserInfoService.selectClockUserInfoList(clockUserInfo);
+        ExcelUtil<ClockUserInfo> util = new ExcelUtil<ClockUserInfo>(ClockUserInfo.class);
+        util.exportExcel(response, list, "打卡人员信息数据");
+    }
+
+    /**
+     * 获取打卡人员信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:query')")
+    @GetMapping(value = "/{userId}")
+    public AjaxResult getInfo(@PathVariable("userId") Long userId)
+    {
+        return success(clockUserInfoService.selectClockUserInfoByUserId(userId));
+    }
+
+    /**
+     * 新增打卡人员信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:add')")
+    @Log(title = "打卡人员信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ClockUserInfo clockUserInfo)
+    {
+        return toAjax(clockUserInfoService.insertClockUserInfo(clockUserInfo));
+    }
+
+    /**
+     * 修改打卡人员信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:edit')")
+    @Log(title = "打卡人员信息", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody ClockUserInfo clockUserInfo)
+    {
+        return toAjax(clockUserInfoService.updateClockUserInfo(clockUserInfo));
+    }
+
+    /**
+     * 删除打卡人员信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:remove')")
+    @Log(title = "打卡人员信息", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{userIds}")
+    public AjaxResult remove(@PathVariable Long[] userIds)
+    {
+        return toAjax(clockUserInfoService.deleteClockUserInfoByUserIds(userIds));
+    }
+}

+ 125 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/ClockUserInfo.java

@@ -0,0 +1,125 @@
+package com.ruoyi.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 打卡人员信息对象 clock_user_info
+ * 
+ * @author ruoyi
+ * @date 2024-08-06
+ */
+public class ClockUserInfo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 人员ID */
+    private Long userId;
+
+    /** 所属部门ID */
+    @Excel(name = "所属部门ID")
+    private Long deptId;
+
+    /** 所属部门名称 */
+    @Excel(name = "所属部门名称")
+    private Long deptName;
+
+    /** 人员姓名 */
+    @Excel(name = "人员姓名")
+    private String userName;
+
+    /** 手机号码 */
+    @Excel(name = "手机号码")
+    private String phonenumber;
+
+    /** 人员身份证号 */
+    @Excel(name = "人员身份证号")
+    private String idCard;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private String delFlag;
+
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setDeptId(Long deptId) 
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() 
+    {
+        return deptId;
+    }
+    public void setDeptName(Long deptName) 
+    {
+        this.deptName = deptName;
+    }
+
+    public Long getDeptName() 
+    {
+        return deptName;
+    }
+    public void setUserName(String userName) 
+    {
+        this.userName = userName;
+    }
+
+    public String getUserName() 
+    {
+        return userName;
+    }
+    public void setPhonenumber(String phonenumber) 
+    {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getPhonenumber() 
+    {
+        return phonenumber;
+    }
+    public void setIdCard(String idCard) 
+    {
+        this.idCard = idCard;
+    }
+
+    public String getIdCard() 
+    {
+        return idCard;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("userId", getUserId())
+            .append("deptId", getDeptId())
+            .append("deptName", getDeptName())
+            .append("userName", getUserName())
+            .append("phonenumber", getPhonenumber())
+            .append("idCard", getIdCard())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ClockUserInfoMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.ClockUserInfo;
+
+/**
+ * 打卡人员信息Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-08-06
+ */
+public interface ClockUserInfoMapper 
+{
+    /**
+     * 查询打卡人员信息
+     * 
+     * @param userId 打卡人员信息主键
+     * @return 打卡人员信息
+     */
+    public ClockUserInfo selectClockUserInfoByUserId(Long userId);
+
+    /**
+     * 查询打卡人员信息列表
+     * 
+     * @param clockUserInfo 打卡人员信息
+     * @return 打卡人员信息集合
+     */
+    public List<ClockUserInfo> selectClockUserInfoList(ClockUserInfo clockUserInfo);
+
+    /**
+     * 新增打卡人员信息
+     * 
+     * @param clockUserInfo 打卡人员信息
+     * @return 结果
+     */
+    public int insertClockUserInfo(ClockUserInfo clockUserInfo);
+
+    /**
+     * 修改打卡人员信息
+     * 
+     * @param clockUserInfo 打卡人员信息
+     * @return 结果
+     */
+    public int updateClockUserInfo(ClockUserInfo clockUserInfo);
+
+    /**
+     * 删除打卡人员信息
+     * 
+     * @param userId 打卡人员信息主键
+     * @return 结果
+     */
+    public int deleteClockUserInfoByUserId(Long userId);
+
+    /**
+     * 批量删除打卡人员信息
+     * 
+     * @param userIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteClockUserInfoByUserIds(Long[] userIds);
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ClockUserInfoServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.ClockUserInfoMapper;
+import com.ruoyi.system.domain.ClockUserInfo;
+import com.ruoyi.system.service.IClockUserInfoService;
+
+/**
+ * 打卡人员信息Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-08-06
+ */
+@Service
+public class ClockUserInfoServiceImpl implements IClockUserInfoService 
+{
+    @Autowired
+    private ClockUserInfoMapper clockUserInfoMapper;
+
+    /**
+     * 查询打卡人员信息
+     * 
+     * @param userId 打卡人员信息主键
+     * @return 打卡人员信息
+     */
+    @Override
+    public ClockUserInfo selectClockUserInfoByUserId(Long userId)
+    {
+        return clockUserInfoMapper.selectClockUserInfoByUserId(userId);
+    }
+
+    /**
+     * 查询打卡人员信息列表
+     * 
+     * @param clockUserInfo 打卡人员信息
+     * @return 打卡人员信息
+     */
+    @Override
+    public List<ClockUserInfo> selectClockUserInfoList(ClockUserInfo clockUserInfo)
+    {
+        return clockUserInfoMapper.selectClockUserInfoList(clockUserInfo);
+    }
+
+    /**
+     * 新增打卡人员信息
+     * 
+     * @param clockUserInfo 打卡人员信息
+     * @return 结果
+     */
+    @Override
+    public int insertClockUserInfo(ClockUserInfo clockUserInfo)
+    {
+        clockUserInfo.setCreateTime(DateUtils.getNowDate());
+        return clockUserInfoMapper.insertClockUserInfo(clockUserInfo);
+    }
+
+    /**
+     * 修改打卡人员信息
+     * 
+     * @param clockUserInfo 打卡人员信息
+     * @return 结果
+     */
+    @Override
+    public int updateClockUserInfo(ClockUserInfo clockUserInfo)
+    {
+        clockUserInfo.setUpdateTime(DateUtils.getNowDate());
+        return clockUserInfoMapper.updateClockUserInfo(clockUserInfo);
+    }
+
+    /**
+     * 批量删除打卡人员信息
+     * 
+     * @param userIds 需要删除的打卡人员信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteClockUserInfoByUserIds(Long[] userIds)
+    {
+        return clockUserInfoMapper.deleteClockUserInfoByUserIds(userIds);
+    }
+
+    /**
+     * 删除打卡人员信息信息
+     * 
+     * @param userId 打卡人员信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteClockUserInfoByUserId(Long userId)
+    {
+        return clockUserInfoMapper.deleteClockUserInfoByUserId(userId);
+    }
+}

+ 100 - 0
ruoyi-system/src/main/resources/mapper/system/ClockUserInfoMapper.xml

@@ -0,0 +1,100 @@
+<?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.ruoyi.system.mapper.ClockUserInfoMapper">
+    
+    <resultMap type="ClockUserInfo" id="ClockUserInfoResult">
+        <result property="userId"    column="user_id"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="userName"    column="user_name"    />
+        <result property="phonenumber"    column="phonenumber"    />
+        <result property="idCard"    column="id_card"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectClockUserInfoVo">
+        select user_id, dept_id, dept_name, user_name, phonenumber, id_card, del_flag, create_by, create_time, update_by, update_time, remark from clock_user_info
+    </sql>
+
+    <select id="selectClockUserInfoList" parameterType="ClockUserInfo" resultMap="ClockUserInfoResult">
+        <include refid="selectClockUserInfoVo"/>
+        <where>  
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="deptName != null "> and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
+            <if test="phonenumber != null  and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
+            <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
+        </where>
+    </select>
+    
+    <select id="selectClockUserInfoByUserId" parameterType="Long" resultMap="ClockUserInfoResult">
+        <include refid="selectClockUserInfoVo"/>
+        where user_id = #{userId}
+    </select>
+        
+    <insert id="insertClockUserInfo" parameterType="ClockUserInfo" useGeneratedKeys="true" keyProperty="userId">
+        insert into clock_user_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="deptId != null">dept_id,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="userName != null and userName != ''">user_name,</if>
+            <if test="phonenumber != null">phonenumber,</if>
+            <if test="idCard != null">id_card,</if>
+            <if test="delFlag != null">del_flag,</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="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="deptId != null">#{deptId},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="userName != null and userName != ''">#{userName},</if>
+            <if test="phonenumber != null">#{phonenumber},</if>
+            <if test="idCard != null">#{idCard},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateClockUserInfo" parameterType="ClockUserInfo">
+        update clock_user_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+            <if test="userName != null and userName != ''">user_name = #{userName},</if>
+            <if test="phonenumber != null">phonenumber = #{phonenumber},</if>
+            <if test="idCard != null">id_card = #{idCard},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where user_id = #{userId}
+    </update>
+
+    <delete id="deleteClockUserInfoByUserId" parameterType="Long">
+        delete from clock_user_info where user_id = #{userId}
+    </delete>
+
+    <delete id="deleteClockUserInfoByUserIds" parameterType="String">
+        delete from clock_user_info where user_id in 
+        <foreach item="userId" collection="array" open="(" separator="," close=")">
+            #{userId}
+        </foreach>
+    </delete>
+</mapper>