feat (farm): 设备对接,修复部分bug
- 重构设备接口 - 修复部分bug
This commit is contained in:
@@ -36,6 +36,15 @@
|
||||
SUM(CASE WHEN device_state = 1 THEN 1 ELSE 0 END) as totalOnlineDevices,
|
||||
SUM(CASE WHEN device_state != 1 THEN 1 ELSE 0 END) as totalOfflineDevices
|
||||
FROM farm_device_info
|
||||
WHERE tenant_id = #{tenantId} AND deleted = b'0'
|
||||
<where>
|
||||
deleted = b'0'
|
||||
<if test="baseId != null and baseId != ''">
|
||||
AND base_id = #{baseId}
|
||||
</if>
|
||||
<if test="tenantId != null and tenantId != ''">
|
||||
AND tenant_id = #{tenantId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -14,9 +14,9 @@
|
||||
resultType="cn.iocoder.yudao.module.farm.controller.admin.api.vo.FarmingDistributionRespVO">
|
||||
SELECT
|
||||
COUNT(*) as totalCount,
|
||||
SUM(CASE WHEN task_status = 0 THEN 1 ELSE 0 END) as notStart,
|
||||
SUM(CASE WHEN task_status = 1 THEN 1 ELSE 0 END) as executingStatusCount,
|
||||
SUM(CASE WHEN task_status = 2 THEN 1 ELSE 0 END) as completedStatusCount
|
||||
COALESCE(SUM(CASE WHEN task_status = 0 THEN 1 ELSE 0 END),0) as notStart,
|
||||
COALESCE(SUM(CASE WHEN task_status = 1 THEN 1 ELSE 0 END),0) as executingStatusCount,
|
||||
COALESCE(SUM(CASE WHEN task_status = 2 THEN 1 ELSE 0 END),0) as completedStatusCount
|
||||
FROM farm_farming_record
|
||||
<where>
|
||||
del_status = 0
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
from farm_production_plan
|
||||
where tenant_id = #{tenantId}
|
||||
and deleted = 0
|
||||
and plan_status = 2
|
||||
</select>
|
||||
|
||||
<select id="getTotalArea" parameterType="Long" resultType="java.lang.Double">
|
||||
|
||||
Reference in New Issue
Block a user