SELECT {FIELDS}
FROM PLMWorkScheduleItems A
{JOIN}
WHERE
(A.Id <> 'DUMMY00101')
{ANDWHERE}
{ORDERBY}
| Alias | CLSID objektu | Prefix | Popis |
|---|---|---|---|
| A | MJXXIRESMQ04NBM2FHVR13EJ3G | Položka dílenského plánu | |
| JO | HTI3OTLGNRPO32EEISEPC0XZ0K | JO | Výrobní příkazy |
| JODQ | OFTMKVQH3ZD13ACL03KIU0CLP4 | JODQ | Výrobní příkazy řada |
| JON | INOP4D2NWLNOZABVT2GSHH131G | JON | Výrobní příkazy uzly |
| JOO | MQHKS5K0YQZOLJWWMG50U44U0S | JOO | Výrobní příkazy výstupy |
| JOP | CAQPAYUOXVCL3ACL03KIU0CLP4 | JOP | Výrobní příkazy období |
| JOR | HRKADG42X2H4BJ2RL5KUAUG3PK | JOR | Technologický postup výrobního příkazu |
| P | WEC02QYERNCL35CH000ILPWJF4 | P | Osoba |
| Req | IVJSI1K34CJORFG1QBJOMTSVAG | Req | Požadavky na výrobu |
| ReqDQ | OFTMKVQH3ZD13ACL03KIU0CLP4 | ReqDQ | Požadavky řada |
| ReqN | BAT0KH5TA0Z4F5CFHKEVXBDOVC | ReqN | Požadavky uzly |
| ReqO | TX3FY4NELOB4JEFT5YOFC1XACO | ReqO | Požadavky výstupy |
| ReqP | CAQPAYUOXVCL3ACL03KIU0CLP4 | ReqP | Požadavky období |
| ReqR | RMBJ1K5KJKJOVGZZPKYSUS5N3O | ReqR | Technologický postup požadavku |
| SC | C3V5QDVZ5BDL342M01C0CX3FCC | SC | Skladová karta |
| W | 53FKKCM5GGGOZ3TF2DJ3E40GSK | W | Pracovník |
| WP | 5XGE0QFOGIWOB5ANMTYRIVKJ0O | WP | Pracoviště |
(A.PRIORITY >= {:LOW}) and (A.PRIORITY <= {:HIGH})
A.Worker_ID = {:VALUE}
A.Worker_ID IN ({:LIST})
A.WorkPlace_ID = {:VALUE}
A.WorkPlace_ID IN ({:LIST})
((JO.DocQueue_ID = {:VALUE}) OR (JO.DocQueue_ID IS NULL))
((JO.DocQueue_ID IN ({:LIST})) OR (JO.DocQueue_ID IS NULL))
JO.ID = {:VALUE}
JO.ID IN ({:LIST})
((Req.DocQueue_ID = {:VALUE}) OR (Req.DocQueue_ID IS NULL))
((Req.DocQueue_ID IN ({:LIST})) OR (Req.DocQueue_ID IS NULL))
Req.ID = {:VALUE}
Req.ID IN ({:LIST})
(
coalesce(JON.StoreCard_ID,'asdf') = {:VALUE}
OR
coalesce(ReqN.StoreCard_ID,'asdf') = {:VALUE}
)
(
coalesce(JON.StoreCard_ID,'asdf') IN ({:LIST})
or
coalesce(ReqN.StoreCard_ID,'asdf') IN ({:LIST})
)
A.JORoutine_ID = {:VALUE}
A.JORoutine_ID IN ({:LIST})
A.ReqRoutine_ID = {:VALUE}
A.ReqRoutine_ID IN ({:LIST})
##CASEOR {:VALUE} #
##0#A.Status=0
##1#A.Status=1
##2#A.Status=2
##3#A.Status=3
##4#A.Status=4
##5#A.Status=5
##END#
A.DateFrom$DATE >= {:LOW} and A.DateFrom$DATE < {:HIGH}
##CASEOR {:VALUE} #
##1#not exists (Select ID From PLMOperationWSIs O Where O.WorkScheduleItem_ID = A.ID)
##2#(Select Sum(Quantity) From PLMOperationWSIs O Where O.WorkScheduleItem_ID = A.ID) < PlannedQuantity
##3#(Select Sum(Quantity) From PLMOperationWSIs O Where O.WorkScheduleItem_ID = A.ID) = PlannedQuantity
##4#(Select Sum(Quantity) From PLMOperationWSIs O Where O.WorkScheduleItem_ID = A.ID) > PlannedQuantity
##END#
A.ConfirmedBy_ID = {:VALUE}
A.ConfirmedBy_ID IN ({:LIST})
##CASEOR {:VALUE} #
##1#(A.JORoutine_ID IS NULL) AND Req.DocQueue_ID IS NOT NULL
##2#(A.JORoutine_ID IS NOT NULL) AND JO.DocQueue_ID IS NOT NULL
##END#
((A.JORoutine_ID IS NULL) AND Req.PlanedStartAt$Date >= {:LOW} and Req.PlanedStartAt$Date < {:HIGH})
OR
((A.JORoutine_ID IS NOT NULL) AND JO.PlanedStartAt$Date >= {:LOW} and JO.PlanedStartAt$Date < {:HIGH})
((A.JORoutine_ID IS NULL) AND Req.Schedule$Date >= {:LOW} and Req.Schedule$Date < {:HIGH})
OR
((A.JORoutine_ID IS NOT NULL) AND JO.ScheduledAt$Date >= {:LOW} and JO.ScheduledAt$Date < {:HIGH})
##CASEOR {:VALUE} #
##1#((A.JORoutine_ID IS NULL) AND (Req.Priority = 0)) OR ((A.JORoutine_ID IS NOT NULL) AND (JO.Priority = 0))
##2#((A.JORoutine_ID IS NULL) AND (Req.Priority = 1)) OR ((A.JORoutine_ID IS NOT NULL) AND (JO.Priority = 1))
##3#((A.JORoutine_ID IS NULL) AND (Req.Priority = 2)) OR ((A.JORoutine_ID IS NOT NULL) AND (JO.Priority = 2))
##4#((A.JORoutine_ID IS NULL) AND (Req.Priority = 3)) OR ((A.JORoutine_ID IS NOT NULL) AND (JO.Priority = 3))
##END#
(
(({:VALUE} = 'N') AND (0 = (SELECT COUNT(*) FROM PLMOperationWSIs WHERE WorkScheduleItem_ID = A.ID)))
OR
(({:VALUE} = 'A') AND (0 <> (SELECT COUNT(*) FROM PLMOperationWSIs WHERE WorkScheduleItem_ID = A.ID)))
)
((A.JORoutine_ID IS NULL) AND <<ReqR.Title>> LIKE {:VALUE} ESCAPE '~')
OR
((A.JORoutine_ID IS NOT NULL) AND <<JOR.Title>> LIKE {:VALUE} ESCAPE '~')
((A.JORoutine_ID IS NULL) AND ReqR.Finished = {:VALUE})
OR
((A.JORoutine_ID IS NOT NULL) AND JOR.Finished = {:VALUE})
((A.JORoutine_ID IS NULL) AND Req.Firm_ID = {:VALUE})
OR
((A.JORoutine_ID IS NOT NULL) AND JO.Firm_ID = {:VALUE})
((A.JORoutine_ID IS NULL) AND Req.Firm_ID IN ({:LIST}))
OR
((A.JORoutine_ID IS NOT NULL) AND JO.Firm_ID IN ({:LIST}))
(
(A.JORoutine_ID IS NULL)
AND
(
(Req.Division_ID = (select Bx.ID from Divisions Bx where Bx.ID = {:VALUE} and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(Req.Division_ID in
(select Bx.ID from Divisions Bx where
Bx.ID in (select B2x.ID from SYS$Divisions2 B2x where B2x.Superior_ID = {:VALUE}) and
Bx.Hidden = 'N')))
)
)
OR
(
(A.JORoutine_ID IS NOT NULL)
AND
(
(JO.Division_ID = (select Bx.ID from Divisions Bx where Bx.ID = {:VALUE} and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(JO.Division_ID in
(select Bx.ID from Divisions Bx where
Bx.ID in (select B2x.ID from SYS$Divisions2 B2x where B2x.Superior_ID = {:VALUE}) and
Bx.Hidden = 'N')))
)
)
(
(A.JORoutine_ID IS NULL)
AND
(
(Req.Division_ID in (select Bx.ID from Divisions Bx where Bx.ID in ({:LIST}) and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(Req.Division_ID in
(select Bx.ID from Divisions Bx where
Bx.ID in (select B2x.ID from SYS$Divisions2 B2x where B2x.Superior_ID in ({:LIST})) and
Bx.Hidden = 'N')))
)
)
OR
(
(A.JORoutine_ID IS NOT NULL)
AND
(
(JO.Division_ID in (select Bx.ID from Divisions Bx where Bx.ID in ({:LIST}) and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(JO.Division_ID in
(select Bx.ID from Divisions Bx where
Bx.ID in (select B2x.ID from SYS$Divisions2 B2x where B2x.Superior_ID in ({:LIST})) and
Bx.Hidden = 'N')))
)
)
(
(A.JORoutine_ID IS NULL)
AND
(
(Req.BusOrder_ID = (select Bx.ID from BusOrders Bx where Bx.ID = {:VALUE} and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(Req.BusOrder_ID in
(select Bx.ID from BusOrders Bx where
Bx.ID in (select B2x.ID from SYS$BusOrders2 B2x where B2x.Superior_ID = {:VALUE}) and
Bx.Hidden = 'N')))
)
)
OR
(
(A.JORoutine_ID IS NOT NULL)
AND
(
(JO.BusOrder_ID = (select Bx.ID from BusOrders Bx where Bx.ID = {:VALUE} and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(JO.BusOrder_ID in
(select Bx.ID from BusOrders Bx where
Bx.ID in (select B2x.ID from SYS$BusOrders2 B2x where B2x.Superior_ID = {:VALUE}) and
Bx.Hidden = 'N')))
)
)
(
(A.JORoutine_ID IS NULL)
AND
(
(Req.BusOrder_ID in (select Bx.ID from BusOrders Bx where Bx.ID in ({:LIST}) and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(Req.BusOrder_ID in
(select Bx.ID from BusOrders Bx where
Bx.ID in (select B2x.ID from SYS$BusOrders2 B2x where B2x.Superior_ID in ({:LIST})) and
Bx.Hidden = 'N')))
)
)
OR
(
(A.JORoutine_ID IS NOT NULL)
AND
(
(JO.BusOrder_ID in (select Bx.ID from BusOrders Bx where Bx.ID in ({:LIST}) and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(JO.BusOrder_ID in
(select Bx.ID from BusOrders Bx where
Bx.ID in (select B2x.ID from SYS$BusOrders2 B2x where B2x.Superior_ID in ({:LIST})) and
Bx.Hidden = 'N')))
)
)
(
(A.JORoutine_ID IS NULL)
AND
(
(Req.BusTransaction_ID = (select Bx.ID from BusTransactions Bx where Bx.ID = {:VALUE} and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(Req.BusTransaction_ID in
(select Bx.ID from BusTransactions Bx where
Bx.ID in (select B2x.ID from SYS$BusTransactions2 B2x where B2x.Superior_ID = {:VALUE}) and
Bx.Hidden = 'N')))
)
)
OR
(
(A.JORoutine_ID IS NOT NULL)
AND
(
(JO.BusTransaction_ID = (select Bx.ID from BusTransactions Bx where Bx.ID = {:VALUE} and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(JO.BusTransaction_ID in
(select Bx.ID from BusTransactions Bx where
Bx.ID in (select B2x.ID from SYS$BusTransactions2 B2x where B2x.Superior_ID = {:VALUE}) and
Bx.Hidden = 'N')))
)
)
(
(A.JORoutine_ID IS NULL)
AND
(
(Req.BusTransaction_ID in (select Bx.ID from BusTransactions Bx where Bx.ID in ({:LIST}) and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(Req.BusTransaction_ID in
(select Bx.ID from BusTransactions Bx where
Bx.ID in (select B2x.ID from SYS$BusTransactions2 B2x where B2x.Superior_ID in ({:LIST})) and
Bx.Hidden = 'N')))
)
)
OR
(
(A.JORoutine_ID IS NOT NULL)
AND
(
(JO.BusTransaction_ID in (select Bx.ID from BusTransactions Bx where Bx.ID in ({:LIST}) and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(JO.BusTransaction_ID in
(select Bx.ID from BusTransactions Bx where
Bx.ID in (select B2x.ID from SYS$BusTransactions2 B2x where B2x.Superior_ID in ({:LIST})) and
Bx.Hidden = 'N')))
)
)
(
(A.JORoutine_ID IS NULL)
AND
(
(Req.BusProject_ID = (select Bx.ID from BusProjects Bx where Bx.ID = {:VALUE} and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(Req.BusProject_ID in
(select Bx.ID from BusProjects Bx where
Bx.ID in (select B2x.ID from SYS$BusProjects2 B2x where B2x.Superior_ID = {:VALUE}) and
Bx.Hidden = 'N')))
)
)
OR
(
(A.JORoutine_ID IS NOT NULL)
AND
(
(JO.BusProject_ID = (select Bx.ID from BusProjects Bx where Bx.ID = {:VALUE} and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(JO.BusProject_ID in
(select Bx.ID from BusProjects Bx where
Bx.ID in (select B2x.ID from SYS$BusProjects2 B2x where B2x.Superior_ID = {:VALUE}) and
Bx.Hidden = 'N')))
)
)
(
(A.JORoutine_ID IS NULL)
AND
(
(Req.BusProject_ID in (select Bx.ID from BusProjects Bx where Bx.ID in ({:LIST}) and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(Req.BusProject_ID in
(select Bx.ID from BusProjects Bx where
Bx.ID in (select B2x.ID from SYS$BusProjects2 B2x where B2x.Superior_ID in ({:LIST})) and
Bx.Hidden = 'N')))
)
)
OR
(
(A.JORoutine_ID IS NOT NULL)
AND
(
(JO.BusProject_ID in (select Bx.ID from BusProjects Bx where Bx.ID in ({:LIST}) and Bx.Hidden = 'N'))
or
({WithChildren} = 1 AND
(JO.BusProject_ID in
(select Bx.ID from BusProjects Bx where
Bx.ID in (select B2x.ID from SYS$BusProjects2 B2x where B2x.Superior_ID in ({:LIST})) and
Bx.Hidden = 'N')))
)
)
A.ID IN (
SELECT
Parent_ID
FROM
PLMWorkScheduleItemFixes
GROUP BY
Parent_ID
HAVING
(MAX(EndTime) >= {:LOW}) and (MAX(EndTime) < {:HIGH})
)
(
(({:VALUE} = 'N') AND
NOT(A.ID IN (SELECT CV2.WorkScheduleItem_ID
FROM CRPPlanVariants2 CV2
INNER JOIN CRPPLanVariants CV ON CV2.Parent_ID = CV.ID
WHERE CV.ISMajor = 'A')
)
)
OR
(({:VALUE} = 'A') AND
(A.ID IN (SELECT CV2.WorkScheduleItem_ID
FROM CRPPlanVariants2 CV2
INNER JOIN CRPPLanVariants CV ON CV2.Parent_ID = CV.ID
WHERE CV.ISMajor = 'A')
)
)
)
(A.ID IN (SELECT CV2.WorkScheduleItem_ID
FROM CRPPlanVariants2 CV2
INNER JOIN CRPPLanVariants CV ON CV2.Parent_ID = CV.ID
WHERE CV.ISMajor = 'A'
AND CV2.EndTime$Date > {:LOW}
AND CV2.BeginTime$Date <= {:HIGH}
)
)
(
(({:VALUE} = 'A') AND
NOT (
A.ReqRoutine_ID > ''
AND
(A.JORoutine_ID IS NULL)
AND
EXISTS
(SELECT ID
FROM PLMWorkScheduleItems
WHERE (RequestWSI_ID = A.ID) AND
(ID <> RequestWSI_ID) AND
(JORoutine_id > '') AND
(ReqRoutine_ID IS NULL))
)
)
OR
({:VALUE} = 'N')
)
A.Priority
A.DateFrom$Date
JODQ.Code Collate PXW_CSY {DIR},
JOP.Code Collate PXW_CSY {DIR},
JO.OrdNumber {DIR},
ReqDQ.Code Collate PXW_CSY {DIR},
ReqP.Code Collate PXW_CSY {DIR},
Req.OrdNumber {DIR},
A.PriorityA.PlannedQuantity {DIR}, A.PrioritySC.Name {DIR}, A.PriorityJOR.PosIndex {DIR}, ReqR.PosIndex {DIR}, A.PriorityJOR.Title {DIR}, ReqR.Title {DIR}, A.PriorityA.Status
JO.PlanedstartAt$Date {DIR}, Req.PlanedStartAt$Date {DIR}, A.PriorityJO.ScheduledAt$Date {DIR}, Req.Schedule$Date {DIR}, A.PriorityWP.Code Collate PXW_CSY {DIR}, WP.Name Collate PXW_CSY {DIR}, A.WorkPlace_IDTRIM(LEADING FROM P.LastName) Collate PXW_CSY {DIR},
P.FirstName Collate PXW_CSY {DIR}, P.Title Collate PXW_CSY {DIR}, W.IDCASE WHEN A.JORoutine_ID > ' ' THEN JO.Priority ELSE Req.Priority END
%CRPBeginTime%
%CRPEndTime%
Generated by ABRA Software a.s. 27.10.2021 16:36