| | |
| | | return list; |
| | | } |
| | | //系统概览获取半小时核容设备信息(组端信息取一个单体信息即可) |
| | | public List<BattHisRealDto> getHalfHourBattDevData(String tableName,Integer granularity) { |
| | | public List<BattHisRealDto> getHalfHourBattDevData(String tableName,Integer granularity,String halfHourAgoTime) { |
| | | String sql="select distinct mon_num,record_time,group_vol,online_vol,group_curr,group_tmp,load_curr " + |
| | | "from (select a.*, (@i:= @i+1) as number " + |
| | | " from (select * from "+tableName+" "+ |
| | | " where record_time>date_sub(now(),interval 0.5 hour) and mon_num=1) a, " + |
| | | " where record_time>='"+halfHourAgoTime+"' and mon_num=1) a, " + |
| | | " (select @i:=0) b) c "+ |
| | | " where c.number%"+granularity+"=0 or c.number=1 "; |
| | | sql+=" order by record_time asc"; |
| | |
| | | return list; |
| | | } |
| | | //系统概览获取半小时交流输入统计 |
| | | public List<PwrHisRealAcInDto> getHalfHourPwrHisAcinData(String tableName,Integer granularity) { |
| | | public List<PwrHisRealAcInDto> getHalfHourPwrHisAcinData(String tableName,Integer granularity,String halfHourAgoTime) { |
| | | String sql="select distinct record_datetime,acin1_vola,acin1_volb,acin1_volc,acin2_vola,acin2_volb,acin2_volc " + |
| | | ",acin1_curra,acin1_currb,acin1_currc,acin2_curra,acin2_currb,acin2_currc " + |
| | | "from (select a.*, (@i:= @i+1) as number " + |
| | | " from (select * from "+tableName+" "+ |
| | | " where record_datetime>date_sub(now(),interval 0.5 hour)) a, " + |
| | | " where record_datetime>='"+halfHourAgoTime+"') a, " + |
| | | " (select @i:=0) b) c "+ |
| | | " where c.number%"+granularity+"=0 or c.number=1 "; |
| | | sql+=" order by record_datetime asc"; |
| | |
| | | return list; |
| | | } |
| | | |
| | | public List<PwrHisRealDcoutInDto> getHalfHourPwrHisDcoutData(String tableName,Integer granularity) { |
| | | public List<PwrHisRealDcoutInDto> getHalfHourPwrHisDcoutData(String tableName,Integer granularity,String halfHourAgoTime) { |
| | | String sql="select distinct * " + |
| | | "from (select a.*, (@i:= @i+1) as number " + |
| | | " from (select * from "+tableName+" "+ |
| | | " where record_datetime>date_sub(now(),interval 0.5 hour)) a, " + |
| | | " where record_datetime>='"+halfHourAgoTime+"') a, " + |
| | | " (select @i:=0) b) c "+ |
| | | " where c.number%"+granularity+"=0 or c.number=1 "; |
| | | sql+=" order by record_datetime asc"; |