package top.tqx.demo_1.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.tqx.demo_1.entity.Feedback;

import java.util.List;

@Mapper
public interface FeedbackMapper extends BaseMapper<Feedback> {

    List<Feedback> selectByUserId(Long userId);

    List<Feedback> selectBySessionId(String sessionId);

    List<Feedback> selectBadCases();

    int countByRating(@Param("rating") Integer rating);

    double avgRating();

    List<Feedback> selectRecent(int limit);
}