diff --git a/february-patient-common/src/main/java/com/february/patient/domain/Department.java b/february-patient-common/src/main/java/com/february/patient/domain/Department.java new file mode 100644 index 0000000..b66decc --- /dev/null +++ b/february-patient-common/src/main/java/com/february/patient/domain/Department.java @@ -0,0 +1,46 @@ +package com.february.patient.domain; + +/** + * @program: february-patient-circle + * @description: + * @author: Mr.Wang + * @create: 2023-11-02 21:49 + **/ + +/** + * 科室 + */ +public class Department { + /** + * 科室id + */ + private Integer departmentId; + /** + * 科室名称 + */ + private String departmentName; + + @Override + public String toString() { + return "Department{" + + "departmentId=" + departmentId + + ", departmentName='" + departmentName + '\'' + + '}'; + } + + public Integer getDepartmentId() { + return departmentId; + } + + public void setDepartmentId(Integer departmentId) { + this.departmentId = departmentId; + } + + public String getDepartmentName() { + return departmentName; + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } +} diff --git a/february-patient-server/src/main/java/com/february/patient/controller/DepartmentController.java b/february-patient-server/src/main/java/com/february/patient/controller/DepartmentController.java new file mode 100644 index 0000000..556faff --- /dev/null +++ b/february-patient-server/src/main/java/com/february/patient/controller/DepartmentController.java @@ -0,0 +1,26 @@ +package com.february.patient.controller; + +import com.february.patient.domain.Department; +import com.february.patient.service.DepartmentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * @program: february-patient-circle + * @description: + * @author: Mr.Wang + * @create: 2023-11-02 21:53 + **/ +@RestController +@RequestMapping("/department") +public class DepartmentController { + @Autowired + private DepartmentService departmentService; + @PostMapping("/findById") + public Department findById(@RequestParam Integer departmentId){ + return departmentService.findById(departmentId); + } +} diff --git a/february-patient-server/src/main/java/com/february/patient/mapper/DepartmentMapper.java b/february-patient-server/src/main/java/com/february/patient/mapper/DepartmentMapper.java new file mode 100644 index 0000000..1e00ce2 --- /dev/null +++ b/february-patient-server/src/main/java/com/february/patient/mapper/DepartmentMapper.java @@ -0,0 +1,14 @@ +package com.february.patient.mapper; + +import com.february.patient.domain.Department; +import org.apache.ibatis.annotations.Param; + +/** + * @program: february-patient-circle + * @description: + * @author: Mr.Wang + * @create: 2023-11-02 21:53 + **/ +public interface DepartmentMapper { + Department findById(@Param("departmentId") Integer departmentId); +} diff --git a/february-patient-server/src/main/java/com/february/patient/service/DepartmentService.java b/february-patient-server/src/main/java/com/february/patient/service/DepartmentService.java new file mode 100644 index 0000000..b81cbcd --- /dev/null +++ b/february-patient-server/src/main/java/com/february/patient/service/DepartmentService.java @@ -0,0 +1,13 @@ +package com.february.patient.service; + +import com.february.patient.domain.Department; + +/** + * @program: february-patient-circle + * @description: + * @author: Mr.Wang + * @create: 2023-11-02 21:54 + **/ +public interface DepartmentService { + Department findById(Integer departmentId); +} diff --git a/february-patient-server/src/main/java/com/february/patient/service/impl/DepartmentServiceImpl.java b/february-patient-server/src/main/java/com/february/patient/service/impl/DepartmentServiceImpl.java new file mode 100644 index 0000000..c294e10 --- /dev/null +++ b/february-patient-server/src/main/java/com/february/patient/service/impl/DepartmentServiceImpl.java @@ -0,0 +1,23 @@ +package com.february.patient.service.impl; + +import com.february.patient.domain.Department; +import com.february.patient.mapper.DepartmentMapper; +import com.february.patient.service.DepartmentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @program: february-patient-circle + * @description: + * @author: Mr.Wang + * @create: 2023-11-02 21:54 + **/ +@Service +public class DepartmentServiceImpl implements DepartmentService { + @Autowired + private DepartmentMapper departmentMapper; + @Override + public Department findById(Integer departmentId) { + return departmentMapper.findById(departmentId); + } +} diff --git a/february-patient-server/src/main/resources/mapper/patient/DepartmentMapper.xml b/february-patient-server/src/main/resources/mapper/patient/DepartmentMapper.xml new file mode 100644 index 0000000..8701867 --- /dev/null +++ b/february-patient-server/src/main/resources/mapper/patient/DepartmentMapper.xml @@ -0,0 +1,14 @@ + + + + + + + + + +