更新获得指定厂区得员工接口,根据员工姓名模糊查询

This commit is contained in:
Echo 2025-07-17 16:53:38 +08:00
parent 875a3ff406
commit cb74cb0533
3 changed files with 10 additions and 5 deletions

View File

@ -99,8 +99,9 @@ public class StaffController {
@Parameter(name = "factoryId", description = "厂区编号", required = true, example = "1024")
@Parameter(name = "isIn", description = "是否获取该厂区得员工", required = true, example = "1024")
public CommonResult<List<StaffRespVO>> getListByFactory(@RequestParam("factoryId") Long factoryId,
@RequestParam("isIn") Boolean isIn) {
List<StaffDO> staffs = staffService.getListByFactory(factoryId, isIn);
@RequestParam("isIn") Boolean isIn,
@RequestParam(value = "name",required = false) String name) {
List<StaffDO> staffs = staffService.getListByFactory(factoryId, isIn, name);
return success(BeanUtils.toBean(staffs, StaffRespVO.class));
}

View File

@ -90,7 +90,7 @@ public interface StaffService {
* @param isIn 是否获取该厂区员工
* @return 员工列表
*/
List<StaffDO> getListByFactory(Long factoryId, Boolean isIn);
List<StaffDO> getListByFactory(Long factoryId, Boolean isIn, String name);
List<StaffDO> getListByFactory(Long factoryId, Boolean isIn, List<Integer> workTypeIds);

View File

@ -249,8 +249,12 @@ public class StaffServiceImpl implements StaffService {
}
@Override
public List<StaffDO> getListByFactory(Long factoryId, Boolean isIn) {
return this.getListByFactory(factoryId, isIn, null);
public List<StaffDO> getListByFactory(Long factoryId, Boolean isIn, String name) {
return staffMapper.selectList(new LambdaQueryWrapperX<StaffDO>()
.eq(isIn, StaffDO::getFactoryId, factoryId)
.ne(!isIn, StaffDO::getFactoryId, factoryId)
.ne(StaffDO::getStatus, 0)
.like(StaffDO::getNickName, name));
}
@Override