rev:烘箱对接位查询逻辑
This commit is contained in:
@@ -45,31 +45,41 @@
|
|||||||
IF 输入.flag = "1"
|
IF 输入.flag = "1"
|
||||||
QUERY
|
QUERY
|
||||||
SELECT
|
SELECT
|
||||||
*
|
a.*,
|
||||||
|
b.num
|
||||||
FROM
|
FROM
|
||||||
SCH_BASE_Point
|
sch_base_point a
|
||||||
WHERE
|
INNER JOIN (
|
||||||
is_delete = '0'
|
SELECT
|
||||||
AND is_used = '1'
|
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 <> ""
|
OPTION 输入.reging_id <> ""
|
||||||
region_id = 输入.reging_id
|
po.region_id = 输入.reging_id
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
OPTION 输入.point_location <> ""
|
OPTION 输入.point_location <> ""
|
||||||
point_location = 输入.point_location
|
po.point_location = 输入.point_location
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
OPTION 输入.point_type <> ""
|
OPTION 输入.point_type <> ""
|
||||||
point_type = 输入.point_type
|
po.point_type = 输入.point_type
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
OPTION 输入.point_type = "5"
|
OPTION 输入.point_type = "5"
|
||||||
IFNULL(material_code,'') = ''
|
IFNULL(po.material_code,'') = ''
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
GROUP BY
|
||||||
order by point_code ASC
|
po.point_code
|
||||||
|
) b ON b.point_code = a.point_code
|
||||||
|
ORDER BY num,a.point_code
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|||||||
Reference in New Issue
Block a user