Commit eaea87aa authored by jichao's avatar jichao

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

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