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

import com.zcloud.primeport.persistence.dataobject.ClosedAreaFgsPersonAuthDO;
import com.zcloud.primeport.persistence.mapper.ClosedAreaFgsPersonAuthMapper;
import com.zcloud.primeport.persistence.repository.ClosedAreaFgsPersonAuthRepository;
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.Map;

/**
* web-infrastructure
* @Author dearLin
* @Date 2026-03-19 17:37:04
*/
@Service
@RequiredArgsConstructor
public class ClosedAreaFgsPersonAuthRepositoryImpl extends BaseRepositoryImpl<ClosedAreaFgsPersonAuthMapper, ClosedAreaFgsPersonAuthDO> implements ClosedAreaFgsPersonAuthRepository {
    private final ClosedAreaFgsPersonAuthMapper closedAreaFgsPersonAuthMapper;

    @Override
    public  PageResponse<ClosedAreaFgsPersonAuthDO> listPage(Map<String,Object> params) {
    IPage<ClosedAreaFgsPersonAuthDO> iPage = new Query<ClosedAreaFgsPersonAuthDO>().getPage(params);
        QueryWrapper<ClosedAreaFgsPersonAuthDO> queryWrapper = new QueryWrapper<>();
        queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
        queryWrapper.orderByDesc("create_time");
        IPage<ClosedAreaFgsPersonAuthDO> result = closedAreaFgsPersonAuthMapper.selectPage(iPage, queryWrapper);
        return PageHelper.pageToResponse(result, result.getRecords());
    }

    @Override
    public ClosedAreaFgsPersonAuthDO getAuthorizationPersonInfo(Long id) {
        return closedAreaFgsPersonAuthMapper.getAuthorizationPersonInfo(id);
    }
}

