包装标签查询
1.查询包装箱号900724125009
从t_cntner中查询出id_cntner
select id_cntner from t_cntner where cntner_numcont='900724125009'
id_cntner为'900700019706'
2.从'900700019706'中查询出et_stocpf
select et_stocpf from t_packpf where et_cntner='900700019706'
所以为:
select * from t_stocpf
where id_stocpf in
(
select et_stocpf from t_packpf where et_cntner=(select id_cntner from t_cntner where cntner_numcont='900724125009')
) order by et_lotpf
查询包装内的流水号:
select * from t_operat
where et_stocpf in
(
select et_stocpf from t_packpf where et_cntner=(select id_cntner from t_cntner where cntner_numcont='900724308014')
) and operat_nscomp<>''
对于该查询,如果标签不存在,如 :select * from t_cntner where cntner_numcont='110724B18024',没有数据,则需在t_label中查询该标签是否扫码
t_label中label_status为0,则标签打印了没有扫码,label_status为R,则标签扫码入库。
所以对于标签'110724B18024'应查'110724B18025',lable_status=R的标签。
参考
t_label仅为标签信息
select * from t_label where label_num_label='900724125009'