package cn.iocoder.yudao.module.course.mapper;

import cn.iocoder.yudao.module.course.entity.SchoolCommission;
import cn.iocoder.yudao.module.course.vo.CommissionExportVO;
import cn.iocoder.yudao.module.course.vo.CommissionStatisticsVO;
import cn.iocoder.yudao.module.course.vo.FinanceDeductInfoVO;
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 提成记录 Mapper
 *
 * @author 若依
 */
@Mapper
public interface SchoolCommissionMapper extends BaseMapper<SchoolCommission> {

    /**
     * 分页查询教练提成记录
     *
     * @param entity {@link SchoolCommissionVO}
     * @param page   分页参数
     * @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.course.vo.SchoolCommissionVO>
     * @author PQZ
     * @date 14:07 2025/2/19
     **/
    IPage<SchoolCommissionVO> queryPage(@Param("entity") SchoolCommissionVO entity, Page<SchoolCommissionVO> page);

    List<SchoolCommission> selectByCoachId(@Param("coachId")Long coachId,@Param("startTime")String startTime,@Param("endTime")String endTime);

    /**
     * 根据id获取提成记录详细信息
     */
    SchoolCommissionVO getSchoolCommissionById(@Param("id") String id);

    /**
     * 教练提成合计列表
     */
    List<SchoolCommissionVO> getCoachTotalCommission(@Param("entity") SchoolCommissionVO entity);

    /**
     * 教练提成列表
     */
    IPage<SchoolCommissionVO> getCommissionListByCoachId(@Param("entity") SchoolCommissionVO entity, Page<SchoolCommissionVO> page);

    /**
     * 需要导出的数据
     */
    IPage<CommissionExportVO> getCommissionListExport(@Param("entity") CommissionExportVO entity, Page<CommissionExportVO> page);


    CommissionStatisticsVO getCommissionStatistics(@Param("entity") CommissionExportVO entity);

    /**
     * 首页财务应付部分
     */
    List<FinanceDeductInfoVO> getFinanceDeductList(@Param("entity") FinanceDeductInfoVO entity);
    IPage<FinanceDeductInfoVO> getFinanceDeductDetailsListByCoach(@Param("entity") FinanceDeductInfoVO entity, Page<FinanceDeductInfoVO> page);
}
