select work_time,work_hour,site_name,part_no,wo_no,model,DESCRIPTION,pass,pass*CHILD_BOARD_QTY from (
select a.work_time,a.work_hour,a.ws_id,a.wo_key,a.pass,b.SITE_NAME,c.CHILD_BOARD_QTY,c.model,c.DESCRIPTION,d.wo_no,c.part_no
from sfcs_site_statistics a,sh_site_view b,inv_pn c,wip_wo d
where a.WS_ID=b.WS_ID and a.WO_KEY=d.WO_KEY and c.part_no=d.part_no and b.site_name like '%插件%'
and a.work_time between to_date(to_char(sysdate,'yyyy-mm-dd')||' 00:00:00','yyyy-mm-dd hh24:mi:ss')
and to_date(to_char(sysdate,'yyyy-mm-dd')||' 23:59:59','yyyy-mm-dd hh24:mi:ss')
) jj order by work_time
create proc Sel
@sysdate varchar(50)
as
select h.work_time,h.work_hour,h.site_name,h.part_no,h.wo_no,h.model,[DESCRIPTION],h.pass,h.pass*h.CHILD_BOARD_QTY as pass_total
from
(
select a.work_time,a.work_hour,a.ws_id,a.wo_key,a.pass,b.SITE_NAME,c.CHILD_BOARD_QTY,c.model,c.[DESCRIPTION],d.wo_no,c.part_no
from sfcs_site_statistics a
left join sh_site_view b on a.WS_ID=b.WS_ID
left join wip_wo d on a.WO_KEY=d.WO_KEY
left join inv_pn c on c.part_no=d.part_no
where b.site_name like '%插件%'
and a.work_time between (CONVERT(@sysdate,100)+' 00:00:00')and (CONVERT(sysdate,100)+' 23:59:59')
) h
order by work_time