package com.backendsys.service.Ai.Aiivh;

import com.backendsys.entity.Ai.Aiivh.AiivhQuotaOrderDTO;
import com.backendsys.mapper.Ai.Aiivh.AiivhQuotaOrderMapper;
import com.backendsys.utils.response.PageInfoResult;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class AiivhQuotaOrderServiceImpl implements AiivhQuotaOrderService {

    @Autowired
    private AiivhQuotaOrderMapper aiivhQuotaOrderMapper;

    @Override
    public Map<String, Object> getQuotaOrderList(Integer pageNum, Integer pageSize, AiivhQuotaOrderDTO aiivhQuotaOrderDTO) {
        // 分页查询
        if (pageNum != null && pageSize != null) {
            PageHelper.startPage(pageNum, pageSize);
            PageHelper.getLocalPage().setPageSizeZero(true);
        }
        // 分页输出 (自定义)
        List<Map<String, Object>> list = aiivhQuotaOrderMapper.queryAiivhQuotaOrderList(aiivhQuotaOrderDTO);
        PageInfoResult pageInfoResult = new PageInfoResult(list);
        return pageInfoResult.toMap();
    }

}
