批次回盘优化
This commit is contained in:
@@ -6,20 +6,12 @@
|
||||
</Attributes>
|
||||
<DynSentence name="QryBatLst">
|
||||
<Sentence>
|
||||
select dsk_nam from CAPDSKINF where DSK_NAM in
|
||||
(select dsk_nam from (select A.dsk_nam,B.rank from CAPDSKINF A,CAPCUSINF B
|
||||
where A.dsk_nam in (select dsk_nam from
|
||||
(select dsk_nam,sum(unfinished_num) unfinished_num,sum(finish_num) finish_num
|
||||
from (select dsk_nam,(case when BAT_STS not in ('4','2') then 1 else 0 end)
|
||||
unfinished_num ,(case when BAT_STS in ('4','2') then 1 else 0 end) finish_num
|
||||
from CAPBATINF b where b.dsk_nam in
|
||||
(select DSK_NAM from CAPDSKINF a where a.dsk_sts = '1' and ORD_DT >= ? )) group by dsk_nam) c
|
||||
where c.unfinished_num = 0 and c.finish_num > 0
|
||||
union select DSK_NAM from CAPDSKINF a where a.dsk_sts = '9' and ORD_DT >= ?)
|
||||
AND A.Customer_Id = B.Customer_Id
|
||||
order by rank )
|
||||
where ROWNUM <= '1')
|
||||
FOR UPDATE skip locked
|
||||
select DSK_NAM from capdskinf where DSK_NAM in
|
||||
(select DSK_NAM from capdskinf a where dsk_sts = '1' and ord_dt >= ? and (dsk_nam,0) in
|
||||
(select dsk_nam,sum(case when bat_sts not in ('4', '2') then 1 else 0 end) notfinal from capbatinf
|
||||
where ord_dt = a.ord_dt and dsk_nam = a.DSK_NAM group by dsk_nam having sum(case when bat_sts not in ('4', '2') then 1 else 0 end) = 0)
|
||||
union all select DSK_NAM from CAPDSKINF a where a.dsk_sts = '9' and ORD_DT >= ?)
|
||||
and rownum = 1 for update skip locked
|
||||
</Sentence>
|
||||
<Fields>DT_BEFER|DT_BEFER|</Fields>
|
||||
</DynSentence>
|
||||
|
||||
Reference in New Issue
Block a user