package cn.sh.stc.sict.theme.hphy.controller.web;

import cn.sh.stc.sict.cloud.common.core.util.R;
import cn.sh.stc.sict.cloud.common.data.util.HySearchWrapperUtil;
import cn.sh.stc.sict.theme.common.dto.MyPage;
import cn.sh.stc.sict.theme.hphy.model.HphyWszyHospitalizedDrugDelivery;
import cn.sh.stc.sict.theme.hphy.service.HphyWszyHospitalizedDrugDeliveryService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 住院发药汇总表
 *
 * @author F_xh。
 * @date 2020-09-29 15:05:29
 */
@RestController
@RequestMapping("/hphywszyhospitalizeddrugdelivery")
@AllArgsConstructor
@Slf4j
@Api(value = "住院发药汇总表 controller", tags = "[D]住院发药汇总表")
public class HphyWszyHospitalizedDrugDeliveryController {

    private HphyWszyHospitalizedDrugDeliveryService hphyWszyHospitalizedDrugDeliveryService;

    /**
     * 分页查询
     * @param page 分页对象
     * @return
     */
    @ApiOperation("分页查询 住院发药汇总表")
    @GetMapping("/page")
    public R getHphyWszyHospitalizedDrugDeliveryPage(MyPage page) {
        LambdaQueryWrapper<HphyWszyHospitalizedDrugDelivery> wrapper = new LambdaQueryWrapper<>();
        HySearchWrapperUtil.setWrapper(wrapper, page.getParam());
        return  new R<>(hphyWszyHospitalizedDrugDeliveryService.page(page,wrapper));
    }
}
