调整结构
This commit is contained in:
parent
e82b0f06d6
commit
06bbebc458
|
@ -0,0 +1,15 @@
|
|||
SELECT AREA 车间,
|
||||
AREA1 片区,
|
||||
eqpid 炉台号,
|
||||
mesmoname MES炉次号,
|
||||
eqpmodel 炉型,
|
||||
eqpstatus 炉台状态,
|
||||
crusize 热场尺寸,
|
||||
subprod 产品规格,
|
||||
firststovetime 初投时间,
|
||||
lastreporttime 上次报料时间,
|
||||
laststovetime 上次投炉时间,
|
||||
lastopentime 上次开副室时间,
|
||||
mfgdate 归档日期
|
||||
FROM reportdata.eqponstovestatus
|
||||
WHERE mfgdate = DATE_FORMAT(NOW()-8.5/24,'%Y-%m-%d')
|
|
@ -0,0 +1,23 @@
|
|||
select
|
||||
mfgdate 计产日期,
|
||||
crystalbarno 晶编,
|
||||
eqpid 炉台号,
|
||||
subprod 产品规格,
|
||||
area 车间,
|
||||
area1 片区,
|
||||
qclength QC长度,
|
||||
qcweight 有效重量,
|
||||
qctime QC检验时间,
|
||||
adjustcrucible 坩埚厂商,
|
||||
adjustcruciblecode 坩埚编码,
|
||||
crusize 热场尺寸,
|
||||
timeinterval 运行时间,
|
||||
erpmoname ERP工单号,
|
||||
moprodname 工单物料编码,
|
||||
moproddesc 工单物料描述
|
||||
from
|
||||
reportdata.siteonlinecrucibleyield s
|
||||
where 1=1
|
||||
and qctime >= concat(date_format(now()-8.5/24,'%Y-%m-') ,'01 08:30:00')
|
||||
and qctime < concat(date_format(now()-8.5/24,'%Y-%m-%d') ,' 08:30:00')
|
||||
order by qctime
|
|
@ -0,0 +1,34 @@
|
|||
SELECT DISTINCT
|
||||
eq.area 车间,
|
||||
eq.area1 片区,
|
||||
eq.eqpid 炉台号,
|
||||
case when mo.mesmoname is null then m.mesmoname else mo.mesmoname end MES炉次号 ,
|
||||
case when mo.mesmoname is null then '' else mo.erpmoname end ERP工单号 ,
|
||||
case when mo.mesmoname is null then m.prodname else mo.prodname end 物料编码,
|
||||
case when mo.mesmoname is null then m.proddesc else mo.proddesc end 物料描述,
|
||||
case when mo.mesmoname is null then m.crusize else mo.crusize end 热场尺寸,
|
||||
case when mo.mesmoname is null then m.plantime else mo.stovetime end 初投时间,
|
||||
case when mo.mesmoname is null then '' else mo.crucible end 坩埚厂商,
|
||||
case when mo.mesmoname is null then m.subprod else mo.subprod end 产品规格,
|
||||
case when mo.mesmoname is null then '未投炉' else mo.mostatusdesc end 工单状态,
|
||||
case when mo.mesmoname is null then '' else mo.rx end 棒次,
|
||||
case when mo.mesmoname is null then
|
||||
(case when LOCATE('自产',m.proddesc) >0 then mid(m.proddesc,LOCATE('自产',m.proddesc)+10,15)
|
||||
when LOCATE('代工',m.proddesc) >0 then mid(m.proddesc,LOCATE('代工',m.proddesc)+10,15) end)
|
||||
else
|
||||
(case when LOCATE('自产',mo.proddesc) >0 then mid(mo.proddesc,LOCATE('自产',mo.proddesc)+10,15)
|
||||
when LOCATE('代工',mo.proddesc) >0 then mid(mo.proddesc,LOCATE('代工',mo.proddesc)+10,15) end)
|
||||
end remark
|
||||
from reportdata.equipment eq
|
||||
##处理产品规格
|
||||
LEFT JOIN (SELECT * from reportdata.mostatus where mostatus = 0) mo on (eq.eqpid = mo.eqpid)
|
||||
LEFT JOIN (
|
||||
SELECT order_no mesmoname,stove_no eqpid,thermal_field crusize,material_code prodname,material_name proddesc,schedule_time plantime,
|
||||
case when LOCATE('自产',material_name) >0 then mid(material_name,LOCATE('自产',material_name)+3,6)
|
||||
when LOCATE('代工',material_name) >0 then mid(material_name,LOCATE('代工',material_name)+3,6) end subprod
|
||||
from mes_sync.mes_crystal_order
|
||||
where 1=1
|
||||
and `status` = '1'
|
||||
and finish_flag = '0'
|
||||
) m on (eq.eqpid = m.eqpid)
|
||||
order by eq.eqpid;
|
|
@ -1,24 +0,0 @@
|
|||
select
|
||||
mfgdate 计产日期,
|
||||
crystalbarno 晶编,
|
||||
eqpid 炉台号,
|
||||
subprod 产品规格,
|
||||
area 车间,
|
||||
area1 片区,
|
||||
qclength QC长度,
|
||||
qcweight 有效重量,
|
||||
qctime QC检验时间,
|
||||
adjustcrucible 坩埚厂商,
|
||||
adjustcruciblecode 坩埚编码,
|
||||
crusize 热场尺寸,
|
||||
timeinterval 运行时间,
|
||||
erpmoname ERP工单号,
|
||||
moprodname 工单物料编码,
|
||||
moproddesc 工单物料描述
|
||||
from
|
||||
reportdata.siteonlinecrucibleyield s
|
||||
where 1=1
|
||||
and qctime >= concat(date_format(now()-8.5/24,'%Y-%m-') ,'01 08:30:00')
|
||||
##and qctime >= concat(date_format(date_sub(now(),interval 1 month)-8.5/24,'%Y-%m-') ,'01 08:30:00') /*上月第一天 */
|
||||
and qctime < concat(date_format(now()-8.5/24,'%Y-%m-%d') ,' 08:30:00')
|
||||
order by qctime
|
Loading…
Reference in New Issue