package com.ssj.service.sys.codeexchange;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ssj.bean.sys.codeexchange.CodeExchange;
import com.ssj.framework.core.common.service.BaseService;

import java.util.Map;


/**
 * @author Mount Liu
 * @date 2019/5/9
 */
public interface CodeExchangeService extends BaseService<CodeExchange, String> {

    /**
     * 分页查询列表
     *
     * @param params
     * @param sp
     * @return
     */
    //Page<CodeExchange> findByPage(Map<String, Object> params, Pageable sp);

    /**
     * 分页查询列表
     * @param pageNo
     * @param pageSize
     * @param params
     * @return
     */
    Page<CodeExchange> findByPage(int pageNo, int pageSize, Map<String, Object> params);

    /**
     * 查询兑换码信息
     *
     * @param code
     * @return
     */
    CodeExchange findByCode(String code);

    /**
     * 查找一条有效的优惠码(没有分配受益人)
     * @return
     */
    CodeExchange findValidCode();

}
