瀏覽代碼

mqtt,报表导出

LIVE_YE 2 周之前
父節點
當前提交
7ca68b75d8

+ 106 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/kaoqin/AttendanceTimeController.java

@@ -0,0 +1,106 @@
+package com.ruoyi.web.controller.kaoqin;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.domain.vo.AttendanceTimeVo;
+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.AttendanceTime;
+import com.ruoyi.system.service.IAttendanceTimeService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 考勤时间设置Controller
+ * 
+ * @author ruoyi
+ * @date 2025-06-25
+ */
+@RestController
+@RequestMapping("/system/time")
+public class AttendanceTimeController extends BaseController
+{
+    @Autowired
+    private IAttendanceTimeService attendanceTimeService;
+
+    /**
+     * 查询考勤时间设置列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:time:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AttendanceTime attendanceTime)
+    {
+        startPage();
+        List<AttendanceTime> list = attendanceTimeService.selectAttendanceTimeList(attendanceTime);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出考勤时间设置列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:time:export')")
+    @Log(title = "考勤时间设置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AttendanceTime attendanceTime)
+    {
+        List<AttendanceTime> list = attendanceTimeService.selectAttendanceTimeList(attendanceTime);
+        ExcelUtil<AttendanceTime> util = new ExcelUtil<AttendanceTime>(AttendanceTime.class);
+        util.exportExcel(response, list, "考勤时间设置数据");
+    }
+
+    /**
+     * 获取考勤时间设置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:time:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(attendanceTimeService.selectAttendanceTimeById(id));
+    }
+
+    /**
+     * 新增考勤时间设置
+     */
+    @PreAuthorize("@ss.hasPermi('system:time:add')")
+    @Log(title = "考勤时间设置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AttendanceTimeVo attendanceTimeVo)
+    {
+        return toAjax(attendanceTimeService.insertAttendanceTime(attendanceTimeVo));
+    }
+
+    /**
+     * 修改考勤时间设置
+     */
+    @PreAuthorize("@ss.hasPermi('system:time:edit')")
+    @Log(title = "考勤时间设置", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody AttendanceTimeVo attendanceTimeVo)
+    {
+        return toAjax(attendanceTimeService.updateAttendanceTime(attendanceTimeVo));
+    }
+
+    /**
+     * 删除考勤时间设置
+     */
+    @PreAuthorize("@ss.hasPermi('system:time:remove')")
+    @Log(title = "考勤时间设置", businessType = BusinessType.DELETE)
+    @GetMapping(value = "/delete/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(attendanceTimeService.deleteAttendanceTimeByIds(ids));
+    }
+}

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/kaoqin/KaoqinConfigController.java

@@ -93,6 +93,7 @@ public class KaoqinConfigController extends BaseController
     /**
      * 删除考勤规则配置
      */
+    @PreAuthorize("@ss.hasPermi('kaoqin:config:remove')")
     @Log(title = "考勤规则配置", businessType = BusinessType.DELETE)
     @GetMapping(value = "/delete/{kaoqinIds}")
     public AjaxResult remove(@PathVariable Long[] kaoqinIds)

+ 11 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/MapToObjectUtils.java

@@ -1,6 +1,8 @@
 package com.ruoyi.common.utils;
 
 import org.apache.commons.beanutils.BeanUtils;
+import org.springframework.beans.BeanWrapper;
+import org.springframework.beans.BeanWrapperImpl;
 
 import java.util.Map;
 
@@ -11,4 +13,13 @@ public class MapToObjectUtils {
         BeanUtils.populate(obj, map); // 自动匹配Map键和对象属性名
         return obj;
     }
+
+    public static <T> T mapToBean(Map<String, ?> map, Class<T> clazz) throws Exception {
+        T obj = clazz.getDeclaredConstructor().newInstance();
+        BeanWrapper wrapper = new BeanWrapperImpl(obj);
+        for (Map.Entry<String, ?> entry : map.entrySet()) {
+            wrapper.setPropertyValue(entry.getKey(), entry.getValue());
+        }
+        return obj;
+    }
 }

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/mqtt/service/MqttService.java

@@ -42,7 +42,7 @@ public class MqttService {
      * 在服务启动时订阅默认主题
      */
     @PostConstruct
-    public void init() {
+    /*public void init() {
         // 如果配置了默认主题,则自动订阅
         if (mqttProperties.getDefaultTopic() != null && !mqttProperties.getDefaultTopic().isEmpty()) {
             try {
@@ -53,7 +53,7 @@ public class MqttService {
                 log.error("自动订阅默认主题失败: {}", e.getMessage(), e);
             }
         }
-    }
+    }*/
 
     /**
      * 销毁方法

+ 112 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/AttendanceTime.java

@@ -0,0 +1,112 @@
+package com.ruoyi.system.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+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;
+
+/**
+ * 考勤时间设置对象 attendance_time
+ * 
+ * @author ruoyi
+ * @date 2025-06-25
+ */
+public class AttendanceTime extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /** 结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date endTime;
+
+    /** 部门id */
+    @Excel(name = "部门id")
+    private String deptId;
+
+    /** 部门名称 */
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /** 提交时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "提交时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date submitTime;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setStartTime(Date startTime) 
+    {
+        this.startTime = startTime;
+    }
+
+    public Date getStartTime() 
+    {
+        return startTime;
+    }
+    public void setEndTime(Date endTime) 
+    {
+        this.endTime = endTime;
+    }
+
+    public Date getEndTime() 
+    {
+        return endTime;
+    }
+
+    public String getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(String deptId) {
+        this.deptId = deptId;
+    }
+
+    public void setDeptName(String deptName)
+    {
+        this.deptName = deptName;
+    }
+
+    public String getDeptName() 
+    {
+        return deptName;
+    }
+    public void setSubmitTime(Date submitTime) 
+    {
+        this.submitTime = submitTime;
+    }
+
+    public Date getSubmitTime() 
+    {
+        return submitTime;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("startTime", getStartTime())
+            .append("endTime", getEndTime())
+            .append("deptId", getDeptId())
+            .append("deptName", getDeptName())
+            .append("submitTime", getSubmitTime())
+            .toString();
+    }
+}

+ 12 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/AttendanceTimeVo.java

@@ -0,0 +1,12 @@
+package com.ruoyi.system.domain.vo;
+
+import com.ruoyi.system.domain.AttendanceTime;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class AttendanceTimeVo {
+
+    private List<AttendanceTime> attendanceTimeList;
+}

+ 57 - 2
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/BaobiaoVo.java

@@ -8,7 +8,7 @@ public class BaobiaoVo {
      * 姓名
      */
     @Excel(name = "姓名", type = Excel.Type.EXPORT)
-    private String name;
+    private String userName;
 
     /**
      * 部门名称
@@ -20,7 +20,7 @@ public class BaobiaoVo {
      * 已打卡
      */
     @Excel(name = "已打卡", type = Excel.Type.EXPORT)
-    private boolean ydk;
+    private String ydk;
 
     /**
      * 迟到
@@ -46,4 +46,59 @@ public class BaobiaoVo {
     @Excel(name = "外勤", type = Excel.Type.EXPORT)
     private String wq;
 
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getYdk() {
+        return ydk;
+    }
+
+    public void setYdk(String ydk) {
+        this.ydk = ydk;
+    }
+
+    public String getCd() {
+        return cd;
+    }
+
+    public void setCd(String cd) {
+        this.cd = cd;
+    }
+
+    public String getZt() {
+        return zt;
+    }
+
+    public void setZt(String zt) {
+        this.zt = zt;
+    }
+
+    public String getQk() {
+        return qk;
+    }
+
+    public void setQk(String qk) {
+        this.qk = qk;
+    }
+
+    public String getWq() {
+        return wq;
+    }
+
+    public void setWq(String wq) {
+        this.wq = wq;
+    }
 }

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

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.AttendanceTime;
+
+/**
+ * 考勤时间设置Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2025-06-25
+ */
+public interface AttendanceTimeMapper 
+{
+    /**
+     * 查询考勤时间设置
+     * 
+     * @param id 考勤时间设置主键
+     * @return 考勤时间设置
+     */
+    public AttendanceTime selectAttendanceTimeById(Long id);
+
+    /**
+     * 查询考勤时间设置列表
+     * 
+     * @param attendanceTime 考勤时间设置
+     * @return 考勤时间设置集合
+     */
+    public List<AttendanceTime> selectAttendanceTimeList(AttendanceTime attendanceTime);
+
+    /**
+     * 新增考勤时间设置
+     * 
+     * @param attendanceTime 考勤时间设置
+     * @return 结果
+     */
+    public int insertAttendanceTime(AttendanceTime attendanceTime);
+
+    /**
+     * 修改考勤时间设置
+     * 
+     * @param attendanceTime 考勤时间设置
+     * @return 结果
+     */
+    public int updateAttendanceTime(AttendanceTime attendanceTime);
+
+    /**
+     * 删除考勤时间设置
+     * 
+     * @param id 考勤时间设置主键
+     * @return 结果
+     */
+    public int deleteAttendanceTimeById(Long id);
+
+    /**
+     * 批量删除考勤时间设置
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAttendanceTimeByIds(Long[] ids);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IAttendanceTimeService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.AttendanceTime;
+import com.ruoyi.system.domain.vo.AttendanceTimeVo;
+
+/**
+ * 考勤时间设置Service接口
+ * 
+ * @author ruoyi
+ * @date 2025-06-25
+ */
+public interface IAttendanceTimeService 
+{
+    /**
+     * 查询考勤时间设置
+     * 
+     * @param id 考勤时间设置主键
+     * @return 考勤时间设置
+     */
+    public AttendanceTime selectAttendanceTimeById(Long id);
+
+    /**
+     * 查询考勤时间设置列表
+     * 
+     * @param attendanceTime 考勤时间设置
+     * @return 考勤时间设置集合
+     */
+    public List<AttendanceTime> selectAttendanceTimeList(AttendanceTime attendanceTime);
+
+    /**
+     * 新增考勤时间设置
+     * 
+     * @param attendanceTimeVo 考勤时间设置
+     * @return 结果
+     */
+    public int insertAttendanceTime(AttendanceTimeVo attendanceTimeVo);
+
+    /**
+     * 修改考勤时间设置
+     * 
+     * @param attendanceTime 考勤时间设置
+     * @return 结果
+     */
+    public int updateAttendanceTime(AttendanceTimeVo attendanceTimeVo);
+
+    /**
+     * 批量删除考勤时间设置
+     * 
+     * @param ids 需要删除的考勤时间设置主键集合
+     * @return 结果
+     */
+    public int deleteAttendanceTimeByIds(Long[] ids);
+
+    /**
+     * 删除考勤时间设置信息
+     * 
+     * @param id 考勤时间设置主键
+     * @return 结果
+     */
+    public int deleteAttendanceTimeById(Long id);
+}

+ 26 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/Task.java

@@ -4,7 +4,9 @@ package com.ruoyi.system.service;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.HolidayUtils;
+import com.ruoyi.system.domain.AttendanceTime;
 import com.ruoyi.system.domain.KaoqinRecord;
+import com.ruoyi.system.mapper.AttendanceTimeMapper;
 import com.ruoyi.system.mapper.KaoqinRecordMapper;
 import com.ruoyi.system.mapper.SysUserMapper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,6 +16,8 @@ import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 @Component
 public class Task {
@@ -22,6 +26,8 @@ public class Task {
     private SysUserMapper userMapper;
     @Autowired
     private KaoqinRecordMapper kaoqinRecordMapper;
+    @Autowired
+    private AttendanceTimeMapper attendanceTimeMapper;
 
     /***
      * 定时插入未打卡数据
@@ -30,14 +36,20 @@ public class Task {
     //@Scheduled(cron = "0 0/2 * * * ? ")
     @Scheduled(cron = "0 1 0 * * ? ")
     public void thirdNucleicAcid() {
+        String day = DateUtils.getDate();
         //获取前一天的日期
         String data = DateUtils.plusSeconds(DateUtils.getDate(),-1,"yyyy-MM-dd");
-        //判断前一天是否是法定节假日  0 上班 1周末 2节假日
+        //判断当天天是否是法定节假日  0 上班 1周末 2节假日
         String jsonResult = HolidayUtils.request(data);
         if(!"0".equals(jsonResult)){
             //是节假日的话不需要插入数据,直接返回
             return;
         }
+        //查询考勤规则
+        AttendanceTime attendanceTime = new AttendanceTime();
+        List<AttendanceTime> attendanceTimes = attendanceTimeMapper.selectAttendanceTimeList(attendanceTime);
+        //根据部门分类
+        //Map<Long, List<AttendanceTime>> collect = attendanceTimes.stream().collect(Collectors.groupingBy(AttendanceTime::getDeptId));
         //获取所有有部门的人员
         List<SysUser> userList = userMapper.selectUserListNoDept();
         //获取前一天的所有考勤记录
@@ -45,6 +57,18 @@ public class Task {
         kaoqinRecord.setKaTime(data);
         List<KaoqinRecord> kaoqinRecordList = kaoqinRecordMapper.selectKaoqinRecordList(kaoqinRecord);
         for (SysUser sysUser : userList) {
+            boolean blt = false;
+            if(attendanceTimes != null && !attendanceTimes.isEmpty()){
+                for (AttendanceTime time : attendanceTimes) {
+                    if(time.getDeptName().contains(sysUser.getDept().getDeptName()) && DateUtils.isDateBetween(DateUtils.convertStringToDate(data), time.getStartTime(), time.getEndTime())){
+                        blt = true;
+                        break;
+                    }
+                }
+            }
+            if(!blt){
+                continue;
+            }
             boolean bl = true;
             for (KaoqinRecord record : kaoqinRecordList) {
                 if(record.getUserId().equals(sysUser.getUserId())){
@@ -57,6 +81,7 @@ public class Task {
                 KaoqinRecord kaoqinRecords = new KaoqinRecord();
                 kaoqinRecords.setUserId(sysUser.getUserId());
                 kaoqinRecords.setUserName(sysUser.getNickName());
+                kaoqinRecords.setPhone(sysUser.getPhonenumber());
                 kaoqinRecords.setDeptId(sysUser.getDeptId());
                 kaoqinRecords.setDeptName(sysUser.getDept().getDeptName());
                 kaoqinRecords.setAncestors(sysUser.getDept().getAncestors());

+ 106 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AttendanceTimeServiceImpl.java

@@ -0,0 +1,106 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.vo.AttendanceTimeVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.AttendanceTimeMapper;
+import com.ruoyi.system.domain.AttendanceTime;
+import com.ruoyi.system.service.IAttendanceTimeService;
+
+/**
+ * 考勤时间设置Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2025-06-25
+ */
+@Service
+public class AttendanceTimeServiceImpl implements IAttendanceTimeService {
+    @Autowired
+    private AttendanceTimeMapper attendanceTimeMapper;
+
+    /**
+     * 查询考勤时间设置
+     *
+     * @param id 考勤时间设置主键
+     * @return 考勤时间设置
+     */
+    @Override
+    public AttendanceTime selectAttendanceTimeById(Long id) {
+        return attendanceTimeMapper.selectAttendanceTimeById(id);
+    }
+
+    /**
+     * 查询考勤时间设置列表
+     *
+     * @param attendanceTime 考勤时间设置
+     * @return 考勤时间设置
+     */
+    @Override
+    public List<AttendanceTime> selectAttendanceTimeList(AttendanceTime attendanceTime) {
+        return attendanceTimeMapper.selectAttendanceTimeList(attendanceTime);
+    }
+
+    /**
+     * 新增考勤时间设置
+     *
+     * @param attendanceTimeVo 考勤时间设置
+     * @return 结果
+     */
+    @Override
+    public int insertAttendanceTime(AttendanceTimeVo attendanceTimeVo) {
+        int i = 0;
+        List<AttendanceTime> attendanceTimeList = attendanceTimeVo.getAttendanceTimeList();
+        for (AttendanceTime attendanceTime : attendanceTimeList) {
+            attendanceTime.setSubmitTime(DateUtils.getNowDate());
+            i = i + attendanceTimeMapper.insertAttendanceTime(attendanceTime);
+        }
+        return i;
+    }
+
+    /**
+     * 修改考勤时间设置
+     *
+     * @param attendanceTimeVo 考勤时间设置
+     * @return 结果
+     */
+    @Override
+    public int updateAttendanceTime(AttendanceTimeVo attendanceTimeVo) {
+        int i = 0;
+        List<AttendanceTime> attendanceTimeList = attendanceTimeVo.getAttendanceTimeList();
+        for (AttendanceTime attendanceTime : attendanceTimeList) {
+            if (attendanceTime.getId() != null && attendanceTime.getId() != 0L) {
+                attendanceTime.setSubmitTime(DateUtils.getNowDate());
+                i = i + attendanceTimeMapper.updateAttendanceTime(attendanceTime);
+            } else {
+                i = i + attendanceTimeMapper.insertAttendanceTime(attendanceTime);
+            }
+
+        }
+        return i;
+    }
+
+    /**
+     * 批量删除考勤时间设置
+     *
+     * @param ids 需要删除的考勤时间设置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAttendanceTimeByIds(Long[] ids) {
+        return attendanceTimeMapper.deleteAttendanceTimeByIds(ids);
+    }
+
+    /**
+     * 删除考勤时间设置信息
+     *
+     * @param id 考勤时间设置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAttendanceTimeById(Long id) {
+        return attendanceTimeMapper.deleteAttendanceTimeById(id);
+    }
+}

+ 76 - 0
ruoyi-system/src/main/resources/mapper/system/AttendanceTimeMapper.xml

@@ -0,0 +1,76 @@
+<?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.AttendanceTimeMapper">
+    
+    <resultMap type="AttendanceTime" id="AttendanceTimeResult">
+        <result property="id"    column="id"    />
+        <result property="startTime"    column="start_time"    />
+        <result property="endTime"    column="end_time"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="submitTime"    column="submit_time"    />
+    </resultMap>
+
+    <sql id="selectAttendanceTimeVo">
+        select id, start_time, end_time, dept_id, dept_name, submit_time from attendance_time
+    </sql>
+
+    <select id="selectAttendanceTimeList" parameterType="AttendanceTime" resultMap="AttendanceTimeResult">
+        <include refid="selectAttendanceTimeVo"/>
+        <where>  
+            <if test="startTime != null "> and start_time = #{startTime}</if>
+            <if test="endTime != null "> and end_time = #{endTime}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="submitTime != null "> and submit_time = #{submitTime}</if>
+        </where>
+    </select>
+    
+    <select id="selectAttendanceTimeById" parameterType="Long" resultMap="AttendanceTimeResult">
+        <include refid="selectAttendanceTimeVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertAttendanceTime" parameterType="AttendanceTime" useGeneratedKeys="true" keyProperty="id">
+        insert into attendance_time
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="startTime != null">start_time,</if>
+            <if test="endTime != null">end_time,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="submitTime != null">submit_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="startTime != null">#{startTime},</if>
+            <if test="endTime != null">#{endTime},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="submitTime != null">#{submitTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAttendanceTime" parameterType="AttendanceTime">
+        update attendance_time
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+            <if test="submitTime != null">submit_time = #{submitTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAttendanceTimeById" parameterType="Long">
+        delete from attendance_time where id = #{id}
+    </delete>
+
+    <delete id="deleteAttendanceTimeByIds" parameterType="String">
+        delete from attendance_time where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 2 - 2
ruoyi-system/src/main/resources/mapper/system/BusinessTripMapper.xml

@@ -84,10 +84,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="examinersName != null  and examinersName != ''"> and t.examiners_name like concat('%', #{examinersName}, '%')</if>
             <if test="isPass != null  and isPass != ''"> and t.is_pass = #{isPass}</if>
             <if test="submitTime != null "> and t.submit_time = #{submitTime}</if>
-            <if test="startTime != null and startTime != ''">
+            <if test="startTime != null ">
                 AND date_format(start_time,'%y%m%d %H:%i:%s') &gt;=  date_format(#{startTime},'%y%m%d %H:%i:%s')
             </if>
-            <if test="endTime != null and endTime != ''">
+            <if test="endTime != null ">
                 AND date_format(end_time,'%y%m%d %H:%i:%s') &lt;=  date_format(#{endTime},'%y%m%d %H:%i:%s')
             </if>
         </where>

+ 2 - 2
ruoyi-system/src/main/resources/mapper/system/KaoqinRecordMapper.xml

@@ -65,10 +65,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="kaWeek != null  and kaWeek != ''"> and ka_week = #{kaWeek}</if>
             <if test="kaTime != null  and kaTime != ''"> and ka_time = #{kaTime}</if>
             <if test="startTime != null and startTime != ''"><!-- 开始时间检索 -->
-                and date_format(kaTime,'%Y%m%d') &gt;= date_format(#{startTime},'%Y%m%d')
+                and date_format(ka_time,'%Y%m%d') &gt;= date_format(#{startTime},'%Y%m%d')
             </if>
             <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
-                and date_format(kaTime,'%Y%m%d') &lt;= date_format(#{endTime},'%Y%m%d')
+                and date_format(ka_time,'%Y%m%d') &lt;= date_format(#{endTime},'%Y%m%d')
             </if>
 
             <if test="kaAddressAmIn != null  and kaAddressAmIn != ''"> and ka_address_am_in = #{kaAddressAmIn}</if>

+ 2 - 2
ruoyi-system/src/main/resources/mapper/system/RecordLeaveMapper.xml

@@ -43,10 +43,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{deptId}
                 </foreach>
             </if>
-            <if test="startTime != null and startTime != ''">
+            <if test="startTime != null ">
                 AND date_format(start_time,'%y%m%d %H:%i:%s') &gt;=  date_format(#{startTime},'%y%m%d %H:%i:%s')
             </if>
-            <if test="endTime != null and endTime != ''">
+            <if test="endTime != null">
                 AND date_format(end_time,'%y%m%d %H:%i:%s') &lt;=  date_format(#{endTime},'%y%m%d %H:%i:%s')
             </if>
         </where>