| | |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.WorktypeMapper; |
| | | import com.doumee.dao.business.dto.WorkTypeQueryDTO; |
| | | import com.doumee.dao.business.model.Worktype; |
| | | import com.doumee.service.business.WorktypeService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 工种信息表Service实现 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Worktype> getBySolutionsId(Integer solutionId){ |
| | | QueryWrapper<Worktype> wrapper = new QueryWrapper<>(); |
| | | wrapper.apply(" id in ( select sw.WORKTYPE_ID from solution_worktype sw where sw.SOLUTION_ID = "+solutionId+" ) "); |
| | | return worktypeMapper.selectList(wrapper); |
| | | public List<Worktype> findListByDTO(WorkTypeQueryDTO workTypeQueryDTO){ |
| | | List<Worktype> list = worktypeMapper.selectList(new QueryWrapper<Worktype>().lambda() |
| | | .eq(Worktype::getIsdeleted,Constants.ZERO) |
| | | .apply(workTypeQueryDTO.getQueryType().equals(Constants.ZERO), |
| | | "id in ( select sw.worktype_id from solution_worktype sw where sw.SOLUTION_ID = "+workTypeQueryDTO.getId()+" )") |
| | | .apply(workTypeQueryDTO.getQueryType().equals(Constants.ONE), |
| | | "id in ( select dw.work_type_id from du_worktype dw where dw.du_solution_id = "+workTypeQueryDTO.getId()+" )") |
| | | ); |
| | | return list; |
| | | } |
| | | |
| | | @Override |