增加病患报餐按日期统计用餐数据接口

This commit is contained in:
czx 2021-01-22 11:29:52 +08:00
parent 1de3f40e97
commit e56d4e2423

View File

@ -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<FtReportMealsDao> {
List<FtReportMealsDao> 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<FtReportMealVo> getStatisticsFoods(Integer departId, DateTime beginOfDay, DateTime endOfDay);
}