中-55-DevalarmDataHistoryMapper.xml;215行
| | |
| | | |
| | | //List<BattalarmDataHistory> getLevelSubList(int uId, String tableName); |
| | | |
| | | List<DevalarmDataHistory> getListByStationId(Date startTime, Date endTime, String stationId,String tableName); |
| | | //List<DevalarmDataHistory> getListByStationId(Date startTime, Date endTime, String stationId,String tableName); |
| | | |
| | | } |
| | |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.SubTablePageInfoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private SubTablePageInfoUtils subTablePageInfoUtils; |
| | | |
| | | @Autowired |
| | | private SubTablePageInfoService subService; |
| | | |
| | | //设备告警历史查询 |
| | | public Response serchByCondition(DevAlarmPar par) { |
| | |
| | | } |
| | | |
| | | public List<DevalarmDataHistory> getListByStationId(Date startTime, Date endTime, String stationId,String tableName) { |
| | | return mapper.getListByStationId(startTime,endTime,stationId,tableName); |
| | | //List<DevalarmDataHistory> list=mapper.getListByStationId(startTime,endTime,stationId,tableName); |
| | | List<DevalarmDataHistory> list=subService.getListByStationId_dev(startTime,endTime,stationId,tableName); |
| | | return list; |
| | | } |
| | | |
| | | public Response getLevelList() { |
| | |
| | | /*7 |
| | | subService.deleteByNum("tb_eleprice_1014",5);*/ |
| | | |
| | | Date date5=ThreadLocalUtil.parse("2021-04-02 09:36:08",1); |
| | | Date date6=ThreadLocalUtil.parse("2023-02-21 10:00:23",1); |
| | | Date date5=ThreadLocalUtil.parse("2023-08-01 10:39:16",1); |
| | | Date date6=ThreadLocalUtil.parse("2023-08-11 12:11:42",1); |
| | | /*10List list=subService.getListByStationId(date5,date6,"42010011","tb_battalarm_data_history_2023_08");*/ |
| | | /*12 |
| | | ElePrice ele=new ElePrice(); |
| | |
| | | List list= subService.searchByBattGroupId(dto);*/ |
| | | /*49 |
| | | int flag=subService.updateFlag("AppServer_Reinit_BattGroupData_EN");*/ |
| | | /*52*/ |
| | | int judgeNUm= subService.judge(1000007); |
| | | return new Response().setII(1,true,judgeNUm,null); |
| | | /*52 |
| | | int judgeNUm= subService.judge(1000007);*/ |
| | | /*55*/ |
| | | List list=subService.getListByStationId_dev(date5,date6,"42010020","tb_devalarm_data_history_2023_08"); |
| | | return new Response().setII(1,true,list,null); |
| | | } |
| | | } |
| | |
| | | return minNum; |
| | | } |
| | | |
| | | // |
| | | //BattRealdataMapper.xml;63行 |
| | | public List<RealDateDTO> serchByCondition2(BattRealdata realdata){ |
| | | String sql=" select recrod_time, " + |
| | | " group_vol, " + |
| | |
| | | return judgeNum; |
| | | } |
| | | |
| | | //55-DevalarmDataHistoryMapper.xml;215行 |
| | | public List<DevalarmDataHistory> getListByStationId_dev(Date startTime, Date endTime, String stationId,String tableName){ |
| | | String sql="select h.*,b.StationName,b.StationName1,b.StationName2,b.StationName3,b.StationName5 from db_alarm."+tableName+" h,db_battinf.tb_battinf b " + |
| | | " where h.dev_id = b.FBSDeviceId " ; |
| | | if(stationId!=null&&!stationId.isEmpty()){ |
| | | sql+=" and b.stationId ="+stationId+" "; |
| | | } |
| | | sql+=" and h.alm_start_time >= '"+ThreadLocalUtil.format(startTime,1)+"' and h.alm_start_time <= '"+ThreadLocalUtil.format(endTime,1)+"' "; |
| | | List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<DevalarmDataHistory> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | DevalarmDataHistory ph=new DevalarmDataHistory(); |
| | | ph.setNum(rs.getLong("num")); |
| | | ph.setDevId(rs.getInt("dev_id")); |
| | | ph.setDevIp(rs.getString("dev_ip")); |
| | | ph.setAlmType(rs.getInt("alm_type")); |
| | | ph.setAlmLevel(rs.getInt("alm_level")); |
| | | ph.setAlmStartTime(rs.getTimestamp("alm_start_time")); |
| | | ph.setAlmEndTime(rs.getTimestamp("alm_end_time")); |
| | | ph.setAlmIsConfirmed(rs.getInt("alm_is_confirmed")); |
| | | ph.setAlmConfirmedTime(rs.getTimestamp("alm_confirmed_time")); |
| | | ph.setAlmClearedType(rs.getInt("alm_cleared_type")); |
| | | ph.setStationName(rs.getString("stationName")); |
| | | ph.setStationName1(rs.getString("stationName1")); |
| | | ph.setStationName2(rs.getString("stationName2")); |
| | | ph.setStationName3(rs.getString("stationName3")); |
| | | ph.setStationName5(rs.getString("stationName5")); |
| | | list.add(ph); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | } |
| | |
| | | and db_user.tb_user_inf.uid = db_user.tb_user_battgroup_baojigroup_usr.uid |
| | | and db_user.tb_user_inf.uid =#{uId}) |
| | | <if test="stationName1 !=null"> |
| | | AND b.StationName1 like '%${stationName1}%' |
| | | AND b.StationName1 like CONCAT('%',#{stationName1},'%') |
| | | </if> |
| | | <if test="stationId !=null"> |
| | | AND b.StationId = #{stationId} |
| | |
| | | db_user.tb_user_battgroup_baojigroup_usr.uid |
| | | and db_user.tb_user_inf.uid = #{uId}) |
| | | </select>--> |
| | | <select id="getListByStationId" resultType="com.whyc.pojo.DevalarmDataHistory"> |
| | | <!--<select id="getListByStationId" resultType="com.whyc.pojo.DevalarmDataHistory"> |
| | | select h.*,b.StationName1,b.StationName2,b.StationName3,b.StationName5 from db_alarm.${tableName} h,db_battinf.tb_battinf b |
| | | where h.dev_id = b.FBSDeviceId |
| | | <if test="stationId !=null and stationId !=''"> |
| | |
| | | </if> |
| | | and h.alm_start_time >= #{startTime} |
| | | and h.alm_start_time <= #{endTime} |
| | | </select> |
| | | </select>--> |
| | | |
| | | |
| | | </mapper> |