Commit 0c0291e2 by lijingjing

原铝和重取匹配规则(转换编号匹配)修改;

parent 5e600f2c
......@@ -117,12 +117,15 @@
JOIN entrust_sample_item i ON i.ID = ii.entrust_sample_item_id AND i.deleted = 0
JOIN entrust_sample s ON s.ID = i.entrust_sample_id AND s.deleted = 0
LEFT JOIN (
select es.slot_no, es.sample_grading, esi.period, esii.name ,esii.test_value,to_char(esii.ctime,'yyyy-MM-dd') "ctime" from entrust_sample_item_index esii
select
es.slot_no, es.sample_grading, esi.period, esii.name ,esii.test_value,
substr(es.code, 0,strpos(es.code,'C')) "cs_code"
from entrust_sample_item_index esii
join entrust_sample_item esi on esi.id = esii.entrust_sample_item_id and esi.deleted = 0
join entrust_sample es on es.id = esi.entrust_sample_id and es.deleted = 0
where esii.deleted = 0 and es.name = '原铝重取'
order by esii.ctime desc
) cq on cq.slot_no = s.slot_no and cq.period = i.period and cq.name = ii.name and cq.ctime = to_char(ii.ctime,'yyyy-MM-dd')
) cq on cq.slot_no = s.slot_no and cq.period = i.period and cq.name = ii.name and cq.cs_code = "replace"(s.code, '-', '')
WHERE ii.deleted = 0
<if test="null != entrustIds">
<foreach collection="entrustIds" index="index" item="entrustId" open=" and s.entrust_id in (" separator="," close=")">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment