mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 21:52:07 +08:00
1、统计枚举、校验统一使用common模块;2、旧超管统计相关代码移除;
This commit is contained in:
-34
@@ -1,34 +0,0 @@
|
|||||||
package com.cf.imes.framework.common.enums;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生产单统计维度单位
|
|
||||||
* @author Gqr
|
|
||||||
* @since 2024/8/6 10:04
|
|
||||||
*/
|
|
||||||
public enum OrderStatisticsUnit {
|
|
||||||
//季度、月、周、日
|
|
||||||
QUARTER(0),
|
|
||||||
MONTH(1),
|
|
||||||
WEEK(2),
|
|
||||||
DAY(3);
|
|
||||||
|
|
||||||
OrderStatisticsUnit(Integer value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Integer value;
|
|
||||||
|
|
||||||
public Integer getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// from value
|
|
||||||
public static OrderStatisticsUnit fromValue(Integer value) {
|
|
||||||
for (OrderStatisticsUnit unit : OrderStatisticsUnit.values()) {
|
|
||||||
if (unit.getValue().equals(value)) {
|
|
||||||
return unit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+6
-7
@@ -2,7 +2,6 @@ package com.cf.imes.framework.common.util.time;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.cf.imes.framework.common.enums.OrderStatisticsUnit;
|
|
||||||
import com.cf.imes.framework.common.enums.StatisticsUnit;
|
import com.cf.imes.framework.common.enums.StatisticsUnit;
|
||||||
import com.cf.imes.framework.common.pojo.CommonStatisticsReqVO;
|
import com.cf.imes.framework.common.pojo.CommonStatisticsReqVO;
|
||||||
|
|
||||||
@@ -88,9 +87,9 @@ public class StatisticsChangeUtils {
|
|||||||
startDate = ObjectUtil.clone(reqVO.getCreateTime()[1]);
|
startDate = ObjectUtil.clone(reqVO.getCreateTime()[1]);
|
||||||
endDate = ObjectUtil.clone(reqVO.getCreateTime()[0]);
|
endDate = ObjectUtil.clone(reqVO.getCreateTime()[0]);
|
||||||
}
|
}
|
||||||
LocalDate first = startDate;
|
LocalDate first;
|
||||||
LocalDate end = endDate;
|
LocalDate end;
|
||||||
switch (OrderStatisticsUnit.fromValue(unit)) {
|
switch (StatisticsUnit.fromValue(unit)) {
|
||||||
case QUARTER -> {
|
case QUARTER -> {
|
||||||
first = firstDayOfQuarter(startDate);
|
first = firstDayOfQuarter(startDate);
|
||||||
end = lastDayOfQuarter(endDate);
|
end = lastDayOfQuarter(endDate);
|
||||||
@@ -126,7 +125,7 @@ public class StatisticsChangeUtils {
|
|||||||
List<String> dates = new ArrayList<>();
|
List<String> dates = new ArrayList<>();
|
||||||
while (!startDate.isAfter(endDate)) {
|
while (!startDate.isAfter(endDate)) {
|
||||||
String dateStr;
|
String dateStr;
|
||||||
switch (OrderStatisticsUnit.fromValue(unit)) {
|
switch (StatisticsUnit.fromValue(unit)) {
|
||||||
case QUARTER:
|
case QUARTER:
|
||||||
dateStr = startDate.format(DateTimeFormatter.ofPattern("yyyy-Q"));
|
dateStr = startDate.format(DateTimeFormatter.ofPattern("yyyy-Q"));
|
||||||
// 加一季度(3个月)
|
// 加一季度(3个月)
|
||||||
@@ -169,10 +168,10 @@ public class StatisticsChangeUtils {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String generateDateRangeAxis(String date, Integer unit) {
|
public static String generateDateRangeAxis(String date, Integer unit) {
|
||||||
OrderStatisticsUnit orderStatisticsUnit = OrderStatisticsUnit.fromValue(unit);
|
StatisticsUnit statisticsUnit = StatisticsUnit.fromValue(unit);
|
||||||
StringBuilder newDateStrBuffer = new StringBuilder();
|
StringBuilder newDateStrBuffer = new StringBuilder();
|
||||||
String[] dateSplit = date.split("-");
|
String[] dateSplit = date.split("-");
|
||||||
switch (orderStatisticsUnit) {
|
switch (statisticsUnit) {
|
||||||
case QUARTER:
|
case QUARTER:
|
||||||
newDateStrBuffer.append("第").append(dateSplit[1]).append("季度");
|
newDateStrBuffer.append("第").append(dateSplit[1]).append("季度");
|
||||||
break;
|
break;
|
||||||
|
|||||||
-34
@@ -1,34 +0,0 @@
|
|||||||
package com.cf.imes.module.executor.enums;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生产单统计维度单位
|
|
||||||
* @author Gqr
|
|
||||||
* @since 2024/8/6 10:04
|
|
||||||
*/
|
|
||||||
public enum OrderStatisticsUnit {
|
|
||||||
//季度、月、周、日
|
|
||||||
QUARTER(0),
|
|
||||||
MONTH(1),
|
|
||||||
WEEK(2),
|
|
||||||
DAY(3);
|
|
||||||
|
|
||||||
OrderStatisticsUnit(Integer value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Integer value;
|
|
||||||
|
|
||||||
public Integer getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// from value
|
|
||||||
public static OrderStatisticsUnit fromValue(Integer value) {
|
|
||||||
for (OrderStatisticsUnit unit : OrderStatisticsUnit.values()) {
|
|
||||||
if (unit.getValue().equals(value)) {
|
|
||||||
return unit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-41
@@ -1,41 +0,0 @@
|
|||||||
package com.cf.imes.module.executor.controller.admin.order;
|
|
||||||
|
|
||||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
|
||||||
import com.cf.imes.module.executor.service.order.OrderSupStatisticsService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 超管-生产单统计管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/executor/order/supStatistics")
|
|
||||||
@Validated
|
|
||||||
@Slf4j
|
|
||||||
public class OrderSupStatisticsController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private OrderSupStatisticsService orderSupStatisticsService;
|
|
||||||
|
|
||||||
@GetMapping("/total/order")
|
|
||||||
@Operation(summary = "生产单总数")
|
|
||||||
@PreAuthorize("@ss.hasPermission('homePage:analysis:org-statistic')")
|
|
||||||
public CommonResult<Map<String, Integer>> getOrderTotal() {
|
|
||||||
return success(orderSupStatisticsService.orderTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/total/plateArea")
|
|
||||||
@Operation(summary = "拆单板件平方数")
|
|
||||||
public CommonResult<Map<String, Double>> getPlateAreaTotal() {
|
|
||||||
return success(orderSupStatisticsService.plateAreaTotal());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-30
@@ -1,30 +0,0 @@
|
|||||||
package com.cf.imes.module.executor.dal.mysql.order;
|
|
||||||
|
|
||||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderStatisticsIsLapseRespVO;
|
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderStatisticsReqVO;
|
|
||||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface OrderSupStatisticsMapper extends BaseMapperX<OrderDO> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当日生产单板件平方数
|
|
||||||
*/
|
|
||||||
Double selectOrderSquareProduceToday(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生产单按时间统计失效数量
|
|
||||||
*/
|
|
||||||
List<OrderStatisticsIsLapseRespVO> selectOrderCountLapseByOrderDate(@Param("req") OrderStatisticsReqVO reqVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生产单按时间分组统计未失效数量
|
|
||||||
*/
|
|
||||||
List<OrderStatisticsIsLapseRespVO> selectOrderCountNotLapseByOrderDate(@Param("req") OrderStatisticsReqVO reqVO);
|
|
||||||
}
|
|
||||||
+3
-3
@@ -12,6 +12,7 @@ import co.elastic.clients.elasticsearch.core.SearchRequest;
|
|||||||
import co.elastic.clients.elasticsearch.core.SearchResponse;
|
import co.elastic.clients.elasticsearch.core.SearchResponse;
|
||||||
import co.elastic.clients.util.NamedValue;
|
import co.elastic.clients.util.NamedValue;
|
||||||
import com.cf.imes.framework.common.enums.OrderStatusEnum;
|
import com.cf.imes.framework.common.enums.OrderStatusEnum;
|
||||||
|
import com.cf.imes.framework.common.enums.StatisticsUnit;
|
||||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderGoodsPlateRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderGoodsPlateRespVO;
|
||||||
@@ -25,7 +26,6 @@ import com.cf.imes.module.executor.dal.mysql.order.OrderStatisticsMapper;
|
|||||||
import com.cf.imes.module.executor.dal.mysql.plan.PlanMapper;
|
import com.cf.imes.module.executor.dal.mysql.plan.PlanMapper;
|
||||||
import com.cf.imes.module.executor.dal.mysql.plate.OrderPlateStatisticsMapper;
|
import com.cf.imes.module.executor.dal.mysql.plate.OrderPlateStatisticsMapper;
|
||||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateGoodMapper;
|
import com.cf.imes.module.executor.dal.mysql.plate.PlateGoodMapper;
|
||||||
import com.cf.imes.module.executor.enums.OrderStatisticsUnit;
|
|
||||||
import com.cf.imes.module.system.api.dict.DictDataApi;
|
import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||||
import com.cf.imes.module.system.api.dict.dto.DictDataRespDTO;
|
import com.cf.imes.module.system.api.dict.dto.DictDataRespDTO;
|
||||||
import com.cf.imes.module.system.enums.DictTypeConstants;
|
import com.cf.imes.module.system.enums.DictTypeConstants;
|
||||||
@@ -593,7 +593,7 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private DateHistogramAggregation.Builder getDateHistogram(Integer unit, DateHistogramAggregation.Builder builder) {
|
private DateHistogramAggregation.Builder getDateHistogram(Integer unit, DateHistogramAggregation.Builder builder) {
|
||||||
switch (OrderStatisticsUnit.fromValue(unit)) {
|
switch (StatisticsUnit.fromValue(unit)) {
|
||||||
case QUARTER:
|
case QUARTER:
|
||||||
return builder.calendarInterval(CalendarInterval.Quarter).format("yyyy-Q");
|
return builder.calendarInterval(CalendarInterval.Quarter).format("yyyy-Q");
|
||||||
case MONTH:
|
case MONTH:
|
||||||
@@ -612,7 +612,7 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private String dateToWeekMonth(String dateStr, Integer unit) {
|
private String dateToWeekMonth(String dateStr, Integer unit) {
|
||||||
if (OrderStatisticsUnit.WEEK.getValue().equals(unit)) {
|
if (StatisticsUnit.WEEK.getValue().equals(unit)) {
|
||||||
LocalDate date = LocalDate.parse(dateStr, DateTimeFormatter.ofPattern(DATE_TIME_FORMATTER_PATTERN_YEAR_MONTH_DAY));
|
LocalDate date = LocalDate.parse(dateStr, DateTimeFormatter.ofPattern(DATE_TIME_FORMATTER_PATTERN_YEAR_MONTH_DAY));
|
||||||
// 年月
|
// 年月
|
||||||
String outDateStr = date.format(DateTimeFormatter.ofPattern(DATE_TIME_FORMATTER_PATTERN_YEAR_MONTH));
|
String outDateStr = date.format(DateTimeFormatter.ofPattern(DATE_TIME_FORMATTER_PATTERN_YEAR_MONTH));
|
||||||
|
|||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
package com.cf.imes.module.executor.service.order;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生产单统计 —— 超管
|
|
||||||
*/
|
|
||||||
public interface OrderSupStatisticsService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生产单总数统计
|
|
||||||
*/
|
|
||||||
Map<String, Integer> orderTotal();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拆单板件平方数统计
|
|
||||||
*/
|
|
||||||
Map<String, Double> plateAreaTotal();
|
|
||||||
}
|
|
||||||
-56
@@ -1,56 +0,0 @@
|
|||||||
package com.cf.imes.module.executor.service.order;
|
|
||||||
|
|
||||||
import com.cf.imes.framework.organ.core.aop.OrganIgnore;
|
|
||||||
import com.cf.imes.module.executor.dal.mysql.order.OrderStatisticsMapper;
|
|
||||||
import com.cf.imes.module.executor.dal.mysql.order.OrderSupStatisticsMapper;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalTime;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@Validated
|
|
||||||
public class OrderSupStatisticsServiceImpl implements OrderSupStatisticsService{
|
|
||||||
@Resource
|
|
||||||
private OrderStatisticsMapper orderStatisticsMapper;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private OrderSupStatisticsMapper orderSupStatisticsMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@OrganIgnore
|
|
||||||
public Map<String, Integer> orderTotal() {
|
|
||||||
Map<String, Integer> resultMap = new LinkedHashMap<>();
|
|
||||||
// 生产单总数
|
|
||||||
Integer total = orderStatisticsMapper.selectOrderCount();
|
|
||||||
resultMap.put("total", total);
|
|
||||||
|
|
||||||
// 日增长量
|
|
||||||
Integer today = orderStatisticsMapper.selectOrderCountToday();
|
|
||||||
resultMap.put("today", today);
|
|
||||||
return resultMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Double> plateAreaTotal() {
|
|
||||||
Map<String, Double> resultMap = new LinkedHashMap<>();
|
|
||||||
|
|
||||||
// 生产单板件平方数
|
|
||||||
Double total = orderStatisticsMapper.selectOrderSquareProduce();
|
|
||||||
resultMap.put("total", total);
|
|
||||||
|
|
||||||
// 当日生产单板件平方数
|
|
||||||
LocalDate date = LocalDate.now();
|
|
||||||
LocalDateTime startTime = LocalDateTime.of(date, LocalTime.MIDNIGHT);
|
|
||||||
LocalDateTime endTime = LocalDateTime.of(date, LocalTime.MAX);
|
|
||||||
Double today = orderSupStatisticsMapper.selectOrderSquareProduceToday(startTime, endTime);
|
|
||||||
resultMap.put("today", today);
|
|
||||||
|
|
||||||
return resultMap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-36
@@ -1,36 +0,0 @@
|
|||||||
package com.cf.imes.module.executor.validation.order;
|
|
||||||
|
|
||||||
import jakarta.validation.Constraint;
|
|
||||||
import jakarta.validation.Payload;
|
|
||||||
import java.lang.annotation.Documented;
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生产单统计维度单位入参校验注解
|
|
||||||
*
|
|
||||||
* @author Gqr
|
|
||||||
* @since 2024/7/17 9:33
|
|
||||||
*/
|
|
||||||
@Target({
|
|
||||||
ElementType.METHOD,
|
|
||||||
ElementType.FIELD,
|
|
||||||
ElementType.ANNOTATION_TYPE,
|
|
||||||
ElementType.CONSTRUCTOR,
|
|
||||||
ElementType.PARAMETER,
|
|
||||||
ElementType.TYPE_USE
|
|
||||||
})
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Documented
|
|
||||||
@Constraint(
|
|
||||||
validatedBy = {OrderStatisticsUnitInEnumValidator.class}
|
|
||||||
)
|
|
||||||
public @interface OrderStatisticsUnitInEnum {
|
|
||||||
String message() default "生产单统计维度单位[unit]错误,请检查";
|
|
||||||
|
|
||||||
Class<?>[] groups() default {};
|
|
||||||
|
|
||||||
Class<? extends Payload>[] payload() default {};
|
|
||||||
}
|
|
||||||
-36
@@ -1,36 +0,0 @@
|
|||||||
package com.cf.imes.module.executor.validation.order;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.cf.imes.module.executor.enums.OrderStatisticsUnit;
|
|
||||||
|
|
||||||
import jakarta.validation.ConstraintValidator;
|
|
||||||
import jakarta.validation.ConstraintValidatorContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生产单统计维度单位入参校验器
|
|
||||||
*
|
|
||||||
* @author Gqr
|
|
||||||
* @since 2024/7/17 9:33
|
|
||||||
*/
|
|
||||||
public class OrderStatisticsUnitInEnumValidator implements ConstraintValidator<OrderStatisticsUnitInEnum, Integer> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize(OrderStatisticsUnitInEnum constraintAnnotation) {
|
|
||||||
ConstraintValidator.super.initialize(constraintAnnotation);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isValid(Integer value, ConstraintValidatorContext context) {
|
|
||||||
if (ObjectUtil.isNull(value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
OrderStatisticsUnit unit = OrderStatisticsUnit.fromValue(value);
|
|
||||||
if (ObjectUtil.isNotNull(unit)) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
+4
-4
@@ -8,16 +8,16 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<sql id="dateFormat">
|
<sql id="dateFormat">
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', QUARTER(o.order_date)) as date
|
,CONCAT(YEAR(o.order_date), '-', QUARTER(o.order_date)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@MONTH.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date)) as date
|
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', WEEK(o.order_date, 1)) AS date
|
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', WEEK(o.order_date, 1)) AS date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', DAY(o.order_date)) as date
|
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', DAY(o.order_date)) as date
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|||||||
-47
@@ -1,47 +0,0 @@
|
|||||||
<?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.cf.imes.module.executor.dal.mysql.order.OrderSupStatisticsMapper">
|
|
||||||
|
|
||||||
<sql id="dateFormat">
|
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
|
||||||
,CONCAT(YEAR(o.order_date), '-', QUARTER(o.order_date)) as date
|
|
||||||
</if>
|
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@MONTH.getValue()">
|
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date)) as date
|
|
||||||
</if>
|
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@WEEK.getValue()">
|
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', FLOOR((DayOfMonth(o.order_date)-1)/7)+1) AS date
|
|
||||||
</if>
|
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@DAY.getValue()">
|
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', DAY(o.order_date)) as date
|
|
||||||
</if>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="selectOrderSquareProduceToday" resultType="java.lang.Double">
|
|
||||||
SELECT SUM(op.area) as area
|
|
||||||
FROM orders o
|
|
||||||
LEFT JOIN order_plate op on op.order_id = o.id
|
|
||||||
WHERE o.deleted = 0 AND o.create_time BETWEEN #{startTime} AND #{endTime}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectOrderCountLapseByOrderDate"
|
|
||||||
resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderStatisticsIsLapseRespVO">
|
|
||||||
select count(o.id) as orderCount
|
|
||||||
<include refid="dateFormat"/>
|
|
||||||
from orders o
|
|
||||||
where o.order_date between #{req.createTime[0]} and #{req.createTime[1]}
|
|
||||||
and (o.deleted = 1 or o.status = 0)
|
|
||||||
group by date;
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectOrderCountNotLapseByOrderDate"
|
|
||||||
resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderStatisticsIsLapseRespVO">
|
|
||||||
select count(o.id) as orderCount
|
|
||||||
<include refid="dateFormat"/>
|
|
||||||
from orders o
|
|
||||||
where o.order_date between #{req.createTime[0]} and #{req.createTime[1]}
|
|
||||||
and o.deleted = 0 and o.status != 0
|
|
||||||
group by date;
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
+8
-8
@@ -45,16 +45,16 @@
|
|||||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderPlanStatisticsCountRespVO">
|
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderPlanStatisticsCountRespVO">
|
||||||
select
|
select
|
||||||
count(p.id) as count
|
count(p.id) as count
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(p.create_time), '-', QUARTER(p.create_time)) as date
|
,CONCAT(YEAR(p.create_time), '-', QUARTER(p.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@MONTH.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
|
||||||
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time)) as date
|
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time), '-', FLOOR((DayOfMonth(p.create_time)-1)/7)+1) AS date
|
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time), '-', FLOOR((DayOfMonth(p.create_time)-1)/7)+1) AS date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time), '-', DAY(p.create_time)) as date
|
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time), '-', DAY(p.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
from order_plan p
|
from order_plan p
|
||||||
@@ -66,16 +66,16 @@
|
|||||||
<select id="selectPlanAreaGroupByCreateTime"
|
<select id="selectPlanAreaGroupByCreateTime"
|
||||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderPlanStatisticsAreaRespVO">
|
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderPlanStatisticsAreaRespVO">
|
||||||
select sum(op.area) areaSum
|
select sum(op.area) areaSum
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(p.create_time), '-', QUARTER(p.create_time)) as date
|
,CONCAT(YEAR(p.create_time), '-', QUARTER(p.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@MONTH.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
|
||||||
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time)) as date
|
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time), '-', FLOOR((DayOfMonth(p.create_time)-1)/7)+1) AS date
|
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time), '-', FLOOR((DayOfMonth(p.create_time)-1)/7)+1) AS date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time), '-', DAY(p.create_time)) as date
|
,CONCAT(YEAR(p.create_time), '-', MONTH(p.create_time), '-', DAY(p.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
from order_plan p
|
from order_plan p
|
||||||
|
|||||||
+8
-8
@@ -26,16 +26,16 @@
|
|||||||
MIN(g.thickness) AS thickness,
|
MIN(g.thickness) AS thickness,
|
||||||
MIN(g.width) AS width,
|
MIN(g.width) AS width,
|
||||||
COUNT(a.id) AS orderCount
|
COUNT(a.id) AS orderCount
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', QUARTER(o.order_date)) as orderDate
|
,CONCAT(YEAR(o.order_date), '-', QUARTER(o.order_date)) as orderDate
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@MONTH.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date)) as orderDate
|
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date)) as orderDate
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', FLOOR((DayOfMonth(o.order_date)-1)/7)+1) AS orderDate
|
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', FLOOR((DayOfMonth(o.order_date)-1)/7)+1) AS orderDate
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', DAY(o.order_date)) as orderDate
|
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', DAY(o.order_date)) as orderDate
|
||||||
</if>
|
</if>
|
||||||
FROM order_goods g
|
FROM order_goods g
|
||||||
@@ -77,16 +77,16 @@
|
|||||||
MIN(g.thickness) AS thickness,
|
MIN(g.thickness) AS thickness,
|
||||||
MIN(g.width) AS width,
|
MIN(g.width) AS width,
|
||||||
SUM(a.area) AS orderArea
|
SUM(a.area) AS orderArea
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', QUARTER(o.order_date)) as orderDate
|
,CONCAT(YEAR(o.order_date), '-', QUARTER(o.order_date)) as orderDate
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@MONTH.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date)) as orderDate
|
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date)) as orderDate
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', FLOOR((DayOfMonth(o.order_date)-1)/7)+1) AS orderDate
|
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', FLOOR((DayOfMonth(o.order_date)-1)/7)+1) AS orderDate
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', DAY(o.order_date)) as orderDate
|
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', DAY(o.order_date)) as orderDate
|
||||||
</if>
|
</if>
|
||||||
FROM order_goods g
|
FROM order_goods g
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package com.cf.imes.module.system.api.organ.dto;
|
package com.cf.imes.module.system.api.organ.dto;
|
||||||
|
|
||||||
import com.cf.imes.module.system.validation.org.OrgStatisticsUnitInEnum;
|
import com.cf.imes.framework.common.util.validation.statistics.StatisticsUnitInEnum;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -26,6 +26,6 @@ public class OrgStatisticsReqDTO {
|
|||||||
*/
|
*/
|
||||||
@Schema(description = "统计维度单位", example = "0", allowableValues = {"0", "1", "2", "3"}, type = "integer")
|
@Schema(description = "统计维度单位", example = "0", allowableValues = {"0", "1", "2", "3"}, type = "integer")
|
||||||
@NotNull(message = "统计维度单位不能为空")
|
@NotNull(message = "统计维度单位不能为空")
|
||||||
@OrgStatisticsUnitInEnum
|
@StatisticsUnitInEnum
|
||||||
private Integer unit;
|
private Integer unit;
|
||||||
}
|
}
|
||||||
-35
@@ -1,35 +0,0 @@
|
|||||||
package com.cf.imes.module.system.validation.org;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @projectName: cf_imes_server
|
|
||||||
* @author: 晨丰科技
|
|
||||||
* @date: 2024/8/19 9:56
|
|
||||||
*/
|
|
||||||
|
|
||||||
import jakarta.validation.Constraint;
|
|
||||||
import jakarta.validation.Payload;
|
|
||||||
import java.lang.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生产单统计维度单位入参校验注解
|
|
||||||
*/
|
|
||||||
@Target({
|
|
||||||
ElementType.METHOD,
|
|
||||||
ElementType.FIELD,
|
|
||||||
ElementType.ANNOTATION_TYPE,
|
|
||||||
ElementType.CONSTRUCTOR,
|
|
||||||
ElementType.PARAMETER,
|
|
||||||
ElementType.TYPE_USE
|
|
||||||
})
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Documented
|
|
||||||
@Constraint(
|
|
||||||
validatedBy = {OrgStatisticsUnitInEnumValidator.class}
|
|
||||||
)
|
|
||||||
public @interface OrgStatisticsUnitInEnum {
|
|
||||||
String message() default "生产单统计维度单位[unit]错误,请检查";
|
|
||||||
|
|
||||||
Class<?>[] groups() default {};
|
|
||||||
|
|
||||||
Class<? extends Payload>[] payload() default {};
|
|
||||||
}
|
|
||||||
-32
@@ -1,32 +0,0 @@
|
|||||||
package com.cf.imes.module.system.validation.org;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.cf.imes.framework.common.enums.OrderStatisticsUnit;
|
|
||||||
|
|
||||||
import jakarta.validation.ConstraintValidator;
|
|
||||||
import jakarta.validation.ConstraintValidatorContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生产单统计维度单位入参校验器
|
|
||||||
*/
|
|
||||||
public class OrgStatisticsUnitInEnumValidator implements ConstraintValidator<OrgStatisticsUnitInEnum, Integer> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize(OrgStatisticsUnitInEnum constraintAnnotation) {
|
|
||||||
ConstraintValidator.super.initialize(constraintAnnotation);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isValid(Integer value, ConstraintValidatorContext context) {
|
|
||||||
if (ObjectUtil.isNull(value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
OrderStatisticsUnit unit = OrderStatisticsUnit.fromValue(value);
|
|
||||||
if (ObjectUtil.isNotNull(unit)) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-2
@@ -1,7 +1,6 @@
|
|||||||
package com.cf.imes.module.system.service.funds.organamount;
|
package com.cf.imes.module.system.service.funds.organamount;
|
||||||
|
|
||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@@ -10,7 +9,6 @@ import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
|||||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||||
import com.cf.imes.framework.mybatis.core.query.LambdaUpdateWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.LambdaUpdateWrapperX;
|
||||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import com.cf.imes.module.executor.enums.OrderStatisticsUnit;
|
|
||||||
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.ManageAmountOverviewRespVO;
|
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.ManageAmountOverviewRespVO;
|
||||||
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountGroupByCreateTimeRespVO;
|
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountGroupByCreateTimeRespVO;
|
||||||
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountRespVO;
|
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountRespVO;
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
package com.cf.imes.module.system.validation.pay;
|
package com.cf.imes.module.system.validation.pay;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.cf.imes.module.executor.enums.OrderStatisticsUnit;
|
import com.cf.imes.framework.common.enums.StatisticsUnit;
|
||||||
import jakarta.validation.ConstraintValidator;
|
import jakarta.validation.ConstraintValidator;
|
||||||
import jakarta.validation.ConstraintValidatorContext;
|
import jakarta.validation.ConstraintValidatorContext;
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ public class FundsStatisticsUnitInEnumValidator implements ConstraintValidator<F
|
|||||||
if (ObjectUtil.isNull(value)) {
|
if (ObjectUtil.isNull(value)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
OrderStatisticsUnit unit = OrderStatisticsUnit.fromValue(value);
|
StatisticsUnit unit = StatisticsUnit.fromValue(value);
|
||||||
if (ObjectUtil.isNotNull(unit)) {
|
if (ObjectUtil.isNotNull(unit)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+4
-4
@@ -2,16 +2,16 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.cf.imes.module.system.dal.mysql.funds.organamount.OrganAmountMapper">
|
<mapper namespace="com.cf.imes.module.system.dal.mysql.funds.organamount.OrganAmountMapper">
|
||||||
<sql id="dateFormat">
|
<sql id="dateFormat">
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(create_time), '-', QUARTER(create_time)) as date
|
,CONCAT(YEAR(create_time), '-', QUARTER(create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@MONTH.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
|
||||||
,CONCAT(YEAR(create_time), '-', MONTH(create_time)) as date
|
,CONCAT(YEAR(create_time), '-', MONTH(create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(create_time), '-', MONTH(create_time), '-', WEEK(create_time, 1)) AS date
|
,CONCAT(YEAR(create_time), '-', MONTH(create_time), '-', WEEK(create_time, 1)) AS date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(create_time), '-', MONTH(create_time), '-', DAY(create_time)) as date
|
,CONCAT(YEAR(create_time), '-', MONTH(create_time), '-', DAY(create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|||||||
+4
-4
@@ -28,17 +28,17 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<sql id="dateCreate">
|
<sql id="dateCreate">
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(o.notify_time), '-', QUARTER(o.notify_time)) as date
|
,CONCAT(YEAR(o.notify_time), '-', QUARTER(o.notify_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@MONTH.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
|
||||||
,CONCAT(YEAR(o.notify_time), '-', MONTH(o.notify_time)) as date
|
,CONCAT(YEAR(o.notify_time), '-', MONTH(o.notify_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(o.notify_time), '-', MONTH(o.notify_time), '-', FLOOR((DayOfMonth(o.notify_time)-1)/7)+1) AS
|
,CONCAT(YEAR(o.notify_time), '-', MONTH(o.notify_time), '-', FLOOR((DayOfMonth(o.notify_time)-1)/7)+1) AS
|
||||||
date
|
date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(o.notify_time), '-', MONTH(o.notify_time), '-', DAY(o.notify_time)) as date
|
,CONCAT(YEAR(o.notify_time), '-', MONTH(o.notify_time), '-', DAY(o.notify_time)) as date
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|||||||
+4
-4
@@ -78,17 +78,17 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<sql id="dateCreate">
|
<sql id="dateCreate">
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(o.create_time), '-', QUARTER(o.create_time)) as date
|
,CONCAT(YEAR(o.create_time), '-', QUARTER(o.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@MONTH.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
|
||||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time)) as date
|
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', FLOOR((DayOfMonth(o.create_time)-1)/7)+1) AS
|
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', FLOOR((DayOfMonth(o.create_time)-1)/7)+1) AS
|
||||||
date
|
date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', DAY(o.create_time)) as date
|
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', DAY(o.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|||||||
+8
-8
@@ -24,16 +24,16 @@
|
|||||||
|
|
||||||
|
|
||||||
<sql id="dateFormat">
|
<sql id="dateFormat">
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(o.update_time), '-', QUARTER(o.update_time)) as date
|
,CONCAT(YEAR(o.update_time), '-', QUARTER(o.update_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@MONTH.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
|
||||||
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time)) as date
|
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time), '-', FLOOR((DayOfMonth(o.update_time)-1)/7)+1) AS date
|
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time), '-', FLOOR((DayOfMonth(o.update_time)-1)/7)+1) AS date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time), '-', DAY(o.update_time)) as date
|
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time), '-', DAY(o.update_time)) as date
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
@@ -49,16 +49,16 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<sql id="dateCreate">
|
<sql id="dateCreate">
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(o.create_time), '-', QUARTER(o.create_time)) as date
|
,CONCAT(YEAR(o.create_time), '-', QUARTER(o.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@MONTH.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
|
||||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time)) as date
|
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', FLOOR((DayOfMonth(o.create_time)-1)/7)+1) AS date
|
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', FLOOR((DayOfMonth(o.create_time)-1)/7)+1) AS date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', DAY(o.create_time)) as date
|
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', DAY(o.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|||||||
+8
-8
@@ -55,32 +55,32 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<sql id="dateUpdate">
|
<sql id="dateUpdate">
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(o.update_time), '-', QUARTER(o.update_time)) as date
|
,CONCAT(YEAR(o.update_time), '-', QUARTER(o.update_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@MONTH.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
|
||||||
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time)) as date
|
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time), '-', FLOOR((DayOfMonth(o.update_time)-1)/7)+1) AS date
|
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time), '-', FLOOR((DayOfMonth(o.update_time)-1)/7)+1) AS date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time), '-', DAY(o.update_time)) as date
|
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time), '-', DAY(o.update_time)) as date
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="dateCreate">
|
<sql id="dateCreate">
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
|
||||||
,CONCAT(YEAR(o.create_time), '-', QUARTER(o.create_time)) as date
|
,CONCAT(YEAR(o.create_time), '-', QUARTER(o.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@MONTH.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
|
||||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time)) as date
|
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@WEEK.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
|
||||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', FLOOR((DayOfMonth(o.create_time)-1)/7)+1) AS
|
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', FLOOR((DayOfMonth(o.create_time)-1)/7)+1) AS
|
||||||
date
|
date
|
||||||
</if>
|
</if>
|
||||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@DAY.getValue()">
|
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
|
||||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', DAY(o.create_time)) as date
|
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', DAY(o.create_time)) as date
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|||||||
Reference in New Issue
Block a user