package com.sqx.modules.order.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.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.order.dao.EvaluateRiderDao;
import com.sqx.modules.order.entity.EvaluateRider;
import com.sqx.modules.order.service.EvaluateRiderService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EvaluateRiderServiceImpl extends ServiceImpl<EvaluateRiderDao, EvaluateRider> implements EvaluateRiderService {
    @Autowired
    private EvaluateRiderDao evaluateRiderDao;

    @Override
    public Result evaluateRiderPage(String riderName, String phone, String orderNumber, String userPhone, String shopName, Integer riderScore, String start, String end, Integer page, Integer limit) {
        Page<EvaluateRider> evaluateRiderPage = new Page<>(page,limit);
        IPage<EvaluateRider> riderPage =evaluateRiderDao.evaluateRiderPage(evaluateRiderPage,riderName,phone,orderNumber,userPhone,shopName,riderScore,start,end);
        PageUtils pageUtils = new PageUtils(riderPage);
        return Result.success().put("data", pageUtils);
    }
}


