package com.openhis.web.departmentmanage.mapper;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.web.departmentmanage.dto.DepartmentDetailDto;
import com.openhis.web.departmentmanage.dto.DepartmentDto;
import com.openhis.web.departmentmanage.dto.DepartmentDeviceInfoDto;
import com.openhis.web.departmentmanage.dto.DepartmentSearchParam;

/**
 * 科室材料共通 mapper
 *
 * @author yuxj
 * @date 2025-07-22
 */
@Repository
public interface DepartmentCommonMapper {
    /**
     * 根据供应商获取物资
     *
     * @param page 分页
     * @param queryWrapper 查询条件
     * @param locationId 仓库id
     * @return 物资信息
     */

    Page<DepartmentDeviceInfoDto> getDeviceInfo(
        @Param("page") Page<DepartmentDeviceInfoDto> page,
        @Param(Constants.WRAPPER) QueryWrapper<DepartmentSearchParam> queryWrapper,
        @Param("locationId") Long locationId, @Param("supplierId") Long supplierId);

    /**
     * 查询订货单分页列表
     *
     * @param page 分页
     * @param queryWrapper 查询条件
     * @param originalBusNoFlg 再生成单据号flg
     * @param locationFlg 仓库flg
     * @return 订货单分页列表
     */
    Page<DepartmentDto> getPage(@Param("page") Page<DepartmentDto> page,
        @Param(Constants.WRAPPER) QueryWrapper<DepartmentSearchParam> queryWrapper,
        @Param("originalBusNoFlg") String originalBusNoFlg, @Param("locationFlg") String locationFlg);

    /**
     * 查询单据详情
     *
     * @param page 分页
     * @param busNo 单据号
     * @return 单据详情
     */
    Page<DepartmentDetailDto> getDetailPage(@Param("page") Page<DepartmentDetailDto> page,
        @Param("busNo") String busNo);
}
