[Trace]追溯工位cycle time查询
以3112线,ST60为列
1.从t_modeop表中选择ST60工位和PC的步骤
select id_modeop from t_modeop where et_prod_poste='3112-60' and et_tyoper='OPE'
2.时间段选择,在t_stocpf表中选择质量状态
select id_stocpf from t_stocpf where datemodif='20220909' and heuremodif between '080500000000' and '090500000000' and et_qualpf='O'
最终查询语句为
//************
select * from t_operat where et_stocpf in (select id_stocpf from t_stocpf where datemodif='20220909' and heuremodif between '080500000000' and '090500000000' and et_qualpf='O') and et_simo in(select id_simo from t_simo where et_modeop in (select id_modeop from t_modeop where et_prod_poste='3112-60' and et_tyoper='OPE'))
//************
select id_simo from t_simo where et_modeop in (select id_modeop from t_modeop where et_prod_poste='3112-60' and et_tyoper='OPE')
select * from t_nomen where et_refakf_se='656629700A' and et_typtra='U' and et_refakf_comp is null //156123
时间的计算:
当时间cycle time跨越分钟时,计算出来的秒数会多40,需要按分钟减分钟,秒数减秒数
当时间cycle time跨越小时时,如130018,125958,cycle time为20秒,直接相减为4060,相差4040
之前查询的是在终检工位的时间,更新为以下语句,是在ST60工位的实际时间:
select * from t_operat where datemodif='20220914' and heuremodif between '080500000000' and '090500000000' and et_simo in(select id_simo from t_simo where et_modeop in (select id_modeop from t_modeop where et_prod_poste='3112-60' and et_tyoper='OPE'))
Postgres时间戳:
select to_char(LOCALTIMESTAMP, 'HH24:MI:SS:US')
select to_char(LOCALTIMESTAMP, 'HH24MISSUS')
US为微秒