package com.friday.custody.service.basicService.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.friday.custody.dao.AdminInfoDao;
import com.friday.custody.entity.AdminInfoEntity;
import com.friday.custody.service.basicService.AdminInfoService;
import com.friday.custody.utils.PageUtils;
import com.friday.custody.utils.Query;
import org.springframework.stereotype.Service;

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


@Service("adminInfoService")
public class AdminInfoServiceImpl extends ServiceImpl<AdminInfoDao, AdminInfoEntity> implements AdminInfoService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<AdminInfoEntity> page = this.page(
                new Query<AdminInfoEntity>().getPage(params),
                new QueryWrapper<AdminInfoEntity>()
        );

        return new PageUtils(page);
    }
    @Override
    public List<String> rpaGetAdminNo() {
        ArrayList<String> list = new ArrayList<>();
        QueryWrapper<AdminInfoEntity> wrapper = new QueryWrapper<>();
        List<AdminInfoEntity> adminInfoEntities = baseMapper.selectList(wrapper);
        for (AdminInfoEntity adminInfoEntity : baseMapper.selectList(wrapper)) {
            list.add(adminInfoEntity.getTenantName());
        }
        return list;
    }
}