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

import cn.iocoder.yudao.module.base.entity.DlDriveSchoolCourse;
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCoachRespVO;
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCourseVO;
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;

/**
 * 驾校课程Mapper
 *
 * @author pqz
 */
@Mapper
public interface DlDriveSchoolCourseMapper extends BaseMapper<DlDriveSchoolCourse> {
    /**
     * 分页查询驾校课程
     *
     * @param entity {@link DlDriveSchoolCourseVO}
     * @param page   分页参数
     * @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.DlDriveSchoolCourseVO>
     * @author PQZ
     * @date 7:10 2025/1/17
     **/
    IPage<DlDriveSchoolCourseVO> queryListPage(@Param("entity") DlDriveSchoolCourseVO entity, Page<DlDriveSchoolCourseVO> page);

    /**
     * 删除课程时，判断订单中是否存在已报名该课程的订单
     */
    Integer orderCountByCourseId(@Param("courseId") String courseId);

}
