From e56d4e24237df98b765259f8321049af6f19df93 Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Fri, 22 Jan 2021 11:29:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=97=85=E6=82=A3=E6=8A=A5?= =?UTF-8?q?=E9=A4=90=E6=8C=89=E6=97=A5=E6=9C=9F=E7=BB=9F=E8=AE=A1=E7=94=A8?= =?UTF-8?q?=E9=A4=90=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/fantang/mapper/FtReportMealsDaoMapper.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReportMealsDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReportMealsDaoMapper.java index 9c435761b..00402ff39 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReportMealsDaoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReportMealsDaoMapper.java @@ -4,6 +4,7 @@ import cn.hutool.core.date.DateTime; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.fantang.domain.FtReportMealsDao; import com.ruoyi.system.fantang.entity.ReportMealsPriceEntity; +import com.ruoyi.system.fantang.vo.FtReportMealVo; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; @@ -43,6 +44,11 @@ public interface FtReportMealsDaoMapper extends BaseMapper { List listAllNutrition(FtReportMealsDao ftReportMealsDao); - @Select("SELECT a.patient_id,sum(a.price) as dinner_total_price , sum(a.nutrition_food_price ) as nutrition_total_price , sum(a.total_price) as sum_total_price FROM ft_report_meals a where a.patient_id = #{patientId} AND a.settlement_flag = 0 AND a.dining_flag = 1") - ReportMealsPriceEntity sumAllTotalPrice(Long patientId); + @Select("SELECT a.type, a.foods, count(a.foods) as count, b.depart_id,c.depart_name\n" + + "from ft_report_meals a \n" + + "LEFT JOIN ft_patient b on a.patient_id = b.patient_id\n" + + "LEFT JOIN ft_depart c on b.depart_id = c.depart_id \n" + + "where b.depart_id = #{departId} and a.dining_at BETWEEN #{beginOfDay} and #{endOfDay}\n" + + "GROUP BY a.type, foods") + List getStatisticsFoods(Integer departId, DateTime beginOfDay, DateTime endOfDay); }