生产中心加入租户查询

This commit is contained in:
顾君禹
2025-09-07 15:58:34 +08:00
parent af3929c091
commit 4ff469c4e0
7 changed files with 63 additions and 37 deletions

View File

@@ -24,19 +24,20 @@
</select>
<select id="getPlanOverview"
parameterType="string"
parameterType="String"
resultType="cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanRespVO$PlanOverview">
SELECT
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
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>
deleted = 0
<if test="baseId != null and baseId != ''">
AND base_id = #{baseId}
</if>
and tenant_id = #{tenantId}
</where>
</select>