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

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