package com.zcloud.primeport.persistence.repository.impl;

import com.alibaba.cola.dto.PageResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jjb.saas.framework.repository.common.PageHelper;
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
import com.zcloud.primeport.domain.enums.MenuEnum;
import com.zcloud.primeport.persistence.dataobject.VehicleApplyDO;
import com.zcloud.primeport.persistence.dataobject.VehicleBlackDO;
import com.zcloud.primeport.persistence.mapper.VehicleBlackMapper;
import com.zcloud.primeport.persistence.repository.VehicleBlackRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.zcloud.gbscommon.utils.Query;
import com.zcloud.gbscommon.utils.PageQueryHelper;

import java.util.Map;

/**
 * web-infrastructure
 *
 * @Author makejava
 * @Date 2026-03-05 11:33:27
 */
@Service
@RequiredArgsConstructor
public class VehicleBlackRepositoryImpl extends BaseRepositoryImpl<VehicleBlackMapper, VehicleBlackDO> implements VehicleBlackRepository {
    private final VehicleBlackMapper vehicleBlackMapper;

    @Override
    public PageResponse<VehicleBlackDO> listPage(Map<String, Object> params) {
        Page<Map<String, Object>> page = new Page<>(Integer.parseInt(params.get("pageIndex").toString()),
                Integer.parseInt(params.get("pageSize").toString()));
        IPage<VehicleBlackDO> result = vehicleBlackMapper.listPage(page, params);
        return PageHelper.pageToResponse(result, result.getRecords());
    }

    @Override
    public VehicleBlackDO getInfoById(Long id) {
        return vehicleBlackMapper.getInfoById(id);
    }
}

