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

import com.zcloud.primeport.persistence.dataobject.ClosedAreaCountDO;
import com.zcloud.primeport.persistence.dataobject.ClosedAreaDO;
import com.zcloud.primeport.persistence.mapper.ClosedAreaMapper;
import com.zcloud.primeport.persistence.repository.ClosedAreaRepository;
import com.alibaba.cola.dto.PageResponse;
import com.jjb.saas.framework.repository.common.PageHelper;
import com.zcloud.gbscommon.utils.PageQueryHelper;
import com.zcloud.gbscommon.utils.Query;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

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

/**
 * web-infrastructure
 *
 * @Author dearLin
 * @Date 2026-03-19 10:27:51
 */
@Service
@RequiredArgsConstructor
public class ClosedAreaRepositoryImpl extends BaseRepositoryImpl<ClosedAreaMapper, ClosedAreaDO> implements ClosedAreaRepository {
    private final ClosedAreaMapper closedAreaMapper;

    @Override
    public PageResponse<ClosedAreaDO> listPage(Map<String, Object> params) {
        IPage<ClosedAreaDO> iPage = new Query<ClosedAreaDO>().getPage(params);

        IPage<ClosedAreaDO> result = closedAreaMapper.listPage(iPage, params);
        return PageHelper.pageToResponse(result, result.getRecords());
    }

    @Override
    public List<ClosedAreaCountDO> listCount(Map<String,Object> params) {
        return closedAreaMapper.listCount(params);
    }

    @Override
    public List<ClosedAreaDO> getCountByHgAuthArea() {
        return closedAreaMapper.getCountByHgAuthArea();
    }
}

