From 9604f9495d8fa902a0394aa1228e45397fa264a4 Mon Sep 17 00:00:00 2001 From: ryoeiken <754264374@qq.com> Date: Thu, 31 Dec 2020 10:13:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=B9=E6=8D=AE=E7=A7=91?= =?UTF-8?q?=E5=AE=A4=E8=8E=B7=E5=8F=96=E6=AC=A1=E6=97=A5=E6=8A=A5=E9=A4=90?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ClientPatientController.java | 5 +- .../fantang/mapper/FtPatientDaoMapper.java | 2 +- .../fantang/service/IFtPatientDaoService.java | 5 +- .../service/impl/FtPatientDaoServiceImpl.java | 2 +- .../mapper/fantang/FtPatientDaoMapper.xml | 90 +++++++++---------- 5 files changed, 50 insertions(+), 54 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientPatientController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientPatientController.java index 547529fff..09daf870e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientPatientController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientPatientController.java @@ -13,6 +13,7 @@ import com.ruoyi.system.fantang.domain.FtReportMealsDao; import com.ruoyi.system.fantang.domain.FtStaffInfoDao; import com.ruoyi.system.fantang.service.*; import com.ruoyi.system.fantang.vo.FtDepartVo; +import com.ruoyi.system.fantang.vo.FtPatientVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -79,9 +80,9 @@ public class ClientPatientController extends BaseController { DateTime tomorrow = DateUtil.tomorrow(); String formatDate = DateUtil.formatDate(tomorrow); - FtDepartVo ftDepartVo = iFtPatientDaoService.getReportMealsByDepart(departId, formatDate); + List patientVos = iFtPatientDaoService.getReportMealsByDepart(departId, formatDate); - return AjaxResult.success(ftDepartVo); + return AjaxResult.success(patientVos); } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtPatientDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtPatientDaoMapper.java index b3d249c46..51e3916f0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtPatientDaoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtPatientDaoMapper.java @@ -54,5 +54,5 @@ public interface FtPatientDaoMapper extends BaseMapper { List getReportMealsToday(@Param("createAt") String createAt, @Param("patientId") Long patientId); - FtDepartVo getReportMealsByDepart(@Param("departId") Long departId, @Param("createAt") String createAt); + List getReportMealsByDepart(@Param("departId") Long departId, @Param("createAt") String createAt); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtPatientDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtPatientDaoService.java index 29e3bac05..9b6bf8767 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtPatientDaoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtPatientDaoService.java @@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.fantang.domain.FtPatientDao; import com.ruoyi.system.fantang.vo.FtDepartVo; +import com.ruoyi.system.fantang.vo.FtPatientVo; + +import java.util.List; /** * 病人管理Service接口 @@ -15,5 +18,5 @@ public interface IFtPatientDaoService extends IService { AjaxResult getReportMealsToday(String createAt, Long patientId); - FtDepartVo getReportMealsByDepart(Long departId, String createAt); + List getReportMealsByDepart(Long departId, String createAt); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtPatientDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtPatientDaoServiceImpl.java index e347ad950..6da5f0036 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtPatientDaoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtPatientDaoServiceImpl.java @@ -26,7 +26,7 @@ public class FtPatientDaoServiceImpl extends ServiceImpl getReportMealsByDepart(Long departId, String createAt) { return this.baseMapper.getReportMealsByDepart(departId,createAt); } } diff --git a/ruoyi-system/src/main/resources/mapper/fantang/FtPatientDaoMapper.xml b/ruoyi-system/src/main/resources/mapper/fantang/FtPatientDaoMapper.xml index d5d30b8c6..a0c562c54 100644 --- a/ruoyi-system/src/main/resources/mapper/fantang/FtPatientDaoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/fantang/FtPatientDaoMapper.xml @@ -1,24 +1,35 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - + + + + + + + + @@ -36,42 +47,23 @@ WHERE a.patient_id = #{patientId} and c.create_at = #{createAt} - + SELECT a.patient_id, + a.`name`, + b.depart_name, + a.bed_id, + a.hospital_id, + c.create_at, + c.foods, + c.id, + c.nutrition_food_id, + c.type + from ft_patient a + LEFT JOIN ft_depart b on a.depart_id = b.depart_id + RIGHT JOIN ft_report_meals c on a.patient_id = c.patient_id + WHERE b.depart_id = #{departId} + and c.create_at = #{createAt} - - - - - - - - - - - - - - - \ No newline at end of file