package thyyxxk.webserver.controller.dictionary;

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.config.exception.ExceptionEnum;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.dictionary.DoctorBaseZd;
import thyyxxk.webserver.service.datamodify.DoctorBaseZdDaoService;
import thyyxxk.webserver.utils.ResultVoUtil;

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

/**
 * @Description:
 * @Author:lihong
 * @Date: 2025/5/20
 */
@RestController
@RequestMapping("/doctorBaseZd")
public class DoctorBaseZdController {
    @Resource
    private DoctorBaseZdDaoService service;

    @PostMapping("/queryDoctorBaseZd")
    public ResultVo<List<DoctorBaseZd>> queryDoctorBaseZd(@RequestBody DoctorBaseZd param){
        return ResultVoUtil.success(service.queryDoctorBaseZd(param));
    }
    @PostMapping("/updateDelFlag")
    public ResultVo<String> updateDelFlag(@RequestBody DoctorBaseZd param){
        service.updateDelFlag(param);
        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
    }

    @PostMapping("/saveDoctorBaseZd")
    public ResultVo<String> saveDoctorBaseZd(@RequestBody DoctorBaseZd param){
        service.saveDoctorBaseZd(param);
        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE,"保存成功");
    }

    /**
     * @description:保存试管收费
     * @author: lihong
     * @date: 2025/5/20 10:09
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.lang.String>
     **/
    @PostMapping("/batchJyZdTubeCharge")
    public ResultVo<String> batchJyZdTubeCharge(@RequestBody DoctorBaseZd param){
        service.batchJyZdTubeCharge(param);
        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE,"保存成功");
    }

    @PostMapping("/deleteZdTubeCharge")
    public ResultVo<String> deleteZdTubeCharge(@RequestBody DoctorBaseZd param){
        service.deleteZdTubeCharge(param);
        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE,"删除成功");
    }

    @PostMapping("/queryZdItemChargePage")
    public ResultVo queryZdItemChargePage(@RequestBody DoctorBaseZd param){
        return service.queryZdItemChargePage(param);
    }

    /**
     * @description: 查询试管收费
     * @author: lihong
     * @date: 2025/5/20 10:10
     * @param: code
     * @return: thyyxxk.webserver.entity.ResultVo
     **/
    @GetMapping("/queryJyZdTubeChargeByCode")
    public ResultVo queryJyZdTubeChargeByCode(String code){
        return ResultVoUtil.success(service.queryJyZdTubeChargeByCode(code));
    }

}
