package com.jeequan.jeepay.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jeequan.jeepay.db.entity.RouteRecord;
import com.jeequan.jeepay.service.mapper.RouteRecordMapper;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * <p>
 * 策略运行结果 服务实现类
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2024-05-09
 */
@Service
public class RouteRecordService extends ServiceImpl<RouteRecordMapper, RouteRecord>{

    /**
     * 分页查询
     * @param page
     * @param entity
     * @return
     */
    public IPage<RouteRecord> pageList(Page<RouteRecord> page, RouteRecord entity) {
        Date[] dateRange = entity.buildQueryDateRange();
        return baseMapper.pageList(page,entity,dateRange);
    }
}
