浏览代码

lrl -2021-12-13

lirl 3 年之前
父节点
当前提交
9cf3719514
共有 1 个文件被更改,包括 15 次插入20 次删除
  1. 15 20
      src/main/java/com/steerinfo/ems/trmindexvalue/mapper/TRmIndexValueMapper.xml

+ 15 - 20
src/main/java/com/steerinfo/ems/trmindexvalue/mapper/TRmIndexValueMapper.xml

@@ -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>
     
     <!-- 企业吨产品水耗趋势图 -->