|
@@ -6,7 +6,7 @@
|
|
|
|
|
|
|
|
|
<select id="selectMonthElectricity" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
|
|
|
- select equipmentid,equipmentname,year,month,ifnull(sum(electricityvalue),0) as howManyValue
|
|
|
+ select equipmentid,equipmentname,year,month,ifnull(sum(tagvalue2),0) as howManyValue
|
|
|
from ems_data_electricity_day
|
|
|
where year=#{year} and month=#{month}
|
|
|
and equipmentid in
|
|
@@ -18,7 +18,7 @@
|
|
|
limit 5;
|
|
|
</select>
|
|
|
<select id="selectMonthEquipElectricity" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
|
|
|
- select equipmentid,equipmentname,year,month,ifnull(sum(electricityvalue),0) as howManyValue2
|
|
|
+ select equipmentid,equipmentname,year,month,ifnull(sum(tagvalue2),0) as howManyValue2
|
|
|
from ems_data_electricity_day
|
|
|
where year=#{year} and month=#{month} and equipmentid=#{equipmentid}
|
|
|
limit 1;
|
|
@@ -45,7 +45,7 @@
|
|
|
) as b
|
|
|
</select>
|
|
|
<select id="selectEnvironment" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
|
|
|
- select 'CO2排放' as type, round(max(electricityvalue)*(select co2 from base_energy_type where name='电' limit 1), 3) as howManyValue
|
|
|
+ select 'CO2排放' as type, round(max(tagvalue2)*(select co2 from base_energy_type where name='电' limit 1), 3) as howManyValue
|
|
|
from ems_data_electricity_day
|
|
|
where year=#{year} and month=#{month}
|
|
|
and equipmentid in
|
|
@@ -68,28 +68,28 @@
|
|
|
) as b
|
|
|
</select>
|
|
|
<select id="selectKgceMonthTotal" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
|
|
|
- select 290016788021249 as energyitemid,'动力用电' as type,round(ifnull(sum(e.electricityvalue),0)*y.kgce,3) as howManyValue
|
|
|
+ select 290016788021249 as energyitemid,'动力用电' as type,round(ifnull(sum(e.tagvalue2),0)*y.kgce,3) as howManyValue
|
|
|
from ems_data_electricity_day as e,base_energy_type as y
|
|
|
where e.year=#{year} and e.month=#{month} and e.equipmentid in (301156930748417,301156962205697) and y.name='电'
|
|
|
union
|
|
|
- select 290016823672833 as energyitemid,'空调用电' as type,round(ifnull(sum(e.electricityvalue),0)*y.kgce,3) as howManyValue
|
|
|
+ select 290016823672833 as energyitemid,'空调用电' as type,round(ifnull(sum(e.tagvalue2),0)*y.kgce,3) as howManyValue
|
|
|
from ems_data_electricity_day as e,base_energy_type as y
|
|
|
where e.year=#{year} and e.month=#{month} and e.equipmentid in (301156947525633) and y.name='电'
|
|
|
union
|
|
|
select 290016857227265 as energyitemid,'其它用电' as type,
|
|
|
round((
|
|
|
(
|
|
|
- select ifnull(sum(electricityvalue),0)
|
|
|
+ select ifnull(sum(tagvalue2),0)
|
|
|
from ems_data_electricity_day
|
|
|
where equipmentid in (301156882513921) and year=#{year} and month=#{month}
|
|
|
) -
|
|
|
(
|
|
|
- select ifnull(sum(electricityvalue),0)
|
|
|
+ select ifnull(sum(tagvalue2),0)
|
|
|
from ems_data_electricity_day
|
|
|
where equipmentid in (301156930748417,301156962205697) and year=#{year} and month=#{month}
|
|
|
) -
|
|
|
(
|
|
|
- select ifnull(sum(electricityvalue),0)
|
|
|
+ select ifnull(sum(tagvalue2),0)
|
|
|
from ems_data_electricity_day
|
|
|
where equipmentid in (301156947525633) and year=#{year} and month=#{month}
|
|
|
)
|
|
@@ -98,7 +98,7 @@
|
|
|
where y.name='电'
|
|
|
</select>
|
|
|
<select id="selectKgceMonth" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
|
|
|
- select t.energyitemid,i.energyitemname as type,round(ifnull(sum(e.electricityvalue),0)*y.kgce,3) as howManyValue
|
|
|
+ select t.energyitemid,i.energyitemname as type,round(ifnull(sum(e.tagvalue2),0)*y.kgce,3) as howManyValue
|
|
|
from ems_data_electricity_day as e,tpm_tag as t,base_energy_item as i,base_energy_type as y
|
|
|
where e.tagid=t.id and t.energyitemid=i.id and e.year=#{year} and e.month=#{month}
|
|
|
and i.energytypeid=y.id and y.name='电'
|
|
@@ -110,33 +110,33 @@
|
|
|
</select>
|
|
|
<select id="selectItemByEquipidAndDayTotal"
|
|
|
resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
|
|
|
- select 290016788021249 as energyitemid,'动力用电' as equipmentname, '能耗分项' as type,ifnull(sum(e.electricityvalue),0) as howManyValue
|
|
|
+ select 290016788021249 as energyitemid,'动力用电' as equipmentname, '能耗分项' as type,ifnull(sum(e.tagvalue2),0) as howManyValue
|
|
|
from ems_data_electricity_day as e
|
|
|
where e.day=#{day} and e.equipmentid in (301156930748417,301156962205697)
|
|
|
union
|
|
|
- select 290016823672833 as energyitemid,'空调用电' as equipmentname, '能耗分项' as type,ifnull(sum(e.electricityvalue),0) as howManyValue
|
|
|
+ select 290016823672833 as energyitemid,'空调用电' as equipmentname, '能耗分项' as type,ifnull(sum(e.tagvalue2),0) as howManyValue
|
|
|
from ems_data_electricity_day as e
|
|
|
where e.day=#{day} and e.equipmentid in (301156947525633)
|
|
|
union
|
|
|
select 290016857227265 as energyitemid,'其它用电' as equipmentname, '能耗分项' as type,
|
|
|
(
|
|
|
- select ifnull(sum(electricityvalue),0)
|
|
|
+ select ifnull(sum(tagvalue2),0)
|
|
|
from ems_data_electricity_day
|
|
|
where equipmentid in (301156882513921) and day=#{day}
|
|
|
) -
|
|
|
(
|
|
|
- select ifnull(sum(electricityvalue),0)
|
|
|
+ select ifnull(sum(tagvalue2),0)
|
|
|
from ems_data_electricity_day
|
|
|
where equipmentid in (301156930748417,301156962205697) and day=#{day}
|
|
|
) -
|
|
|
(
|
|
|
- select ifnull(sum(electricityvalue),0)
|
|
|
+ select ifnull(sum(tagvalue2),0)
|
|
|
from ems_data_electricity_day
|
|
|
where equipmentid in (301156947525633) and day=#{day}
|
|
|
) as howManyValue
|
|
|
</select>
|
|
|
<select id="selectItemByEquipidAndDay" resultType="org.jeecg.modules.emsStatistics.entity.EmsStatistics">
|
|
|
- select t.energyitemid as equipmentid,i.energyitemname as equipmentname, '能耗分项' as type,ifnull(sum(e.electricityvalue),0) as howManyValue
|
|
|
+ select t.energyitemid as equipmentid,i.energyitemname as equipmentname, '能耗分项' as type,ifnull(sum(e.tagvalue2),0) as howManyValue
|
|
|
from ems_data_electricity_day as e,tpm_tag as t,base_energy_item as i,base_energy_type as y
|
|
|
where e.tagid=t.id t.energyitemid=i.energyitemid and e.day=#{day}
|
|
|
and i.energytypeid=y.energytypeid and y.name='电'
|