package org.jeecg.modules.system.app.mapper;

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.Param;
import org.jeecg.modules.system.app.dto.evaluate.FindEvaluateRequestDTO;
import org.jeecg.modules.system.app.dto.evaluate.FindEvaluateResponseDTO;
import org.jeecg.modules.system.app.entity.Evaluate;

import java.util.List;

/**
 * @Description: 评价管理
 * @Author: jeecg-boot
 * @Date:   2025-07-07
 * @Version: V1.0
 */
public interface EvaluateMapper extends BaseMapper<Evaluate> {

    IPage<FindEvaluateResponseDTO> findPage(@Param("page") Page<FindEvaluateResponseDTO> page,@Param("findEvaluateRequestDTO") FindEvaluateRequestDTO findEvaluateRequestDTO);

    IPage<FindEvaluateResponseDTO> findBySiteId(@Param("page")  Page<FindEvaluateResponseDTO> page,@Param("siteId")  String siteId);

    IPage<FindEvaluateResponseDTO> findByCoursesId(@Param("page") Page<FindEvaluateResponseDTO> page,@Param("coursesIds") List<String> coursesIds);

    Evaluate findByOrderId(@Param("orderId") String orderId);

    Long findByAverageScore(@Param("siteId")String siteId);

    Long findByScoreNum(@Param("siteId")String siteId);

    Long findByAverageScoreByCoursesId(@Param("coursesIds") List<String> coursesIds);

    Long findByScoreNumByCoursesId(@Param("coursesIds") List<String> coursesIds);

    Long findByGoodScoreNum(@Param("siteId")String siteId);

    Long findByGoodScoreNumByCoursesId(@Param("coursesIds")List<String> coursesIds);

    String findPositiveRating(@Param("id") String id);
}
