| | |
| | | import com.doumee.dao.business.join.PlatformJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.openapi.response.PlatformNumByStatusResponse; |
| | | import com.doumee.dao.openapi.response.PlatformStatusListResponse; |
| | | import com.doumee.service.business.PlatformDeviceService; |
| | | import com.doumee.service.business.PlatformService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<PlatformStatusListResponse> getPlatformStatusList(){ |
| | | List<Platform> platformList = platformJoinMapper.selectJoinList(Platform.class,new MPJLambdaWrapper<Platform>() |
| | | .selectAll(Platform.class) |
| | | .select(" ( select count(1) from platform_job pj where t.id = pj.PLATFORM_ID and pj.STATUS = "+Constants.PlatformJobStatus.WORKING.getKey()+" ) as workStatus ") |
| | | .select(" ( select pj.CAR_CODE_FRONT from platform_job pj where t.id = pj.PLATFORM_ID and pj.STATUS = "+Constants.PlatformJobStatus.WORKING.getKey()+" limit 1 ) as workCarCode ") |
| | | .eq(Platform::getIsdeleted,Constants.ZERO) |
| | | ); |
| | | List<PlatformStatusListResponse> platformStatusListResponses = new ArrayList<>(); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformList)){ |
| | | for (Platform platform:platformList) { |
| | | PlatformStatusListResponse response = new PlatformStatusListResponse(); |
| | | response.setPlatformHkId(platform.getHkId()); |
| | | response.setPlatformName(platform.getName()); |
| | | response.setStatus(platform.getPlatformStatus()); |
| | | if(Constants.equalsInteger(platform.getPlatformStatus(),Constants.ONE)){ |
| | | response.setCarCode(platform.getWorkCarCode()); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | return platformStatusListResponses; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |