增加病患报餐按日期统计用餐数据接口
This commit is contained in:
parent
1c4c13a83a
commit
bef478693e
@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.system.fantang.domain.*;
|
||||
import com.ruoyi.system.fantang.service.*;
|
||||
import com.ruoyi.system.fantang.vo.FtPatientVo;
|
||||
import com.ruoyi.system.fantang.vo.FtReportMealVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -204,4 +205,16 @@ public class ClientPatientController extends BaseController {
|
||||
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按照用餐类型统计指定日期的各菜品数量
|
||||
* @author 陈智兴
|
||||
* @param day:查询日期
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getStatisticsFoods")
|
||||
public AjaxResult getStatisticsFoods(@RequestParam("departId") Integer departId, @RequestParam("date") Date day) {
|
||||
List<FtReportMealVo> list = iFtReportMealsDaoService.getStatisticsFoods(departId, day);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
@ -42,4 +43,12 @@ public interface FtReportMealsDaoMapper extends BaseMapper<FtReportMealsDao> {
|
||||
List<FtReportMealsDao> listNutrition(@Param("beginOfDay") DateTime beginOfDay, @Param("endOfDay") DateTime endOfDay, FtReportMealsDao ftReportMealsDao);
|
||||
|
||||
List<FtReportMealsDao> listAllNutrition(FtReportMealsDao ftReportMealsDao);
|
||||
|
||||
@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(@Param("departId") Integer departId, @Param("beginOfDay") DateTime beginOfDay, @Param("endOfDay") DateTime endOfDay);
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ import com.ruoyi.system.fantang.entity.ReportMealsDayEntity;
|
||||
import com.ruoyi.system.fantang.entity.ReportMealsPriceEntity;
|
||||
import com.ruoyi.system.fantang.vo.FtReportMealVo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -37,5 +36,7 @@ public interface IFtReportMealsDaoService extends IService<FtReportMealsDao> {
|
||||
List<FtReportMealsDao> listNutrition(FtReportMealsDao ftReportMealsDao);
|
||||
|
||||
List<FtReportMealsDao> listAllNutrition(FtReportMealsDao ftReportMealsDao);
|
||||
|
||||
List<FtReportMealVo> getStatisticsFoods(Integer departId, Date day);
|
||||
}
|
||||
|
||||
|
@ -129,4 +129,10 @@ public class FtReportMealsDaoServiceImpl extends ServiceImpl<FtReportMealsDaoMap
|
||||
public List<FtReportMealsDao> listAllNutrition(FtReportMealsDao ftReportMealsDao) {
|
||||
return this.baseMapper.listAllNutrition(ftReportMealsDao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FtReportMealVo> getStatisticsFoods(Integer departId, Date day) {
|
||||
return this.baseMapper.getStatisticsFoods(departId, DateUtil.beginOfDay(day), DateUtil.endOfDay(day));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -37,19 +37,6 @@ public class FtReportMealVo extends FtReportMealsDao {
|
||||
|
||||
private String departCode;
|
||||
|
||||
// private Date createAt;
|
||||
//
|
||||
// private Integer type;
|
||||
//
|
||||
// private Long patientId;
|
||||
//
|
||||
// private String createBy;
|
||||
//
|
||||
// private String foods;
|
||||
//
|
||||
// private float price;
|
||||
//
|
||||
// private Integer settlementFlag;
|
||||
//
|
||||
private Integer count;
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user