package com.chushang.inspection.work.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chushang.common.core.constant.SecurityConstants;
import com.chushang.common.mybatis.page.CommonParam;
import com.chushang.common.mybatis.utils.PageResult;
import com.chushang.common.mybatis.utils.WrapperUtils;
import com.chushang.inspection.terminal.query.TerminalQuery;
import com.chushang.inspection.terminal.vo.StoreTerminalVO;
import com.chushang.inspection.work.service.WrkInfoTerminalRecordService;
import com.chushang.system.feign.RemoteDeptService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chushang.inspection.work.mapper.WrkInfoTerminalRecordMapper;
import com.chushang.inspection.work.po.WrkInfoTerminalRecord;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

/**
  * @auther: zhao
  * @date: 2024/6/26 17:13
  */
@Slf4j
@Service
public class WrkInfoTerminalRecordServiceImpl extends ServiceImpl<WrkInfoTerminalRecordMapper, WrkInfoTerminalRecord> implements WrkInfoTerminalRecordService {
    /**
     * 我的终端池
     */
    @Override
    public PageResult minePageList(TerminalQuery query) {
        WrapperUtils.buildSql(query);
        CommonParam commonParam = CommonParam.buildPageRequest();
        Page<StoreTerminalVO> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
        List<StoreTerminalVO> terminalVOS = baseMapper.minePageList(query, page);
        return new PageResult(terminalVOS, page);
    }
}
