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));
    }

}
