rev:烘箱对接位查询逻辑

This commit is contained in:
2023-07-17 17:04:48 +08:00
parent 789bc30195
commit 53b58fa1bd

View File

@@ -45,31 +45,41 @@
IF 输入.flag = "1"
QUERY
SELECT
*
a.*,
b.num
FROM
SCH_BASE_Point
WHERE
is_delete = '0'
AND is_used = '1'
sch_base_point a
INNER JOIN (
SELECT
COUNT( task.task_id ) AS num,
point_code
FROM
SCH_BASE_Point po
LEFT JOIN sch_base_task task ON ( task.point_code1 = po.point_code OR task.point_code2 = po.point_code OR task.point_code3 = po.point_code )
AND task.task_status < '07'
AND task.is_delete = '0'
WHERE
po.is_delete = '0'
AND po.is_used = '1'
OPTION 输入.reging_id <> ""
region_id = 输入.reging_id
po.region_id = 输入.reging_id
ENDOPTION
OPTION 输入.point_location <> ""
point_location = 输入.point_location
po.point_location = 输入.point_location
ENDOPTION
OPTION 输入.point_type <> ""
point_type = 输入.point_type
po.point_type = 输入.point_type
ENDOPTION
OPTION 输入.point_type = "5"
IFNULL(material_code,'') = ''
IFNULL(po.material_code,'') = ''
ENDOPTION
order by point_code ASC
GROUP BY
po.point_code
) b ON b.point_code = a.point_code
ORDER BY num,a.point_code
ENDSELECT
ENDQUERY
ENDIF