package com.kym.service.impl;

import com.github.pagehelper.PageHelper;
import com.kym.common.utils.CommUtil;
import com.kym.entity.PlatformFeeRate;
import com.kym.entity.common.PageBean;
import com.kym.entity.queryParams.PlatformFeeRateQueryParam;
import com.kym.mapper.PlatformFeeRateMapper;
import com.kym.service.PlatformFeeRateService;
import com.kym.service.mybatisplus.MyBaseServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 站点平台费率表 服务实现类
 * </p>
 *
 * @author skyline
 * @since 2025-04-18
 */
@Service
public class PlatformFeeRateServiceImpl extends MyBaseServiceImpl<PlatformFeeRateMapper, PlatformFeeRate> implements PlatformFeeRateService {

    @Override
    public PageBean<PlatformFeeRate> listPlatformFeeRate(PlatformFeeRateQueryParam params) {
        PageHelper.startPage(params.getPageNum(), params.getPageSize());
        var res = lambdaQuery()
                .like(CommUtil.isNotEmptyAndNull(params.getName()), PlatformFeeRate::getName, params.getName())
                .orderByDesc(PlatformFeeRate::getId)
                .list();
        return new PageBean<>(res);
    }
}
