package com.zcloud.basic.info.persistence.repository.impl.sync;

import com.alibaba.cola.dto.PageResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jjb.saas.framework.repository.common.PageHelper;
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
import com.zcloud.basic.info.persistence.dataobject.sync.SyncDepartmentDO;
import com.zcloud.basic.info.persistence.dataobject.sync.SyncUserDO;
import com.zcloud.basic.info.persistence.mapper.sync.SyncDepartmentMapper;
import com.zcloud.basic.info.persistence.mapper.sync.SyncUserMapper;
import com.zcloud.basic.info.persistence.repository.sync.SyncDepartmentRepository;
import com.zcloud.basic.info.persistence.repository.sync.SyncUserRepository;
import com.zcloud.gbscommon.utils.Query;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * web-infrastructure
 *
 * @Author zhangyue
 * @Date 2025-11-04 14:07:37
 */
@Service
@RequiredArgsConstructor
@Slf4j
public class SyncDepartmentRepositoryImpl extends BaseRepositoryImpl<SyncDepartmentMapper, SyncDepartmentDO> implements SyncDepartmentRepository {
    private final SyncDepartmentMapper syncDepartmentMapper;

    @Override
    public PageResponse<SyncDepartmentDO> listPageSyncDepartment(Map<String, Object> params) {
        IPage<SyncDepartmentDO> iPage = new Query<SyncDepartmentDO>().getPage(params);
        IPage<SyncDepartmentDO> result = syncDepartmentMapper.listPageSyncDepartment(iPage, params);
        return PageHelper.pageToResponse(result, result.getRecords());
    }

}

