package com.bonus.boot.manager.statistics.controller;

import com.bonus.boot.manager.basic.entity.MapBean;
import com.bonus.boot.manager.basic.entity.PersonnelLibraryBean;
import com.bonus.boot.manager.health.dao.AppontdisposDao;
import com.bonus.boot.manager.manager.annotation.LogAnnotation;
import com.bonus.boot.manager.manager.entity.R;
import com.bonus.boot.manager.manager.utils.UserUtil;
import com.bonus.boot.manager.physical.service.RetiremenService;
import com.bonus.boot.manager.statistics.dao.ResStatisticsDao;
import com.bonus.boot.manager.statistics.service.ResStatisticsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/** 预约统计
 * @author xliu
 * @date 2023/6/10 10:12
 */
@RestController
@RequestMapping("resStatistics")
public class ResStatisticsController {
    /**
     * 服务对象
     */
    @Resource
    private ResStatisticsService service;

    @Resource
    private ResStatisticsDao dao;



    @LogAnnotation
    @PostMapping("getMsgContent")
    @ApiOperation(value = "预约统计")
    public R getList(MapBean o){
        String hospitalId = UserUtil.getLoginUser().getHospitalId();
        o.setHospitalId(hospitalId);
        System.err.println("MapBean="+o);
        List<MapBean> list = service.getList(o);
        return list.size() > 0 ? R.okTable(list, list.size()):R.failTable("暂无数据");
    }
    @LogAnnotation
    @PostMapping("getChildList")
    @ApiOperation(value = "预约统计详情-列表")
    public R getChildList(PersonnelLibraryBean o){
        System.err.println("MapBean="+o);
        List<PersonnelLibraryBean> list = service.getChildList(o);
        return list.size() > 0 ? R.okTable(list, list.size()):R.failTable("暂无数据");
    }




}

