Browse Source

修改了连续判定方式 新增了一个用于返回PC端的页面

Reiskuchen 5 years ago
parent
commit
8699d417ff

+ 21 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TimeCalculationShowController.java

@@ -0,0 +1,21 @@
+package com.management.platform.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2020-02-05
+ */
+@RestController
+@RequestMapping("/time-calculation-show")
+public class TimeCalculationShowController {
+
+}
+

+ 71 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeCalculationShow.java

@@ -0,0 +1,71 @@
+package com.management.platform.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2020-02-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class TimeCalculationShow extends Model<TimeCalculationShow> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 时间记录表主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 用户表主键
+     */
+    @TableField("user_id")
+    private String userId;
+
+    /**
+     * 日期
+     */
+    @TableField("date")
+    private LocalDate date;
+
+    /**
+     * 开始时间
+     */
+    @TableField("start_time")
+    private LocalTime startTime;
+
+    /**
+     * 结束时间
+     */
+    @TableField("end_time")
+    private LocalTime endTime;
+
+    /**
+     * 持续时间 秒
+     */
+    @TableField("duration")
+    private Integer duration;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/TimeCalculationShowMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.TimeCalculationShow;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2020-02-05
+ */
+public interface TimeCalculationShowMapper extends BaseMapper<TimeCalculationShow> {
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/TimeCalculationShowService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.TimeCalculationShow;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2020-02-05
+ */
+public interface TimeCalculationShowService extends IService<TimeCalculationShow> {
+
+}

+ 146 - 84
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ScreenshotServiceImpl.java

@@ -1,22 +1,17 @@
 package com.management.platform.service.impl;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.constant.Constant;
 import com.management.platform.constant.Parameter;
 import com.management.platform.entity.PicContentKeywords;
 import com.management.platform.entity.Screenshot;
 import com.management.platform.entity.TimeCalculation;
-import com.management.platform.entity.User;
+import com.management.platform.entity.TimeCalculationShow;
 import com.management.platform.entity.vo.ScreenshotVO;
 import com.management.platform.mapper.*;
-import com.management.platform.mapper.PicContentKeywordsMapper;
 import com.management.platform.service.ScreenshotService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.util.*;
-import net.sourceforge.tess4j.Word;
 import org.apache.log4j.Logger;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -68,15 +63,149 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
 
     @Resource
     private ScreenshotMapper screenshotMapper;
-
     @Resource
     private PicContentKeywordsMapper picContentKeywordsMapper;
-
     @Resource
     private TimeCalculationMapper timeCalculationMapper;
-
     @Resource
     private UserMapper userMapper;
+    @Resource
+    private TimeCalculationShowMapper timeCalculationShowMapper;
+
+    //每次获取到截屏后计算并处理
+    private void calculateTime(Screenshot screenshot) {
+        try {
+            //首先拿去处理show表
+            calculateShowTime(screenshot);
+
+            //如果图片类型为空 则认为是 -1 - 其他
+            if (null == screenshot.getPicType()) {
+                screenshot.setPicType(-1);
+            }
+            //默认状态为不连续 如果下面判断是连续才会修改为true
+            Boolean isConsecutive = false,
+                    isSameType = false;
+            //获取本人当天结束时间为准的最后一条记录
+            TimeCalculation latestRecord = timeCalculationMapper.selectOne(new QueryWrapper<TimeCalculation>()
+                    .eq("user_id", screenshot.getUid())
+                    .eq("date", screenshot.getIndate().toLocalDate())
+                    .orderByDesc("end_time")
+                    .last("LIMIT 1"));
+            //截图时间
+            LocalTime currentTime = screenshot.getIndate().toLocalTime();
+            //如果有上一条记录
+            if (latestRecord != null) {
+                //前后两张是否相同类型
+                isSameType = latestRecord.getActionType().equals(screenshot.getPicType());
+                //前后两张时间是否连续 这个目前为600秒
+                LocalTime estimatedTime = latestRecord.getEndTime();
+                Integer durationSecond = ((currentTime.getHour() - estimatedTime.getHour()) * 3600
+                        + (currentTime.getMinute() - estimatedTime.getMinute()) * 60
+                        + (currentTime.getSecond() - estimatedTime.getSecond()));
+                //断层不大于一定时间的话  用来判断是否连续
+                isConsecutive = durationSecond <= DETECTION_INTERVAL;
+            }
+            if (isConsecutive && isSameType) {
+                //如果时间连续 且是同一类型的话 修改上一条记录的最后时间和持续时间
+                LocalTime startTime = latestRecord.getStartTime();
+                //计算新的间隔
+                Integer duration = ((currentTime.getHour() - startTime.getHour()) * 3600
+                        + (currentTime.getMinute() - startTime.getMinute()) * 60
+                        + (currentTime.getSecond() - startTime.getSecond()));
+                //设置新的结束时间和持续时间 保存记录
+                latestRecord.setEndTime(currentTime).setDuration(duration);
+                timeCalculationMapper.updateById(latestRecord);
+            } else {
+                //如果不是连续的话 新增一个记录
+                TimeCalculation timeCalculation = new TimeCalculation();
+                timeCalculation
+                        .setUserId(screenshot.getUid())
+                        //根据截图种类设置行为代号
+                        .setActionType(screenshot.getPicType())
+                        .setDate(screenshot.getIndate().toLocalDate())
+                        //设置开始时间和结束时间都为当前时间
+                        .setStartTime(currentTime)
+                        .setEndTime(currentTime)
+                        //第一次的持续时间默认为最少单位1秒
+                        .setDuration(1);
+                timeCalculationMapper.insert(timeCalculation);
+                if (isConsecutive) {
+                    //然后如果只是类型不同但是能连上的话
+                    LocalTime startTime = latestRecord.getStartTime();
+                    //计算新的间隔
+                    Integer duration = ((currentTime.getHour() - startTime.getHour()) * 3600
+                            + (currentTime.getMinute() - startTime.getMinute()) * 60
+                            + (currentTime.getSecond() - startTime.getSecond()));
+                    //设置新的结束时间和持续时间 保存记录
+                    latestRecord.setEndTime(currentTime).setDuration(duration);
+                    timeCalculationMapper.updateById(latestRecord);
+                }
+            }
+            /*之后可能还需要处理跨越一天的情况*/
+        } catch (NullPointerException e) {
+            //凡是有空指针说明缺少用户id或者时间数据
+            log.info("工作时长统计失败 缺少用户或时间数据");
+        }
+    }
+
+    //每次获取到截屏后计算并处理
+    private void calculateShowTime(Screenshot screenshot) {
+        try {
+            //如果图片类型为空 则认为是 -1 - 其他
+            if (null == screenshot.getPicType()) {
+                screenshot.setPicType(-1);
+            }
+            //默认状态为不连续 如果下面判断是连续才会修改为true
+            Boolean isConsecutive = false;
+            //获取本人当天结束时间为准的最后一条记录
+            TimeCalculationShow latestRecord = timeCalculationShowMapper.selectOne(
+                    new QueryWrapper<TimeCalculationShow>()
+                            .eq("user_id", screenshot.getUid())
+                            .eq("date", screenshot.getIndate().toLocalDate())
+                            .orderByDesc("end_time")
+                            .last("LIMIT 1"));
+            //截图时间
+            LocalTime currentTime = screenshot.getIndate().toLocalTime();
+            //如果有上一条记录
+            if (latestRecord != null) {
+                //前后两张时间是否连续 这个目前为600秒
+                LocalTime estimatedTime = latestRecord.getEndTime();
+                Integer durationSecond = ((currentTime.getHour() - estimatedTime.getHour()) * 3600
+                        + (currentTime.getMinute() - estimatedTime.getMinute()) * 60
+                        + (currentTime.getSecond() - estimatedTime.getSecond()));
+                //断层不大于一定时间的话  用来判断是否连续
+                isConsecutive = durationSecond <= DETECTION_INTERVAL;
+            }
+
+            if (isConsecutive) {
+                //如果是连续的话 修改上一条记录的最后时间和持续时间
+                LocalTime startTime = latestRecord.getStartTime();
+                //计算新的间隔
+                Integer duration = ((currentTime.getHour() - startTime.getHour()) * 3600
+                        + (currentTime.getMinute() - startTime.getMinute()) * 60
+                        + (currentTime.getSecond() - startTime.getSecond()));
+                //设置新的结束时间和持续时间 保存记录
+                latestRecord.setEndTime(currentTime).setDuration(duration);
+                timeCalculationShowMapper.updateById(latestRecord);
+            } else {
+                //如果不是连续的话 新增一个记录
+                TimeCalculationShow timeCalculationShow = new TimeCalculationShow();
+                timeCalculationShow
+                        .setUserId(screenshot.getUid())
+                        .setDate(screenshot.getIndate().toLocalDate())
+                        //设置开始时间和结束时间都为当前时间
+                        .setStartTime(currentTime)
+                        .setEndTime(currentTime)
+                        //第一次的持续时间默认为最少单位1秒
+                        .setDuration(1);
+                timeCalculationShowMapper.insert(timeCalculationShow);
+            }
+            /*之后可能还需要处理跨越一天的情况*/
+        } catch (NullPointerException e) {
+            //凡是有空指针说明缺少用户id或者时间数据
+            log.info("工作时长统计失败 缺少用户或时间数据");
+        }
+    }
 
     //获取所有人最新的截图
     @Override
@@ -125,7 +254,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
     @Override
     public HttpRespMsg saveAndProcessImage(ScreenshotVO screenshotvo) {
         Map<String, Object> fileMap = UploadFileToFileNameUtil.uploadFile(screenshotvo.getFile(), path);
-        String filePath = (String)fileMap.get("sqlFilePath");
+        String filePath = (String) fileMap.get("sqlFilePath");
         Screenshot screenshot = new Screenshot();
         BeanUtils.copyProperties(screenshotvo, screenshot);
         screenshot.setPicUrl(filePath);
@@ -157,7 +286,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
             //由于存入数据库的对象被序列化成了json字符串,所以从redis里拿方便
             members = redisUtil.members(Constant.COMMON_SOFTWARE_KEYWORDS);
         }
-        File picFile = new File((String)fileMap.get("newFile"));
+        File picFile = new File((String) fileMap.get("newFile"));
         if (isNovel(textContents)) {
             screenshot.setPicType(6);
         } else if (isDocument(textContents)) {
@@ -175,7 +304,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
                 File f = new File(prePath);
                 if (f.exists()) {
                     ImageCompare comp = new ImageCompare();
-                    if (comp.isMoviePlay((String)fileMap.get("newFile"), prePath)) {
+                    if (comp.isMoviePlay((String) fileMap.get("newFile"), prePath)) {
                         screenshot.setPicType(7);
                         //前面那条也更新
                         if (preShot.getPicType() != null && preShot.getPicType() != 7) {
@@ -189,7 +318,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
         if (screenshot.getPicType() == null) {
             //默认设置为查资料
             try {
-                String browserName = isBrowser(new File((String)fileMap.get("newFile")));
+                String browserName = isBrowser(new File((String) fileMap.get("newFile")));
                 System.out.println(
                         "找到浏览器==" + browserName
                 );
@@ -210,8 +339,8 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
     @Override
     public HttpRespMsg updateRedisPicContentKeywords() {
         List<PicContentKeywords> picContentKeywords = picContentKeywordsMapper.selectList(null);
-        for (PicContentKeywords  keyWord : picContentKeywords) {
-            redisUtil.sSetJsonString("keyWords",keyWord);
+        for (PicContentKeywords keyWord : picContentKeywords) {
+            redisUtil.sSetJsonString("keyWords", keyWord);
         }
         HttpRespMsg msg = new HttpRespMsg();
         msg.data = redisUtil.members("keyWords");
@@ -245,7 +374,6 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
             return false;
         }
 
-
         //第二步,匹配小说常见词汇,超过5次,认为是小说
         try {
             //填充小说关键字到内存,减少重复读取
@@ -313,7 +441,6 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
         return !hasDifferent;
     }
 
-
     /**
      * 是否全是汉字<br>
      * 根据汉字编码范围进行判断<br>
@@ -330,71 +457,6 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
         return pattern.matcher(str).matches();
     }
 
-
-    //每次获取到截屏后计算并处理
-    private void calculateTime(Screenshot screenshot) {
-        try {
-            //如果图片类型为空 则认为是-1-其他
-            if(null == screenshot.getPicType()){
-                screenshot.setPicType(-1);
-            }
-            //默认状态为不连续 如果下面判断是连续才会修改为true
-            Boolean isConsecutive = false;
-            //获取本人当天结束时间为准的最后一条记录
-            TimeCalculation latestRecord = timeCalculationMapper.selectOne(new QueryWrapper<TimeCalculation>()
-                    .eq("user_id", screenshot.getUid())
-                    .eq("date", screenshot.getIndate().toLocalDate())
-                    .orderByDesc("end_time")
-                    .last("LIMIT 1"));
-            //单独记录当前的时间以便使用
-            LocalTime currentTime = screenshot.getIndate().toLocalTime();
-            if (latestRecord != null) {
-                //首先对比类型 同一种行为才有可能合并
-                if (latestRecord.getActionType().equals(screenshot.getPicType())) {
-                    //如果有记录的话 计算上次结束和新的开始的时间差
-                    LocalTime estimatedTime = latestRecord.getEndTime();
-                    Integer durationSecond = ((currentTime.getHour() - estimatedTime.getHour()) * 3600
-                            + (currentTime.getMinute() - estimatedTime.getMinute()) * 60
-                            + (currentTime.getSecond() - estimatedTime.getSecond()));
-                    //断层不大于一定时间的话 这个定义目前为600秒
-                    if (durationSecond <= DETECTION_INTERVAL) {
-                        //确认连续 将状态改为连续
-                        isConsecutive = true;
-                    }
-                }
-            }
-            if (isConsecutive) {
-                //如果是连续的话 修改上一条记录的最后时间和持续时间
-                LocalTime startTime = latestRecord.getStartTime();
-                //计算新的间隔
-                Integer duration = ((currentTime.getHour() - startTime.getHour()) * 3600
-                        + (currentTime.getMinute() - startTime.getMinute()) * 60
-                        + (currentTime.getSecond() - startTime.getSecond()));
-                //设置新的结束时间和持续时间 保存记录
-                latestRecord.setEndTime(currentTime).setDuration(duration);
-                timeCalculationMapper.updateById(latestRecord);
-            } else {
-                //如果不是连续的话 新增一个记录
-                TimeCalculation timeCalculation = new TimeCalculation();
-                timeCalculation
-                        .setUserId(screenshot.getUid())
-                        //根据截图种类设置行为代号
-                        .setActionType(screenshot.getPicType())
-                        .setDate(screenshot.getIndate().toLocalDate())
-                        //设置开始时间和结束时间都为当前时间
-                        .setStartTime(currentTime)
-                        .setEndTime(currentTime)
-                        //第一次的持续时间默认为最少单位1秒 不然我看一眼就成了0秒了
-                        .setDuration(1);
-                timeCalculationMapper.insert(timeCalculation);
-            }
-            /*之后可能还需要处理跨越一天的情况*/
-        } catch (NullPointerException e) {
-            //凡是有空指针说明缺少用户id或者时间数据
-            log.info("工作时长统计失败 缺少用户或时间数据");
-        }
-    }
-
     //判断是否是浏览器
     private String isBrowser(File pic) throws Exception {
 //        System.out.println("picrecongnizeFolder=="+browserFolder);
@@ -480,7 +542,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
             if (!pic.exists()) {
                 System.err.println("文件不存在" + pic.getAbsolutePath());
             } else {
-                System.out.println("找到文件"  + pic.getAbsolutePath());
+                System.out.println("找到文件" + pic.getAbsolutePath());
             }
             BufferedImage img = ImageIO.read(pic);
             int width = img.getWidth();

+ 16 - 12
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TimeCalculationServiceImpl.java

@@ -2,11 +2,13 @@ package com.management.platform.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.entity.TimeCalculation;
+import com.management.platform.entity.TimeCalculationShow;
 import com.management.platform.mapper.TimeCalculationMapper;
+import com.management.platform.mapper.TimeCalculationShowMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.TimeCalculationService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.util.HttpRespMsg;
 import org.springframework.stereotype.Service;
 
@@ -17,7 +19,10 @@ import java.time.LocalDate;
 import java.time.ZoneOffset;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeParseException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -32,9 +37,10 @@ public class TimeCalculationServiceImpl extends ServiceImpl<TimeCalculationMappe
 
     @Resource
     private UserMapper userMapper;
-
     @Resource
     private TimeCalculationMapper timeCalculationMapper;
+    @Resource
+    private TimeCalculationShowMapper timeCalculationShowMapper;
 
     //根据id获取用户名 日期 时间分布
     @Override
@@ -133,20 +139,18 @@ public class TimeCalculationServiceImpl extends ServiceImpl<TimeCalculationMappe
         return httpRespMsg;
     }
 
-    //根据日期段获取本人的工作时间段
+    //修改后的计算时长方法 使用TimeCalculationShow
     @Override
     public HttpRespMsg getDuration(String startDate, String endDate, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
             LocalDate start = LocalDate.parse(startDate, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
             LocalDate end = LocalDate.parse(endDate, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
-            //获取时间段内本人全部的工作记录 娱乐6 7 8不计入
-            Integer[] workType = {-1, 0, 1, 2, 3, 4, 5};
-            List<TimeCalculation> dataList = timeCalculationMapper.selectList(new QueryWrapper<TimeCalculation>()
-                    .eq("user_id", request.getHeader("Token"))
-                    .in("action_type", workType)
-                    .between("date", start, end)
-                    .orderByAsc("start_time"));
+            List<TimeCalculationShow> dataList = timeCalculationShowMapper.selectList(
+                    new QueryWrapper<TimeCalculationShow>()
+                            .eq("user_id", request.getHeader("Token"))
+                            .between("date", start, end)
+                            .orderByAsc("start_time"));
             //先把所有的日期搞到一个list里面
             ArrayList<String> dateList = new ArrayList<>();
             LocalDate currentDate = start;
@@ -164,7 +168,7 @@ public class TimeCalculationServiceImpl extends ServiceImpl<TimeCalculationMappe
                 dataMap.put("date", date);
                 List<Map<String, Object>> list = new ArrayList<>();
                 //遍历所有时间记录
-                for (TimeCalculation timeCalculation : dataList) {
+                for (TimeCalculationShow timeCalculation : dataList) {
                     //如果这一天就是我们需要的那天的话
                     if (timeCalculation.getDate().toString().equals(date)) {
                         Map<String, Object> map = new HashMap<>();

+ 20 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TimeCalculationShowServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.TimeCalculationShow;
+import com.management.platform.mapper.TimeCalculationShowMapper;
+import com.management.platform.service.TimeCalculationShowService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2020-02-05
+ */
+@Service
+public class TimeCalculationShowServiceImpl extends ServiceImpl<TimeCalculationShowMapper, TimeCalculationShow> implements TimeCalculationShowService {
+
+}

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/CodeGenerator.java

@@ -204,7 +204,7 @@ public class CodeGenerator {
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
         //此处user是表名,多个英文逗号分割
-        strategy.setInclude("company");
+        strategy.setInclude("time_calculation_show");
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
         strategy.setControllerMappingHyphenStyle(true);

+ 20 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeCalculationShowMapper.xml

@@ -0,0 +1,20 @@
+<?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.management.platform.mapper.TimeCalculationShowMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.TimeCalculationShow">
+        <id column="id" property="id" />
+        <result column="user_id" property="userId" />
+        <result column="date" property="date" />
+        <result column="start_time" property="startTime" />
+        <result column="end_time" property="endTime" />
+        <result column="duration" property="duration" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, user_id, date, start_time, end_time, duration
+    </sql>
+
+</mapper>