Registered-reservation-syst.../src/Springboot_hosptial/src/main/java/com/baiyun/service/admin/impl/DepartmentServiceImpl.java

66 lines
1.5 KiB
Java

package com.baiyun.service.admin.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baiyun.dao.DepartmentDao;
import com.baiyun.enity.Departments;
import com.baiyun.service.admin.DepartmentService;
/**
* @Description: TODO
* @author: bilibili
* @Date: 2021年6月14日
*/
@Service
public class DepartmentServiceImpl implements DepartmentService {
@Autowired
DepartmentDao departmentDao;
// 列出所有的科室
@Override
public List<Departments> listAllDepartments() {
List<Departments> departments = departmentDao.listAllDepartments();
return departments;
}
// 添加科室
@Override
public int addDepartment(Departments department) {
int i = departmentDao.addDepartment(department);
return i;
}
// 修改科室
@Override
public int updateDepartment(Departments departments) {
int i = departmentDao.updateDepartment(departments);
return i;
}
// 根据id查找科室
@Override
public Departments findDepartmentById(int id) {
Departments department = departmentDao.findDepartmentById(id);
return department;
}
// 根据科室名查找科室
@Override
public List<Departments> findDepartmentByName(String name) {
List<Departments> departments = departmentDao.findDepartmentByName(name);
return departments;
}
// 根据id删除科室
@Override
public int deleteDepartmentById(int id) {
int i = departmentDao.deleteDepartmentById(id);
return i;
}
}