jpz8.0
parent
4bf159ea48
commit
b5c248d6e5
|
@ -0,0 +1,36 @@
|
||||||
|
package doctor.controller;
|
||||||
|
|
||||||
|
import doctor.common.core.domain.HealthR;
|
||||||
|
import doctor.domain.entity.DoctorEntity;
|
||||||
|
import doctor.service.DoctorService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.print.Doc;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: Medical_Treatment
|
||||||
|
* @BelongsPackage: doctor.controller
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2024/1/15 11:30
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/user/inquiry/v1")
|
||||||
|
public class DoctorController {
|
||||||
|
@Autowired
|
||||||
|
private DoctorService doctorService;
|
||||||
|
@GetMapping("/findDoctorList")
|
||||||
|
public HealthR<List<DoctorEntity>> findDoctorList(@RequestParam Integer deptId,
|
||||||
|
@RequestParam Integer condition,
|
||||||
|
@RequestParam Integer sortBy,
|
||||||
|
@RequestParam(value = "page",defaultValue = "1") Integer page,
|
||||||
|
@RequestParam(value = "count",defaultValue = "5") Integer count
|
||||||
|
){
|
||||||
|
List<DoctorEntity> list=doctorService.findDoctorList(deptId);
|
||||||
|
return HealthR.ok(list);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package doctor.domain.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: Medical_Treatment
|
||||||
|
* @BelongsPackage: doctor.domain.entity
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2024/1/15 11:32
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class DoctorEntity {
|
||||||
|
private Integer id;
|
||||||
|
private Integer departmentId;
|
||||||
|
private String email;
|
||||||
|
private String userName;
|
||||||
|
private Integer reviewStatus;
|
||||||
|
private String phone;
|
||||||
|
private String pwd;
|
||||||
|
private String name;
|
||||||
|
private String imagePic;
|
||||||
|
private String inauguralHospital;
|
||||||
|
private String personalProfile;
|
||||||
|
private String goodFieId;
|
||||||
|
private Date createTime;
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package doctor.domain.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: Medical_Treatment
|
||||||
|
* @BelongsPackage: doctor.domain.vo
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2024/1/15 11:38
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class DoctorVo {
|
||||||
|
private Integer doctorId;
|
||||||
|
private String doctorName;
|
||||||
|
private String imagePic;
|
||||||
|
private String jobTitle;
|
||||||
|
private String inauguralHospital;
|
||||||
|
private double praise;
|
||||||
|
private Integer serverNum;
|
||||||
|
private Integer servicePrice;
|
||||||
|
private Integer praiseNum;
|
||||||
|
private Integer badNum;
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package doctor.mapper;
|
||||||
|
|
||||||
|
import doctor.domain.entity.DoctorEntity;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: Medical_Treatment
|
||||||
|
* @BelongsPackage: doctor.mapper
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2024/1/15 11:54
|
||||||
|
*/
|
||||||
|
@MapperScan
|
||||||
|
public interface DoctorMapper {
|
||||||
|
List<DoctorEntity> findDoctorList(Integer deptId);
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package doctor.service;
|
||||||
|
|
||||||
|
import doctor.domain.entity.DoctorEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: Medical_Treatment
|
||||||
|
* @BelongsPackage: doctor.service
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2024/1/15 11:32
|
||||||
|
*/
|
||||||
|
public interface DoctorService {
|
||||||
|
List<DoctorEntity> findDoctorList(Integer deptId);
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package doctor.service.impl;
|
||||||
|
|
||||||
|
import doctor.domain.entity.DoctorEntity;
|
||||||
|
import doctor.mapper.DoctorMapper;
|
||||||
|
import doctor.service.DoctorService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: Medical_Treatment
|
||||||
|
* @BelongsPackage: doctor.service.impl
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2024/1/15 11:45
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DoctorServiceimpl implements DoctorService {
|
||||||
|
@Autowired
|
||||||
|
private DoctorMapper doctorMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DoctorEntity> findDoctorList(Integer deptId) {
|
||||||
|
return doctorMapper.findDoctorList(deptId);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="doctor.mapper.DoctorMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="findDoctorList" resultType="doctor.domain.entity.DoctorEntity">
|
||||||
|
select *
|
||||||
|
from doctor where department_id = #{deptId}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
2
|
Loading…
Reference in New Issue