| | |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | List<DispatchUnit> dispatchUnitList = dispatchUnitJoinMapper.selectJoinList(DispatchUnit.class, |
| | | new MPJLambdaWrapper<DispatchUnit>().selectAll(DispatchUnit.class) |
| | | // .selectAs(DuSolution::getId,DispatchUnit::getDuSolutionId) |
| | | // .leftJoin(DuSolution.class,DuSolution::getDispatchUnitId,DispatchUnit::getId) |
| | | .eq(DispatchUnit::getIsdeleted,Constants.ZERO) |
| | | .select("(select b.id from du_solution b where b.isdeleted=0 and b.dispatch_unit_id=t.id and b.solution_id="+dispatchUnitQueryDTO.getSolutionId()+" limit 1) as du_solution_id" ) |
| | | .eq(loginUserInfo.getType().equals(Constants.ONE),DispatchUnit::getCompanyId,loginUserInfo.getCompanyId()) |
| | | .eq(DispatchUnit::getStatus,Constants.ZERO) |
| | | //.eq(DispatchUnit::getDataType,dispatchUnitQueryDTO.getDataType()) |
| | | .eq(DispatchUnit::getDataType,Constants.TWO) |
| | | .exists("select b.id from du_solution b where b.isdeleted=0 and b.dispatch_unit_id=t.id and b.solution_id="+dispatchUnitQueryDTO.getSolutionId() ) |
| | | // .eq(!Objects.isNull(dispatchUnitQueryDTO.getSolutionId()),DuSolution::getSolutionId,dispatchUnitQueryDTO.getSolutionId()) |
| | | .exists(!Objects.isNull(dispatchUnitQueryDTO.getSolutionId()), |
| | | "select b.id from du_solution b where b.isdeleted=0 and b.dispatch_unit_id=t.id and b.solution_id="+dispatchUnitQueryDTO.getSolutionId() ) |
| | | .exists(!Objects.isNull(dispatchUnitQueryDTO.getApplyId()), |
| | | " select 1 from apply_detail ad where ad.isdeleted = 0 and ad.apply_id = "+dispatchUnitQueryDTO.getApplyId()+" " + |
| | | " and ad.du_id = t.id ") |