diff --git a/src/main/java/com/four/doctor/controller/GiftRecordDoctorController.java b/src/main/java/com/four/doctor/controller/GiftRecordDoctorController.java new file mode 100644 index 0000000..3fbc5b1 --- /dev/null +++ b/src/main/java/com/four/doctor/controller/GiftRecordDoctorController.java @@ -0,0 +1,38 @@ +package com.four.doctor.controller; + +import com.alibaba.fastjson.JSONObject; +import com.four.common.duck.Result; +import com.four.common.duck.domain.GiftRecord; +import com.four.doctor.service.GiftRecordDoctorService; +import lombok.extern.log4j.Log4j2; +import org.apache.catalina.LifecycleState; +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; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +@RestController +@RequestMapping("/giftRecordDoctor") +@Log4j2 +public class GiftRecordDoctorController { + + @Autowired + private GiftRecordDoctorService giftRecordDoctorService; + @Autowired + private HttpServletRequest request; + + @PostMapping("/ShowGiftRecordDoctor") + public Result> ShowGiftRecordDoctor(@RequestParam Long registrationInformationId){ + log.info("功能名称:查看患者送给自己的礼物,请求URI:{},请求方法:{},请求参数:{}",request.getRequestURI(), + request.getMethod(), JSONObject.toJSONString(registrationInformationId)); + List list=giftRecordDoctorService.ShowGiftRecordDoctor(registrationInformationId); + log.info("功能名称:查看患者送给自己的礼物,请求URI:{},请求方法:{},返回结果:{}",request.getRequestURI(), + request.getMethod(),JSONObject.toJSONString(list)); + return Result.success(list); + + } +} diff --git a/src/main/java/com/four/doctor/controller/HistoricalDoctorController.java b/src/main/java/com/four/doctor/controller/HistoricalDoctorController.java index c3226d0..8c61c9f 100644 --- a/src/main/java/com/four/doctor/controller/HistoricalDoctorController.java +++ b/src/main/java/com/four/doctor/controller/HistoricalDoctorController.java @@ -8,6 +8,7 @@ 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.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; @@ -29,7 +30,7 @@ public class HistoricalDoctorController { * @return */ @PostMapping("/ShowHistoricalDoctor") - public Result> ShowHistoricalDoctor(Long registrationInformationId){ + public Result> ShowHistoricalDoctor(@RequestParam Long registrationInformationId){ log.info("功能名称:医生查询历史问诊,请求URI:{},请求方法:{},请求参数:{}",request.getRequestURI(), request.getMethod(), JSONObject.toJSONString(registrationInformationId)); List list= historicalDoctorService.ShowHistoricalDoctor(registrationInformationId); diff --git a/src/main/java/com/four/doctor/mapper/GiftRecordDoctorMapper.java b/src/main/java/com/four/doctor/mapper/GiftRecordDoctorMapper.java new file mode 100644 index 0000000..1bb5def --- /dev/null +++ b/src/main/java/com/four/doctor/mapper/GiftRecordDoctorMapper.java @@ -0,0 +1,12 @@ +package com.four.doctor.mapper; + +import com.four.common.duck.domain.GiftRecord; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface GiftRecordDoctorMapper { + List ShowGiftRecordDoctor(@Param("registrationInformationId") Long registrationInformationId); +} diff --git a/src/main/java/com/four/doctor/service/GiftRecordDoctorService.java b/src/main/java/com/four/doctor/service/GiftRecordDoctorService.java new file mode 100644 index 0000000..d36bf07 --- /dev/null +++ b/src/main/java/com/four/doctor/service/GiftRecordDoctorService.java @@ -0,0 +1,10 @@ +package com.four.doctor.service; + +import com.four.common.duck.domain.GiftRecord; + +import java.util.List; + +public interface GiftRecordDoctorService { + List ShowGiftRecordDoctor(Long registrationInformationId); + +} diff --git a/src/main/java/com/four/doctor/service/Impl/GiftRecordDoctorServiceImpl.java b/src/main/java/com/four/doctor/service/Impl/GiftRecordDoctorServiceImpl.java new file mode 100644 index 0000000..9a68b85 --- /dev/null +++ b/src/main/java/com/four/doctor/service/Impl/GiftRecordDoctorServiceImpl.java @@ -0,0 +1,22 @@ +package com.four.doctor.service.Impl; + +import com.four.common.duck.domain.GiftRecord; +import com.four.doctor.mapper.GiftRecordDoctorMapper; +import com.four.doctor.service.GiftRecordDoctorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class GiftRecordDoctorServiceImpl implements GiftRecordDoctorService { + + @Autowired + private GiftRecordDoctorMapper giftDoctorMapper; + + @Override + public List ShowGiftRecordDoctor(Long registrationInformationId) { + List giftRecordList=giftDoctorMapper.ShowGiftRecordDoctor(registrationInformationId); + return giftRecordList; + } +} diff --git a/src/main/resources/mapper/GiftRecordDoctorMapper.xml b/src/main/resources/mapper/GiftRecordDoctorMapper.xml new file mode 100644 index 0000000..acb32bb --- /dev/null +++ b/src/main/resources/mapper/GiftRecordDoctorMapper.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + select gift_record_id, + giver_id, + registration_information_id, + gift_id, + gift_giving_time + from gift_record + + + + diff --git a/src/main/resources/mapper/HistoricalDoctorMapper.xml b/src/main/resources/mapper/HistoricalDoctorMapper.xml index f9a1948..fc0c2a6 100644 --- a/src/main/resources/mapper/HistoricalDoctorMapper.xml +++ b/src/main/resources/mapper/HistoricalDoctorMapper.xml @@ -22,7 +22,7 @@ - + registration_information_id=#{registrationInformationId}