| | |
| | | package com.whyc.util; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.DevAlmEnum; |
| | | import com.whyc.dto.DalmDto; |
| | | import com.whyc.factory.ThreadPoolExecutorFactory; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.mapper.DevInfMapper; |
| | | import com.whyc.pojo.db_alarm.DevalarmDataYear; |
| | | import com.whyc.pojo.db_lithium_ram_db.DevInf; |
| | | import com.whyc.pojo.db_user.UserInf; |
| | | import com.whyc.service.DevInfService; |
| | | import com.whyc.service.SubTablePageInfoService; |
| | | import com.whyc.service.UserInfService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private SubTablePageInfoService service; |
| | | |
| | | @Autowired(required = false) |
| | | private DevInfService dinfService; |
| | | |
| | | @Autowired(required = false) |
| | | private UserInfService uinfService; |
| | | |
| | | /**按年份表分页查询*/ |
| | | public PageInfo<Object> getPageInfo(int pageNum,int pageSize, |
| | |
| | | List<Date> queryTime = queryTimeForSubTables.get(key); |
| | | //====== 根据不同类型类型对象对应调整 ====== |
| | | String tableName = key.equals("default") ? tablePrefix : tablePrefix + "_" + key; |
| | | |
| | | if (pojo instanceof DalmDto) { |
| | | DalmDto dto = (DalmDto) pojo; |
| | | dto.setStartTime(queryTime.get(0)); |
| | | dto.setEndTime(queryTime.get(1)); |
| | | |
| | | List<Integer> limitList = tableAndLimitMap.get(key); |
| | | dto.setLimitStart(limitList.get(0)); |
| | | dto.setLimitEnd(limitList.get(1)); |
| | | dto.setTableName(tableName); |
| | | List list = service.getListDevAlm(dto); |
| | | dataList.addAll(list); |
| | | if(!key.equals("default")){ |
| | | DalmDto dto = (DalmDto) pojo; |
| | | dto.setStartTime(queryTime.get(0)); |
| | | dto.setEndTime(queryTime.get(1)); |
| | | List<Integer> limitList = tableAndLimitMap.get(key); |
| | | dto.setLimitStart(limitList.get(0)); |
| | | dto.setLimitEnd(limitList.get(1)); |
| | | dto.setTableName(tableName); |
| | | List<DevalarmDataYear> list = service.getListDevAlm(dto); |
| | | for (DevalarmDataYear year:list) { |
| | | int devId=year.getDevId(); |
| | | int uid=year.getConfirmedUid(); |
| | | DevInf dinf=dinfService.getDinfByDevId(devId); |
| | | UserInf uinf=uinfService.getUinfByUId(uid); |
| | | int almId=year.getAlmId(); |
| | | String almName=DevAlmEnum.getValue(almId); |
| | | year.setAlmName(almName!=null?almName:""); |
| | | year.setDevInf(dinf); |
| | | year.setConfirmedUname(uinf!=null?uinf.getUname():""); |
| | | } |
| | | dataList.addAll(list); |
| | | } |
| | | } |
| | | } |
| | | pageInfo.setList(dataList); |