Commit eaea87aa authored by jichao's avatar jichao

能耗管理--用能概况,“今日运行费用”不一致的bug

parent 2debe327
...@@ -28,9 +28,9 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> { ...@@ -28,9 +28,9 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
"sum(ELEC) as elec,sum(ELEC_MONEY) as elecMoney," + "sum(ELEC) as elec,sum(ELEC_MONEY) as elecMoney," +
"sum(GAS) as gas,sum(GAS_MONEY) as gasMoney" + "sum(GAS) as gas,sum(GAS_MONEY) as gasMoney" +
" from energy_count_m e " + " from energy_count_m e " +
"where e.PRO_ID=#{proId} and `year`=#{year}" + "where e.PRO_ID=#{proId} and `year`=#{year} and mon=${mon}" +
"<if test=\"day != null\"> and `day`=${day} group by e.`day`</if>" + "<if test=\"day != null\"> and `day`=${day} group by e.`day`</if>" +
"<if test=\"mon != null\"> and mon=${mon} group by e.mon</if></script>") "<if test=\"day == null\"> group by e.mon</if></script>")
@ResultMap("BaseResultMap") @ResultMap("BaseResultMap")
EnergyCountM countAmountAndPrice(EnergyCountM energyCountM); EnergyCountM countAmountAndPrice(EnergyCountM energyCountM);
......
...@@ -310,12 +310,12 @@ public class OverViewServiceImpl implements OverViewService { ...@@ -310,12 +310,12 @@ public class OverViewServiceImpl implements OverViewService {
EnergyCountM m = new EnergyCountM(); EnergyCountM m = new EnergyCountM();
m.setProId(proId); m.setProId(proId);
m.setYear(cal.get("year")); m.setYear(cal.get("year"));
m.setMon(cal.get("month"));
//统计日 //统计日
m.setDay(cal.get("day")); m.setDay(cal.get("day"));
EnergyCountM dayCount = energyCountMRepository.countAmountAndPrice(m); EnergyCountM dayCount = energyCountMRepository.countAmountAndPrice(m);
//统计月 //统计月
m.setDay(null); m.setDay(null);
m.setMon(cal.get("month"));
EnergyCountM monthCount = energyCountMRepository.countAmountAndPrice(m); EnergyCountM monthCount = energyCountMRepository.countAmountAndPrice(m);
//合并返回值 //合并返回值
Map<String, Object> result = new HashMap<String, Object>(); Map<String, Object> result = new HashMap<String, Object>();
......
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