package com.hzs.activity.add.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.activity.add.param.AcAddUpgradeListParam;
import com.hzs.activity.add.param.AcAddUpgradeRuleConfigParam;
import com.hzs.common.domain.activity.add.AcAddUpgradeConfig;
import com.hzs.activity.add.vo.AcAddUpgradeListVO;
import com.hzs.common.domain.activity.add.ext.AcAddUpgradeConfigExt;
import com.hzs.common.domain.system.config.BdGrade;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 加购升级配置表 Mapper 接口
 * </p>
 *
 * @author bd
 * @since 2025-10-13
 */
public interface AcAddUpgradeConfigMapper extends BaseMapper<AcAddUpgradeConfig> {

    List<AcAddUpgradeRuleConfigParam> selectListByOrderType(@Param("pkId") Integer pkId,
                                                            @Param("orderType") Integer orderType);

    List<Integer> selectOrderTypeByBaseId(@Param("pkId") Integer pkId);

    List<AcAddUpgradeListVO> queryList(AcAddUpgradeListParam param);

    BdGrade selectGradeValue(@Param("pkId") Integer pkId);

    /**
     * 查询符合条件的规则
     */
    List<AcAddUpgradeConfigExt> getUpgradeConfig(@Param("orderType") Integer orderType,
                                                 @Param("pkGrade") Integer pkGrade);

}
