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); }