医生查看患者对自己的评价
parent
569a31f201
commit
48a65f04f2
|
@ -1,10 +1,38 @@
|
||||||
package com.four.doctor.controller;
|
package com.four.doctor.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.four.common.core.domain.Result;
|
||||||
|
import com.four.common.duck.interrogation.PatientEvaluator;
|
||||||
|
import com.four.doctor.service.PatientDoctorService;
|
||||||
|
import lombok.experimental.PackagePrivate;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
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.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/patient")
|
@RequestMapping("/patientDoctor")
|
||||||
|
@Log4j2
|
||||||
public class PatientDoctorController {
|
public class PatientDoctorController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PatientDoctorService patientDoctorService;
|
||||||
|
@Autowired
|
||||||
|
private HttpServletRequest request;
|
||||||
|
|
||||||
|
@PostMapping("/ShowPatientEvaluatorDoctor")
|
||||||
|
public Result<List<PatientEvaluator>> ShowPatientEvaluatorDoctor(@RequestParam Long registrationInformationId){
|
||||||
|
log.info("功能名称:医生查看患者对自己评价,请求URI:{},请求方法:{},请求参数:{}",request.getRequestURI(),
|
||||||
|
request.getMethod(), JSONObject.toJSONString(registrationInformationId));
|
||||||
|
List<PatientEvaluator> list=patientDoctorService.ShowPatientEvaluatorDoctor(registrationInformationId);
|
||||||
|
log.info("功能名称:医生查看患者对自己的评价,请求URI:{},请求方法:{},返回结果:{}",request.getRequestURI(),
|
||||||
|
request.getMethod(),JSONObject.toJSONString(list));
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.four.doctor.mapper;
|
||||||
|
|
||||||
|
import com.four.common.duck.interrogation.PatientEvaluator;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PatientDoctorMapper {
|
||||||
|
List<PatientEvaluator> ShowPatientEvaluatorDoctor(@Param("registrationInformationId") Long registrationInformationId);
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.four.doctor.service.Impl;
|
||||||
|
|
||||||
|
import com.four.common.duck.interrogation.PatientEvaluator;
|
||||||
|
import com.four.doctor.mapper.PatientDoctorMapper;
|
||||||
|
import com.four.doctor.service.PatientDoctorService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PatientDoctorServiceImpl implements PatientDoctorService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PatientDoctorMapper patientDoctorMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PatientEvaluator> ShowPatientEvaluatorDoctor(Long registrationInformationId) {
|
||||||
|
List<PatientEvaluator> patientEvaluatorList=patientDoctorMapper.ShowPatientEvaluatorDoctor(registrationInformationId);
|
||||||
|
return patientEvaluatorList;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.four.doctor.service;
|
||||||
|
|
||||||
|
import com.four.common.duck.interrogation.PatientEvaluator;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface PatientDoctorService {
|
||||||
|
List<PatientEvaluator> ShowPatientEvaluatorDoctor(Long registrationInformationId);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?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="com.four.doctor.mapper.PatientDoctorMapper">
|
||||||
|
|
||||||
|
<resultMap id="patientEvaluatorDoctor" type="com.four.common.duck.interrogation.PatientEvaluator">
|
||||||
|
<id property="patientEvaluatorId" column="patient_evaluator_id"/>
|
||||||
|
<result property="patientId" column="patient_id"/>
|
||||||
|
<result property="registrationInformationId" column="registration_information_id"/>
|
||||||
|
<result property="commentContent" column="comment_content"/>
|
||||||
|
<result property="commentTime" column="comment_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectPatientDoctor">
|
||||||
|
select patient_evaluator_id,
|
||||||
|
patient_id,
|
||||||
|
registration_information_id,
|
||||||
|
comment_content,
|
||||||
|
comment_time
|
||||||
|
from patient_evaluation
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="ShowPatientEvaluatorDoctor" resultMap="patientEvaluatorDoctor">
|
||||||
|
<include refid="selectPatientDoctor"></include>
|
||||||
|
<where>
|
||||||
|
<if test="null!=registration_information_id and ''!=registration_information_id">
|
||||||
|
registration_information_id=#{registrationInformationId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue