| | |
| | | " db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + |
| | | " and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid and db_user.tb_user_inf.uid="+param.getUId()+" " + |
| | | " )"; |
| | | sql+=" order by history.BattGroupId asc,history.alm_start_time desc,history.monnum asc limit "+param.getLimitStart()+","+param.getLimitEnd()+" "; |
| | | sql+=" order by history.alm_start_time desc,history.BattGroupId asc,history.monnum asc limit "+param.getLimitStart()+","+param.getLimitEnd()+" "; |
| | | |
| | | List<AlarmRes> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | |
| | | } |
| | | sqlExecuteService.makeManualCommit(sql_str); |
| | | } |
| | | |
| | | //获取当前天平均负载电流 |
| | | public Float getAvgLoadCurr(Integer powerId, String tableName) { |
| | | String sql=" select avg(load_curr) as avgCurr from "+tableName +" where DATE(record_time) = CURDATE() "; |
| | | List<Float> list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List list=new ArrayList<>(); |
| | | try { |
| | | while (rs.next()){ |
| | | list.add(rs.getFloat("avgCurr")); |
| | | } |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | float avgCurr=0f; |
| | | if (list!=null){ |
| | | avgCurr=list.get(0); |
| | | } |
| | | return avgCurr; |
| | | } |
| | | } |