package thyyxxk.webserver.controller.medicaladvice.common;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.medicaladvice.medicamanage.common.YzYpPageNo;
import thyyxxk.webserver.service.medicaladvice.common.MedicalCommonService;
import thyyxxk.webserver.utils.ResultVoUtil;

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

/**
 * @Description:医嘱公共
 * @Author:lihong
 * @Date: 2023/9/22
 */
@RestController
@RequestMapping("/medicalAdvice/medicalCommon")
public class MedicalCommonController {
    @Autowired
    private MedicalCommonService service;
    /**
     * @description:查询药房
     * @author: lihong
     * @date: 2023/9/22 11:40
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<java.util.Map<java.lang.String,java.lang.Object>>>
     **/
    @GetMapping("/queryYpZdGroupName")
    public ResultVo<List<Map<String,Object>>> queryYpZdGroupName(){
       return ResultVoUtil.success(service.queryYpZdGroupName());
    }

    /**
     * @description:查询药单
     * @author: lihong
     * @date: 2023/9/22 11:40
     * @param: wardCode
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<thyyxxk.webserver.entity.medicaladvice.medicamanage.common.YzYpPageNo>>
     **/
    @PostMapping("/queryYzYpPageNo")
    public ResultVo<IPage> queryYzYpPageNo(@RequestBody YzYpPageNo ypPageNo){
        return ResultVoUtil.success(service.queryYzYpPageNo(ypPageNo));
    }
    /**
     * @description:查询项目细类
     * @author: lihong
     * @date: 2023/11/9 10:14
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<java.util.Map<java.lang.String,java.lang.Object>>>
     **/
    @PostMapping("/queryItemsSubclass")
    public ResultVo<List<Map<String,Object>>> queryItemsSubclass(@RequestBody Map<String,String> param){
        return ResultVoUtil.success(service.queryItemsSubclass(param));
    }
    /**
     * @description:查询项目分类
     * @author: lihong
     * @date: 2023/11/9 10:34
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<java.util.Map<java.lang.String,java.lang.Object>>>
     **/
    @GetMapping("/queryItemsList")
    public ResultVo<List<Map<String,Object>>> queryItemsList(){
        return ResultVoUtil.success(service.queryItemsList());
    }

    /**
     * @description:查询项目明细 根据code查询
     * @author: lihong
     * @date: 2023/11/9 10:35
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<java.util.Map<java.lang.String,java.lang.Object>>>
     **/
    @PostMapping("/queryItemDetail")
    public ResultVo<List<Map<String,Object>>> queryItemDetail(@RequestBody Map<String,String> params){
        return ResultVoUtil.success(service.queryItemDetail(params));
    }

    /**
     * @description: 查询所有科室病房
     * @author: lihong
     * @date: 2024/1/3 15:12
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<java.util.Map<java.lang.String,java.lang.Object>>>
     **/
    @GetMapping("/queryZyWard")
    public ResultVo<List<Map<String,Object>>> queryZyWard(){
        return ResultVoUtil.success(service.queryZyWard());
    }

    /**
     * @description: 查询科室下的小科室
     * @author: lihong
     * @date: 2024/1/3 15:15
     * @param: params
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<java.util.Map<java.lang.String,java.lang.Object>>>
     **/
    @PostMapping("/querySmallWard")
    public ResultVo<List<Map<String,Object>>> querySmallWard(@RequestBody Map<String,String> params){
        return ResultVoUtil.success(service.querySmallWard(params));
    }

}
