lipenghui 3 hónapja
szülő
commit
908778a5d0

+ 65 - 2
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java

@@ -4,6 +4,7 @@ import cn.hutool.core.date.LocalDateTimeUtil;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMap;
 
 
 import java.time.*;
 import java.time.*;
+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
@@ -149,9 +150,9 @@ public class DateUtils {
     }
     }
 
 
 
 
-    public static ImmutableMap<String, LocalDateTime> getBeginEndDay() {
+    public static ImmutableMap<String, LocalDateTime> getBeginEndDay(Integer day) {
         // 昨天开始时间(00:00:00)
         // 昨天开始时间(00:00:00)
-        LocalDateTime yesterdayStart = LocalDate.now().minusDays(1).atStartOfDay();
+        LocalDateTime yesterdayStart = LocalDate.now().minusDays(day).atStartOfDay();
         // 昨天结束时间(23:59:59.999999999)
         // 昨天结束时间(23:59:59.999999999)
         LocalDateTime yesterdayEnd = LocalDateTime.of(LocalDate.now().minusDays(1), LocalTime.MAX);
         LocalDateTime yesterdayEnd = LocalDateTime.of(LocalDate.now().minusDays(1), LocalTime.MAX);
         return ImmutableMap.of("start", yesterdayStart, "end", yesterdayEnd);
         return ImmutableMap.of("start", yesterdayStart, "end", yesterdayEnd);
@@ -173,4 +174,66 @@ public class DateUtils {
         LocalDateTime monthEnd = LocalDateTime.now().with(LocalTime.MAX);
         LocalDateTime monthEnd = LocalDateTime.now().with(LocalTime.MAX);
         return ImmutableMap.of("start", monthStart, "end", monthEnd);
         return ImmutableMap.of("start", monthStart, "end", monthEnd);
     }
     }
+    public static List<MonthRange> getLastYearMonthRanges() {
+        List<MonthRange> result = new ArrayList<>();
+        YearMonth currentYearMonth = YearMonth.now();
+        YearMonth startYearMonth = currentYearMonth.minusMonths(11);
+
+        for (int i = 0; i < 12; i++) {
+            YearMonth yearMonth = startYearMonth.plusMonths(i);
+            String formattedMonth = yearMonth.toString(); // 格式为 yyyy-MM
+            LocalDateTime start = yearMonth.atDay(1).atStartOfDay();
+            LocalDateTime end = yearMonth.atEndOfMonth().atTime(LocalTime.MAX);
+            result.add(new MonthRange(formattedMonth, start, end, 0));
+        }
+
+        return result;
+    }
+
+    public static class MonthRange {
+        private  String yearMonth;
+        private  LocalDateTime start;
+        private  LocalDateTime end;
+        private  Integer count;
+
+        public MonthRange(String yearMonth, LocalDateTime start, LocalDateTime end, Integer count) {
+            this.yearMonth = yearMonth;
+            this.start = start;
+            this.end = end;
+            this.count = count;
+        }
+
+        public void setYearMonth(String yearMonth) {
+            this.yearMonth = yearMonth;
+        }
+
+        public void setStart(LocalDateTime start) {
+            this.start = start;
+        }
+
+        public void setEnd(LocalDateTime end) {
+            this.end = end;
+        }
+
+        public void setCount(Integer count) {
+            this.count = count;
+        }
+
+        public String getYearMonth() {
+            return yearMonth;
+        }
+
+        public LocalDateTime getStart() {
+            return start;
+        }
+
+        public LocalDateTime getEnd() {
+            return end;
+        }
+
+        public Integer getCount() {
+            return count;
+        }
+
+    }
 }
 }

+ 204 - 3
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/stat/IotStaticController.java

@@ -3,13 +3,24 @@ package cn.iocoder.yudao.module.pms.controller.admin.stat;
 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 import cn.iocoder.yudao.framework.common.util.date.DateUtils;
 import cn.iocoder.yudao.framework.common.util.date.DateUtils;
 import cn.iocoder.yudao.module.pms.controller.admin.failure.vo.IotFailureReportPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.failure.vo.IotFailureReportPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotInspectOrderPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmainworkorder.vo.IotMainWorkOrderPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotmainworkorder.vo.IotMainWorkOrderSaveReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.maintain.vo.IotMaintainPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.maintain.vo.IotMaintainPageReqVO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.failure.IotFailureReportDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.failure.IotFailureReportDO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectOrderDO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotmainworkorder.IotMainWorkOrderDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.maintain.IotMaintainDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.maintain.IotMaintainDO;
 import cn.iocoder.yudao.module.pms.dal.mysql.failure.IotFailureReportMapper;
 import cn.iocoder.yudao.module.pms.dal.mysql.failure.IotFailureReportMapper;
+import cn.iocoder.yudao.module.pms.dal.mysql.inspect.IotInspectOrderMapper;
+import cn.iocoder.yudao.module.pms.dal.mysql.iotmainworkorder.IotMainWorkOrderMapper;
 import cn.iocoder.yudao.module.pms.dal.mysql.maintain.IotMaintainMapper;
 import cn.iocoder.yudao.module.pms.dal.mysql.maintain.IotMaintainMapper;
+import cn.iocoder.yudao.module.pms.service.inspect.IotInspectOrderService;
+import com.alibaba.fastjson.JSON;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMap;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import org.jetbrains.annotations.NotNull;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -17,10 +28,13 @@ import org.springframework.web.bind.annotation.RestController;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
+import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.getLastYearMonthRanges;
+
 @Tag(name = "统计接口")
 @Tag(name = "统计接口")
 @RestController
 @RestController
 @RequestMapping("/rq/stat")
 @RequestMapping("/rq/stat")
@@ -30,10 +44,16 @@ public class IotStaticController {
     private IotFailureReportMapper iotFailureReportMapper;
     private IotFailureReportMapper iotFailureReportMapper;
     @Resource
     @Resource
     private IotMaintainMapper iotMaintainMapper;
     private IotMaintainMapper iotMaintainMapper;
+    @Autowired
+    private IotInspectOrderMapper iotInspectOrderMapper;
+    @Autowired
+    private IotInspectOrderService iotInspectOrderService;
+    @Autowired
+    private IotMainWorkOrderMapper iotMainWorkOrderMapper;
 
 
     @GetMapping("/main/day")
     @GetMapping("/main/day")
     public CommonResult<Map<String, Object>> getMaintainDay() {
     public CommonResult<Map<String, Object>> getMaintainDay() {
-        ImmutableMap<String, LocalDateTime> beginEndDay = DateUtils.getBeginEndDay();
+        ImmutableMap<String, LocalDateTime> beginEndDay = DateUtils.getBeginEndDay(1);
         IotFailureReportPageReqVO iotFailureReportPageReqVO = new IotFailureReportPageReqVO();
         IotFailureReportPageReqVO iotFailureReportPageReqVO = new IotFailureReportPageReqVO();
         iotFailureReportPageReqVO.setCreateTime(new LocalDateTime[]{beginEndDay.get("start"), beginEndDay.get("end")});
         iotFailureReportPageReqVO.setCreateTime(new LocalDateTime[]{beginEndDay.get("start"), beginEndDay.get("end")});
         Long failure = iotFailureReportMapper.selectCountByTimeAndStatus(iotFailureReportPageReqVO);
         Long failure = iotFailureReportMapper.selectCountByTimeAndStatus(iotFailureReportPageReqVO);
@@ -43,8 +63,12 @@ public class IotStaticController {
         return CommonResult.success(ImmutableMap.of("failureDay", failure, "maintainDay", maintain));
         return CommonResult.success(ImmutableMap.of("failureDay", failure, "maintainDay", maintain));
     }
     }
 
 
-    public static void main(String[] args) {
 
 
+    public static void main(String[] args) {
+        ImmutableMap<String, LocalDateTime> beginEndDay = DateUtils.getBeginEndDay(1);
+        System.out.println(JSON.toJSONString(beginEndDay));
+        ImmutableMap<String, LocalDateTime> beginEndDay1 = DateUtils.getBeginEndDay(0);
+        System.out.println(JSON.toJSONString(beginEndDay1));
     }
     }
 
 
     @GetMapping("/main/week")
     @GetMapping("/main/week")
@@ -88,8 +112,185 @@ public class IotStaticController {
     }
     }
 
 
     @GetMapping("/main/year")
     @GetMapping("/main/year")
-    public void getMaintainYear() {
+    public CommonResult<List<DateUtils.MonthRange>> getMaintainYear() {
+        List<DateUtils.MonthRange> lastYearMonths = getLastYearMonthRanges();
+        List<DateUtils.MonthRange> collect = lastYearMonths.stream().map(e -> {
+            IotFailureReportPageReqVO iotFailureReportPageReqVO = new IotFailureReportPageReqVO();
+            iotFailureReportPageReqVO.setCreateTime(new LocalDateTime[]{e.getStart(), e.getEnd()});
+            Long l = iotFailureReportMapper.selectCountByTimeAndStatus(iotFailureReportPageReqVO);
+            e.setCount(Integer.valueOf(String.valueOf(l)));
+            return e;
+        }).collect(Collectors.toList());
+
+        return CommonResult.success(collect);
+    }
+
+    @GetMapping("/inspect/day")
+    public CommonResult<Map<String, Object>> getInspectDay() {
+        ImmutableMap<String, LocalDateTime> beginEndDay = DateUtils.getBeginEndDay(1);
+        IotInspectOrderPageReqVO iotInspectOrderPageReqVO = new IotInspectOrderPageReqVO();
+        iotInspectOrderPageReqVO.setCreateTime(new LocalDateTime[]{beginEndDay.get("start"), beginEndDay.get("end")});
+        Long inspectDayTotal = iotInspectOrderMapper.selectCountByTimeAndStatus(iotInspectOrderPageReqVO);
+        iotInspectOrderPageReqVO.setStatus("todo");
+        Long inspectDayTodo = iotInspectOrderMapper.selectCountByTimeAndStatus(iotInspectOrderPageReqVO);
+
+        return CommonResult.success(ImmutableMap.of("total", inspectDayTotal,"todo", inspectDayTodo));
+    }
+
+    @GetMapping("/inspect/week")
+    public CommonResult<Map<String, Object>> getInspectWeek() {
+        IotInspectOrderPageReqVO iotInspectOrderPageReqVO = new IotInspectOrderPageReqVO();
+        ImmutableMap<String, LocalDateTime> beginEndWeek = DateUtils.getBeginEndWeek();
+        iotInspectOrderPageReqVO.setCreateTime(new LocalDateTime[]{beginEndWeek.get("start"), beginEndWeek.get("end")});
+        Long inspectWeekTotal = iotInspectOrderMapper.selectCountByTimeAndStatus(iotInspectOrderPageReqVO);
+        iotInspectOrderPageReqVO.setStatus("todo");
+        Long inspectWeekTodo = iotInspectOrderMapper.selectCountByTimeAndStatus(iotInspectOrderPageReqVO);
+
+        return CommonResult.success(ImmutableMap.of("total", inspectWeekTotal,"todo", inspectWeekTodo));
+    }
 
 
+    @GetMapping("/inspect/month")
+    public CommonResult<Map<String, Object>> getInspectMonth() {
+        IotInspectOrderPageReqVO iotInspectOrderPageReqVO = new IotInspectOrderPageReqVO();
+        ImmutableMap<String, LocalDateTime> beginEndMonth = DateUtils.getBeginEndMonth();
+        iotInspectOrderPageReqVO.setCreateTime(new LocalDateTime[]{beginEndMonth.get("start"), beginEndMonth.get("end")});
+        Long inspectWeekTotal = iotInspectOrderMapper.selectCountByTimeAndStatus(iotInspectOrderPageReqVO);
+        iotInspectOrderPageReqVO.setStatus("todo");
+        Long inspectWeekTodo = iotInspectOrderMapper.selectCountByTimeAndStatus(iotInspectOrderPageReqVO);
+
+        return CommonResult.success(ImmutableMap.of("total", inspectWeekTotal,"todo", inspectWeekTodo));
+    }
+
+    @GetMapping("/inspect/total")
+    public CommonResult<Map<String, Object>> getInspectTotal() {
+        Long total = iotInspectOrderMapper.selectCount();
+        Long todo = iotInspectOrderMapper.selectCount("status", "todo");
+
+        return CommonResult.success(ImmutableMap.of("total", total,"todo", todo));
+    }
+
+
+    @GetMapping("/inspect/status")
+    public CommonResult<Map<String, Long>> getInspectStatusInfo() {
+        List<IotInspectOrderDO> iotInspectOrderDOS = iotInspectOrderMapper.selectList();
+        Map<String, Long> order = iotInspectOrderDOS.stream().collect(Collectors.groupingBy(IotInspectOrderDO::getStatus, Collectors.counting()));
+        return CommonResult.success(order);
+    }
+
+    @GetMapping("/inspect/today/status")
+    public CommonResult<Map<String, Long>> getInspectTodayStatusInfo() {
+        ImmutableMap<String, LocalDateTime> beginEndDay = DateUtils.getBeginEndDay(0);
+        IotInspectOrderPageReqVO iotInspectOrderPageReqVO = new IotInspectOrderPageReqVO();
+        iotInspectOrderPageReqVO.setCreateTime(new LocalDateTime[]{beginEndDay.get("start"), beginEndDay.get("end")});
+        List<IotInspectOrderDO> iotInspectOrderDOS = iotInspectOrderMapper.selectListByCreateTime(iotInspectOrderPageReqVO);
+        Map<String, Long> order = iotInspectOrderDOS.stream().collect(Collectors.groupingBy(IotInspectOrderDO::getStatus, Collectors.counting()));
+        return CommonResult.success(order);
+    }
+
+    @GetMapping("/inspect/year")
+    public CommonResult<List<DateUtils.MonthRange>> getInspectYear() {
+        List<DateUtils.MonthRange> lastYearMonths = getLastYearMonthRanges();
+        List<DateUtils.MonthRange> collect = lastYearMonths.stream().map(e -> {
+            IotInspectOrderPageReqVO iotInspectOrderPageReqVO = new IotInspectOrderPageReqVO();
+            iotInspectOrderPageReqVO.setCreateTime(new LocalDateTime[]{e.getStart(), e.getEnd()});
+            Long l = iotInspectOrderMapper.selectCountByTimeAndStatus(iotInspectOrderPageReqVO);
+            e.setCount(Integer.valueOf(String.valueOf(l)));
+            return e;
+        }).collect(Collectors.toList());
+
+        return CommonResult.success(collect);
+    }
+
+
+    @GetMapping("/maintenance/day")
+    public CommonResult<Map<String, Object>> getMaintenanceDay() {
+        ImmutableMap<String, LocalDateTime> beginEndDay = DateUtils.getBeginEndDay(1);
+        IotMainWorkOrderPageReqVO iotMainWorkOrderPageReqVO = new IotMainWorkOrderPageReqVO();
+        iotMainWorkOrderPageReqVO.setCreateTime(new LocalDateTime[]{beginEndDay.get("start"), beginEndDay.get("end")});
+        Long inspectDayTotal = iotMainWorkOrderMapper.selectCountByTimeAndStatus(iotMainWorkOrderPageReqVO);
+        iotMainWorkOrderPageReqVO.setStatus(1);
+        Long inspectDayTodo = iotMainWorkOrderMapper.selectCountByTimeAndStatus(iotMainWorkOrderPageReqVO);
+
+        return CommonResult.success(ImmutableMap.of("total", inspectDayTotal,"todo", inspectDayTodo));
+    }
+
+    @GetMapping("/maintenance/week")
+    public CommonResult<Map<String, Object>> getMaintenanceWeek() {
+        IotMainWorkOrderPageReqVO iotMainWorkOrderPageReqVO = new IotMainWorkOrderPageReqVO();
+        ImmutableMap<String, LocalDateTime> beginEndWeek = DateUtils.getBeginEndWeek();
+        iotMainWorkOrderPageReqVO.setCreateTime(new LocalDateTime[]{beginEndWeek.get("start"), beginEndWeek.get("end")});
+        Long inspectWeekTotal = iotMainWorkOrderMapper.selectCountByTimeAndStatus(iotMainWorkOrderPageReqVO);
+        iotMainWorkOrderPageReqVO.setStatus(1);
+        Long inspectWeekTodo = iotMainWorkOrderMapper.selectCountByTimeAndStatus(iotMainWorkOrderPageReqVO);
+
+        return CommonResult.success(ImmutableMap.of("total", inspectWeekTotal,"todo", inspectWeekTodo));
+    }
+
+    @GetMapping("/maintenance/month")
+    public CommonResult<Map<String, Object>> getMaintenanceMonth() {
+        IotMainWorkOrderPageReqVO iotMainWorkOrderPageReqVO = new IotMainWorkOrderPageReqVO();
+        ImmutableMap<String, LocalDateTime> beginEndMonth = DateUtils.getBeginEndMonth();
+        iotMainWorkOrderPageReqVO.setCreateTime(new LocalDateTime[]{beginEndMonth.get("start"), beginEndMonth.get("end")});
+        Long inspectWeekTotal = iotMainWorkOrderMapper.selectCountByTimeAndStatus(iotMainWorkOrderPageReqVO);
+        iotMainWorkOrderPageReqVO.setStatus(1);
+        Long inspectWeekTodo = iotMainWorkOrderMapper.selectCountByTimeAndStatus(iotMainWorkOrderPageReqVO);
+
+        return CommonResult.success(ImmutableMap.of("total", inspectWeekTotal,"todo", inspectWeekTodo));
+    }
+
+    @GetMapping("/maintenance/total")
+    public CommonResult<Map<String, Object>> getMaintenanceTotal() {
+        Long total = iotMainWorkOrderMapper.selectCount();
+        Long todo = iotMainWorkOrderMapper.selectCount("status", "todo");
+
+        return CommonResult.success(ImmutableMap.of("total", total,"todo", todo));
+    }
+
+    @GetMapping("/maintenance/status")
+    public CommonResult<Map<String, Long>> getMaintenanceStatusInfo() {
+        List<IotMainWorkOrderDO> iotMainWorkOrderDOS = iotMainWorkOrderMapper.selectList();
+        Map<Integer, Long> order = iotMainWorkOrderDOS.stream().collect(Collectors.groupingBy(IotMainWorkOrderDO::getResult, Collectors.counting()));
+        Map<String, Long> resultMap = new HashMap<>(order.size());
+        order.forEach((k,v)->{
+            if (k==1) {
+                resultMap.put("todo", v);
+            }else if (k==2) {
+                resultMap.put("finished", v);
+            }
+        });
+        return CommonResult.success(resultMap);
+    }
+
+    @GetMapping("/maintenance/today/status")
+    public CommonResult<Map<String, Long>> getMaintenanceTodayStatusInfo() {
+        ImmutableMap<String, LocalDateTime> beginEndDay = DateUtils.getBeginEndDay(0);
+        IotMainWorkOrderPageReqVO iotMainWorkOrderPageReqVO = new IotMainWorkOrderPageReqVO();
+        iotMainWorkOrderPageReqVO.setCreateTime(new LocalDateTime[]{beginEndDay.get("start"), beginEndDay.get("end")});
+        List<IotMainWorkOrderDO> iotInspectOrderDOS = iotMainWorkOrderMapper.selectListByCreateTime(iotMainWorkOrderPageReqVO);
+        Map<Integer, Long> order = iotInspectOrderDOS.stream().collect(Collectors.groupingBy(IotMainWorkOrderDO::getResult, Collectors.counting()));
+        Map<String, Long> resultMap = new HashMap<>(order.size());
+        order.forEach((k,v)->{
+            if (k==1) {
+                resultMap.put("todo", v);
+            }else if (k==2) {
+                resultMap.put("finished", v);
+            }
+        });
+        return CommonResult.success(resultMap);
+    }
 
 
+    @GetMapping("/maintenance/type")
+    public CommonResult<Map<String, Long>> getMaintenanceType() {
+        List<IotMainWorkOrderDO> iotMainWorkOrderDOS = iotMainWorkOrderMapper.selectList();
+        Map<Integer, Long> order = iotMainWorkOrderDOS.stream().collect(Collectors.groupingBy(IotMainWorkOrderDO::getType, Collectors.counting()));
+        Map<String, Long> resultMap = new HashMap<>(order.size());
+        order.forEach((k,v)->{
+            if (k==1) {
+                resultMap.put("计划生成", v);
+            }else if (k==2) {
+                resultMap.put("临时新建", v);
+            }
+        });
+        return CommonResult.success(resultMap);
     }
     }
 }
 }

+ 12 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/inspect/IotInspectOrderMapper.java

@@ -5,7 +5,9 @@ import java.util.*;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.pms.controller.admin.failure.vo.IotFailureReportPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotInspectOrderPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotInspectOrderPageReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.failure.IotFailureReportDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectOrderDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectOrderDO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 
 
@@ -29,5 +31,14 @@ public interface IotInspectOrderMapper extends BaseMapperX<IotInspectOrderDO> {
                 .likeIfPresent(IotInspectOrderDO::getCharge, reqVO.getCharge())
                 .likeIfPresent(IotInspectOrderDO::getCharge, reqVO.getCharge())
                 .orderByDesc(IotInspectOrderDO::getId));
                 .orderByDesc(IotInspectOrderDO::getId));
     }
     }
-
+    default Long selectCountByTimeAndStatus(IotInspectOrderPageReqVO reqVO) {
+        return selectCount(new LambdaQueryWrapperX<IotInspectOrderDO>()
+                .eqIfPresent(IotInspectOrderDO::getStatus, reqVO.getStatus())
+                .betweenIfPresent(IotInspectOrderDO::getCreateTime, reqVO.getCreateTime()));
+    }
+    default List<IotInspectOrderDO> selectListByCreateTime(IotInspectOrderPageReqVO reqVO) {
+        return selectList(new LambdaQueryWrapperX<IotInspectOrderDO>()
+                .betweenIfPresent(IotInspectOrderDO::getCreateTime, reqVO.getCreateTime())
+                .orderByAsc(IotInspectOrderDO::getCreateTime));
+    }
 }
 }

+ 13 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotmainworkorder/IotMainWorkOrderMapper.java

@@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.pms.dal.mysql.iotmainworkorder;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotInspectOrderPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.iotmainworkorder.vo.IotMainWorkOrderPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.iotmainworkorder.vo.IotMainWorkOrderPageReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectOrderDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotmainworkorder.IotMainWorkOrderDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotmainworkorder.IotMainWorkOrderDO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 
 
@@ -45,4 +47,14 @@ public interface IotMainWorkOrderMapper extends BaseMapperX<IotMainWorkOrderDO>
     default List<IotMainWorkOrderDO> theMaxOne(){
     default List<IotMainWorkOrderDO> theMaxOne(){
         return selectList(new LambdaQueryWrapperX<IotMainWorkOrderDO>().orderByDesc(IotMainWorkOrderDO::getId));
         return selectList(new LambdaQueryWrapperX<IotMainWorkOrderDO>().orderByDesc(IotMainWorkOrderDO::getId));
     }
     }
-}
+    default Long selectCountByTimeAndStatus(IotMainWorkOrderPageReqVO reqVO) {
+        return selectCount(new LambdaQueryWrapperX<IotMainWorkOrderDO>()
+                .eqIfPresent(IotMainWorkOrderDO::getStatus, reqVO.getStatus())
+                .betweenIfPresent(IotMainWorkOrderDO::getCreateTime, reqVO.getCreateTime()));
+    }
+    default List<IotMainWorkOrderDO> selectListByCreateTime(IotMainWorkOrderPageReqVO reqVO) {
+        return selectList(new LambdaQueryWrapperX<IotMainWorkOrderDO>()
+                .betweenIfPresent(IotMainWorkOrderDO::getCreateTime, reqVO.getCreateTime())
+                .orderByAsc(IotMainWorkOrderDO::getCreateTime));
+    }
+}