fix (farm): 微服务API

- 数字驾驶舱-统计图-种植计划完成情况
This commit is contained in:
达富斌
2025-09-15 11:16:36 +08:00
parent c374b1fc54
commit d83668994f
2 changed files with 8 additions and 8 deletions

View File

@@ -16,12 +16,12 @@ import lombok.NoArgsConstructor;
public class PlantingPlanCompletionRespVO { public class PlantingPlanCompletionRespVO {
@Schema(description = "未开始数量") @Schema(description = "未开始数量")
private Double notStartedRatio; private Integer notStartedRatio;
@Schema(description = "进行中数量") @Schema(description = "进行中数量")
private Double inProgressRatio; private Integer inProgressRatio;
@Schema(description = "已完成数量") @Schema(description = "已完成数量")
private Double completedRatio; private Integer completedRatio;
@Schema(description = "逾期数量") @Schema(description = "逾期数量")
private Double overdueRatio; private Integer overdueRatio;
} }

View File

@@ -67,10 +67,10 @@
resultType="cn.iocoder.yudao.module.farm.controller.admin.api.vo.PlantingPlanCompletionRespVO"> resultType="cn.iocoder.yudao.module.farm.controller.admin.api.vo.PlantingPlanCompletionRespVO">
SELECT SELECT
ROUND(SUM(CASE WHEN plan_status = 1 THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 2) AS notStartedRatio, SUM(CASE WHEN plan_status = 1 THEN 1 ELSE 0 END) AS notStartedRatio,
ROUND(SUM(CASE WHEN plan_status = 2 THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 2) AS inProgressRatio, SUM(CASE WHEN plan_status = 2 THEN 1 ELSE 0 END) AS inProgressRatio,
ROUND(SUM(CASE WHEN plan_status = 3 THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 2) AS completedRatio, SUM(CASE WHEN plan_status = 3 THEN 1 ELSE 0 END) AS completedRatio,
ROUND(SUM(CASE WHEN plan_status = 4 THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 2) AS overdueRatio SUM(CASE WHEN plan_status = 4 THEN 1 ELSE 0 END) AS overdueRatio
FROM farm_production_plan FROM farm_production_plan
<where> <where>
deleted = 0 deleted = 0