fix (farm): 微服务API
- 数字驾驶舱-统计图-种植计划完成情况
This commit is contained in:
@@ -46,18 +46,22 @@
|
||||
resultType="cn.iocoder.yudao.module.farm.controller.admin.api.vo.YieldComparisonChartRespVO">
|
||||
|
||||
SELECT
|
||||
YEAR(production_end_date) AS date,
|
||||
SUM(predicted_yields) AS predictedYields,
|
||||
SUM(practical_yields) AS practicalYields
|
||||
YEAR(production_start_date) AS date,
|
||||
COALESCE(SUM(predicted_yields), 0) AS predictedYields,
|
||||
COALESCE(SUM(practical_yields), 0) AS practicalYields
|
||||
FROM farm_production_plan
|
||||
<where>
|
||||
plan_status = 3
|
||||
AND deleted = 0
|
||||
AND production_end_date IS NOT NULL
|
||||
AND production_start_date IS NOT NULL
|
||||
<if test="tenantId != null and tenantId != ''">AND tenant_id = #{tenantId}</if>
|
||||
<if test="baseId != null and baseId != ''">AND base_id = #{baseId}</if>
|
||||
<!-- 添加年份范围筛选 -->
|
||||
<if test="yieldDate != null and yieldDate.size() == 2">
|
||||
AND YEAR(production_start_date) BETWEEN #{yieldDate[0]} AND #{yieldDate[1]}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY YEAR(production_end_date)
|
||||
GROUP BY YEAR(production_start_date)
|
||||
ORDER BY date
|
||||
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user