feat (farm): 种植中心-生产计划

- 添加任务概述信息
This commit is contained in:
达富斌
2025-08-25 16:04:08 +08:00
parent aa5a037a58
commit c5c4110ef6
8 changed files with 98 additions and 38 deletions

View File

@@ -15,10 +15,25 @@
where tenant_id = #{tenantId}
and deleted = 0
</select>
<select id="getTotalArea" parameterType="Long" resultType="java.lang.Double">
select sum(total_area)
from farm_production_plan
where tenant_id = #{tenantId}
and deleted = 0
</select>
<select id="getPlanOverview"
parameterType="string"
resultType="cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanPageRespVO$PlanOverview">
SELECT
base_id,
COUNT(*) AS planCount,
SUM(CASE WHEN plan_status = 3 THEN 1 ELSE 0 END) AS planCompletedCount,
SUM(CASE WHEN plan_status = 2 THEN 1 ELSE 0 END) AS planInProgressCount,
SUM(CASE WHEN plan_status = 4 THEN 1 ELSE 0 END) AS planOverdueCount
FROM farm_production_plan
WHERE base_id IS NOT NULL AND deleted = 0 AND base_id = #{baseId}
GROUP BY base_id
</select>
</mapper>