|
|
|
@ -1295,10 +1295,10 @@ ORDER BY 销售车号,物料编码,报工人 |
|
|
|
group by tso.socode |
|
|
|
) tmo |
|
|
|
left join ( |
|
|
|
select tso.socode ,count(*) as wipnum,min(wip.EndTime) EndTime from |
|
|
|
select tso.socode ,count(*) as wipnum,max(wip.EndTime) EndTime from |
|
|
|
icsso tso |
|
|
|
left join (select mocode,molotcode from icsmo group by mocode,molotcode) tmo on tso.socode = tmo.molotcode |
|
|
|
LEFT JOIN ICSLOTSIMULATION wip on tmo.mocode = wip.mocode |
|
|
|
left join (select mocode,molotcode,moseq from icsmo group by mocode,molotcode,moseq) tmo on tso.socode = tmo.molotcode |
|
|
|
LEFT JOIN ICSLOTSIMULATION wip on tmo.mocode = wip.mocode and tmo.moseq = wip.moseq |
|
|
|
where wip.iscom='1' |
|
|
|
group by tso.socode |
|
|
|
) wip on tmo.socode = wip.socode |
|
|
|
|