package thyyxxk.webserver.service.ybkf;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import thyyxxk.webserver.dao.his.ybkf.YbUtilDao;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.utils.ResultVoUtil;

import java.util.List;
import java.util.Map;

/**
 * @ClassName YbUtilService
 * @Description 医保报表统计工具类
 * @Author hsh
 * @Date 2022/8/9 16:24
 **/
@Service
public class YbUtilService {

    private final YbUtilDao dao;

    @Autowired
    public YbUtilService(YbUtilDao dao) {
        this.dao = dao;
    }

    public ResultVo<List<Map<String, Object>>> selectSmallDept(Map<String, String> map) {
        String str = map.get("str");
        List<Map<String, Object>> list = dao.selectSmallDept(str);
        return ResultVoUtil.success(list);
    }

    public ResultVo<List<Map<String, Object>>> selectDoctor(Map<String, String> map) {
        String str = map.get("str");
        List<Map<String, Object>> list = dao.selectDoctor(str);
        return ResultVoUtil.success(list);
    }

    public ResultVo<List<Map<String, Object>>> selectAllSmallDept(Map<String, String> map) {
        String str = map.get("str");
        List<Map<String, Object>> list = dao.selectAllSmallDept(str);
        return ResultVoUtil.success(list);
    }

    public ResultVo<List<Map<String, Object>>> selectAllDoctor(Map<String, String> map) {
        String str = map.get("str");
        String dept = map.get("dept");
        List<Map<String, Object>> list = dao.selectAllDoctor(str, dept);
        return ResultVoUtil.success(list);
    }

    /**
     * @description: 查询所有科室
     * @author: hsh
     * @date: 2023/7/26 10:31
     * @param: [map]
     * @return: ResultVo<List<Map<String,Object>>>
     **/
    public ResultVo<List<Map<String, Object>>> selectAllDept(Map<String, String> map) {
        String str = map.get("str");
        List<Map<String, Object>> list = dao.selectAllDept(str);
        return ResultVoUtil.success(list);
    }

    /**
     * @description: 查询所有号别
     * @author: hsh
     * @date: 2023/8/3 15:32
     * @param: [map]
     * @return: ResultVo<List<Map<String,Object>>>
     **/
    public ResultVo<List<Map<String, Object>>> selectAllRegLevel(Map<String, String> map) {
        String str = map.get("str");
        List<Map<String, Object>> list = dao.selectAllRegLevel(str);
        return ResultVoUtil.success(list);
    }

}
