// 文件路径: com/yami/shop/dao/PointsRecordMapper.java
package com.yami.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yami.shop.bean.dto.ScoreDataDto;
import com.yami.shop.bean.model.PointsRecord;
import com.yami.shop.bean.po.PointsRecordPo;
import com.yami.shop.bean.vo.PointsRecordVo;
import com.yami.shop.common.util.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 积分记录详细 Mapper接口
 *
 * @author
 * @since 2025-09-XX
 */
public interface PointsRecordMapper extends BaseMapper<PointsRecord> {
    Long statisticsPoint(@Param("userId") String userId, @Param("channelId") Long channelId);
    ScoreDataDto statisticsAllScorePoint(@Param("userId") String userId, @Param("channelId") Long channelId);

    List<PointsRecord> findByOrderNumber(@Param("orderNumber")String orderNumber,@Param("pointsType") Integer pointsType);

    IPage<PointsRecord> findPage(PageParam<PointsRecord> page,@Param("userId") String userId,@Param("channelId") Long channelId);

    List<PointsRecord> findByExpiredPoints(@Param("today")Date today,@Param("yesterday") Date yesterday);

    IPage<PointsRecordVo> backendPointsRecordList(@Param("page") Page<PointsRecordVo> page, @Param("po") PointsRecordPo po);
    List<PointsRecordVo> backendPointsRecordList2(@Param("po") PointsRecordPo po);
}
