苍穹外卖--员工管理--启用禁用员工账号
This commit is contained in:
@@ -26,4 +26,9 @@ public interface EmployeeService {
|
||||
* @return
|
||||
*/
|
||||
PageResult pageQuery(EmployeePageQueryDTO employeePageQueryDTO);
|
||||
}
|
||||
|
||||
/*
|
||||
启用禁用员工账号
|
||||
*/
|
||||
void startOrStop(Integer status, Long id);
|
||||
}
|
||||
|
||||
@@ -115,4 +115,21 @@ public class EmployeeServiceImpl implements EmployeeService {
|
||||
return new PageResult(total,records);
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用禁用员工账号
|
||||
* @param status
|
||||
* @param id
|
||||
*/
|
||||
@Override
|
||||
public void startOrStop(Integer status, Long id) {
|
||||
//update employee set status = ? where id = ?;
|
||||
//写法1:普通方式
|
||||
/*Employee employee = new Employee();
|
||||
employee.setId(id);
|
||||
employee.setStatus(status);*/
|
||||
//写法2:构建器创建实体对象
|
||||
Employee employee = Employee.builder().id(id).status(status).build();
|
||||
employeeMapper.update(employee);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user