|
@@ -614,37 +614,32 @@
|
|
|
|
|
|
<!-- 全用途指标数据查询(实绩、厂标、行标、国标对比 -->
|
|
|
<select id="getIndexData" parameterType="java.util.HashMap" resultType="Map">
|
|
|
- select a.workprocid,a.itemname,a.apportvalue cnsj,a.clock,a.unitid,a.timegranid,a.energyid,a.indextype,
|
|
|
- b.apportvalue cnbz,b.warnvalue cnbzw, (b.apportvalue+b.apportvalue*b.warnvalue/100) cnbzwv,
|
|
|
- c.actualvalue gjbz,c.warnvalue gjbzw, (c.apportvalue+c.apportvalue*c.warnvalue/100) gjbzwv,
|
|
|
- d.apportvalue hybz,d.warnvalue hybzw, (d.apportvalue+d.apportvalue*b.warnvalue/100) hybzwv, d.factoryid
|
|
|
+ select
|
|
|
+ b.workprocid,
|
|
|
+ b.itemname,
|
|
|
+ b.clock,
|
|
|
+ b.unitid,
|
|
|
+ b.timegranid,
|
|
|
+ b.energyid,
|
|
|
+ b.indextype,
|
|
|
+ b.apportvalue cnbz,
|
|
|
+ b.warnvalue cnbzw,
|
|
|
+ (b.apportvalue + b.apportvalue * b.warnvalue / 100) cnbzwv
|
|
|
from
|
|
|
(select * from T_RM_INDEX_ITEM t inner join T_RM_INDEX_VALUE v on t.itemid = v.itemid
|
|
|
- where v.clock = #{clock} and t.itemtype = 'CNSJ' and t.useflag=1) a
|
|
|
- left join
|
|
|
- (select * from T_RM_INDEX_ITEM t inner join T_RM_INDEX_VALUE v on t.itemid = v.itemid
|
|
|
where v.clock = #{clock2} and t.itemtype = 'CNBZ' and t.useflag=1) b
|
|
|
- on a.workprocid = b.workprocid and a.indextype = b.indextype and a.energyid = b.energyid
|
|
|
- left join
|
|
|
- (select * from T_RM_INDEX_ITEM t inner join T_RM_INDEX_VALUE v on t.itemid = v.itemid
|
|
|
- where v.clock = #{clock2} and t.itemtype = 'GJBZ' and t.useflag=1) c
|
|
|
- on substr(a.workprocid,0,3)= substr(c.workprocid,0,3) and a.indextype = c.indextype and a.energyid = c.energyid
|
|
|
- left join
|
|
|
- (select * from T_RM_INDEX_ITEM t inner join T_RM_INDEX_VALUE v on t.itemid = v.itemid
|
|
|
- where v.clock = #{clock2} and t.itemtype = 'HYBZ' and t.useflag=1) d
|
|
|
- on substr(a.workprocid,0,3)= substr(d.workprocid,0,3) and a.indextype = d.indextype and a.energyid = d.energyid
|
|
|
<where>
|
|
|
<if test="workprocid != null and workprocid != '' ">
|
|
|
- and a.workprocid in (${workprocid})
|
|
|
+ and b.workprocid in (${workprocid})
|
|
|
</if>
|
|
|
<if test="energyid != null and energyid != '' ">
|
|
|
- and a.energyid in (${energyid})
|
|
|
+ and b.energyid in (${energyid})
|
|
|
</if>
|
|
|
<if test="indextype != null and indextype != '' ">
|
|
|
- and a.indextype in (${indextype})
|
|
|
+ and b.indextype in (${indextype})
|
|
|
</if>
|
|
|
</where>
|
|
|
- order by clock,indextype,energyid
|
|
|
+ order by b.clock,b.indextype,b.energyid
|
|
|
</select>
|
|
|
|
|
|
<!-- 企业吨产品水耗趋势图 -->
|