Commit 8b321b28 by lijingjing

品位查询修改(零除问题);

判级过滤多余指标数据;
parent c0a7a341
...@@ -697,11 +697,10 @@ ...@@ -697,11 +697,10 @@
s.code "sample_code", s.code "sample_code",
s.entrust_id s.entrust_id
FROM entrust_sample_item_index ii FROM entrust_sample_item_index ii
JOIN entrust_sample_item i on ii.entrust_sample_item_id = i.id JOIN entrust_sample_item i on ii.entrust_sample_item_id = i.id AND i.deleted = 0
JOIN entrust_sample s ON i.entrust_sample_id = s.id JOIN entrust_sample s ON i.entrust_sample_id = s.id AND s.deleted = 0
WHERE ii.deleted = 0 WHERE ii.deleted = 0
AND i.deleted = 0 AND ((strpos(i.name,'原铝')>0 and i.name = ii.name ) or strpos(i.name,'原铝')=0)
AND s.deleted = 0
AND s.id = #{sampleId} AND s.id = #{sampleId}
</select> </select>
<!--查询样品下分批中最大的检测值信息--> <!--查询样品下分批中最大的检测值信息-->
......
...@@ -191,27 +191,27 @@ ...@@ -191,27 +191,27 @@
e.model "branch", e.model "branch",
e.plant, e.plant,
COUNT ( 1 ) "total", COUNT ( 1 ) "total",
( CASE WHEN COUNT ( 1 ) / ${vo.days} > 1 THEN ( COUNT ( 1 ) / (${vo.days} / 2) ) ELSE 1 END ) "slots_num", ( CASE WHEN COUNT ( 1 ) / ${vo.days} > 1 THEN ( COUNT ( 1 ) / (${vo.days} * 1.0 / 2) ) ELSE 1 END ) "slots_num",
sum(ix.al_85_num) "al_85_num", sum(ix.al_85_num) "al_85_num",
round(coalesce(sum(ix.al_85_num),0) * 1.0 / COUNT ( 1 ),4) "al_85_per", round(coalesce(sum(ix.al_85_num),0) * 1.0 / COUNT ( 1 ),4) "al_85_per",
round(coalesce(sum(ix.al_85_num),0) / (${vo.days} / 2)) "al_85_slots_num", round(coalesce(sum(ix.al_85_num),0) / (${vo.days} * 1.0 / 2)) "al_85_slots_num",
sum(ix.al_80_num) "al_80_num", sum(ix.al_80_num) "al_80_num",
round(coalesce(sum(ix.al_80_num),0) * 1.0 / COUNT ( 1 ),4) "al_80_per", round(coalesce(sum(ix.al_80_num),0) * 1.0 / COUNT ( 1 ),4) "al_80_per",
round(coalesce(sum(ix.al_80_num),0) / (${vo.days} / 2)) "al_80_slots_num", round(coalesce(sum(ix.al_80_num),0) / (${vo.days} * 1.0 / 2)) "al_80_slots_num",
sum(ix.al_70_num) "al_70_num", sum(ix.al_70_num) "al_70_num",
round(coalesce(sum(ix.al_70_num),0) * 1.0 / COUNT ( 1 ),4) "al_70_per", round(coalesce(sum(ix.al_70_num),0) * 1.0 / COUNT ( 1 ),4) "al_70_per",
round(coalesce(sum(ix.al_70_num),0) / (${vo.days} / 2)) "al_70_slots_num", round(coalesce(sum(ix.al_70_num),0) / (${vo.days} * 1.0 / 2)) "al_70_slots_num",
sum(ix.al_70_dt_num) "al_70_dt_num", sum(ix.al_70_dt_num) "al_70_dt_num",
round(coalesce(sum(ix.al_70_dt_num),0) * 1.0 / COUNT ( 1 ),4) "al_70_dt_per", round(coalesce(sum(ix.al_70_dt_num),0) * 1.0 / COUNT ( 1 ),4) "al_70_dt_per",
round(coalesce(sum(ix.al_70_dt_num),0) / (${vo.days} / 2)) "al_70_dt_slots_num", round(coalesce(sum(ix.al_70_dt_num),0) / (${vo.days} * 1.0 / 2)) "al_70_dt_slots_num",
sum(ix.al_70_ge_num) "al_70_ge_num", sum(ix.al_70_ge_num) "al_70_ge_num",
round(coalesce(sum(ix.al_70_ge_num),0) * 1.0 / COUNT ( 1 ),4) "al_70_ge_per", round(coalesce(sum(ix.al_70_ge_num),0) * 1.0 / COUNT ( 1 ),4) "al_70_ge_per",
round(coalesce(sum(ix.al_70_ge_num),0) / (${vo.days} / 2)) "al_70_ge_slots_num" round(coalesce(sum(ix.al_70_ge_num),0) / (${vo.days} * 1.0 / 2)) "al_70_ge_slots_num"
FROM FROM
entrust_sample s entrust_sample s
JOIN electrolyzer e ON s.electrolyzer_id = e.ID JOIN electrolyzer e ON s.electrolyzer_id = e.ID
......
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