DECLARE
P_PINSTANCE_ID NUMBER;
BEGIN
P_PINSTANCE_ID := 0;
C##AD.TEST1 ( P_PINSTANCE_ID );
COMMIT;
END;
select Z_Shift_ID, ToTime, ToTime + 12/24 FROM Z_Shift
update Z_Shift set ToTime=ToTime-10/24 where Z_Shift_ID=1000002
SELECT r.Z_Resource_ID, r.Value,r.Name,s.Value,s.Name,
TO_NUMBER(TO_CHAR(FromTime,'HH24'),'99') fhh ,TO_NUMBER(TO_CHAR(FromTime,'MI'),'99') fmi,
TO_NUMBER(TO_CHAR(ToTime, 'HH24'),'99') thh ,TO_NUMBER(TO_CHAR(ToTime, 'MI'),'99') tmi
FROM Z_Resource r
INNER JOIN Z_Shift s ON r.Z_Shift_ID=s.Z_Shift_ID
commit
休息時間
換線時間 換線最少 ? pc 才排上去
-- z_resource_deatil
SELECT
pp.Value PPValue,im.Value ItemValue, rd.Qty,
io.Value ItemOperation,op.Value OperationValue, rs.Value ResourceValue,
rd.StartDateChr,rd.CompleteDateChr, sl.StartDateChr,sl.CompleteDateChr
/*rd.Z_Resource_Detail_ID, rs.Name ResourceName, pp.Name PPName, im.Name ItemName, op.Name OperationName, rd.LoadMin, rd.StartNo,rd.CompleteNo, */
FROM Z_Resource_Detail rd
INNER JOIN Z_ItemOperation io ON io.Z_ItemOperation_ID=rd.Z_ItemOperation_ID
INNER JOIN Z_PP pp ON pp.Z_PP_ID=rd.Z_PP_ID
INNER JOIN Z_Item im ON im.Z_Item_ID=rd.Z_Item_ID
INNER JOIN Z_Resource rs ON rs.Z_Resource_ID=rd.Z_Resource_ID
INNER JOIN Z_Operation op ON op.Z_Operation_ID=rd.Z_Operation_ID
LEFT OUTER JOIN Z_Resource_Split sl ON rd.Z_Resource_Detail_ID=sl.Z_Resource_Detail_ID
ORDER BY rd.Z_Resource_Detail_ID,Z_Resource_Split_ID
SELECT * FROM Z_Resource_Split
-- ALTER TABLE Z_Resource_Detail ADD StartDateChr NVARCHAR2(200);
-- ALTER TABLE Z_Resource_Detail ADD CompleteDateChr NVARCHAR2(200);
沒有留言:
張貼留言