package com.nantian.cloud.dbcapp.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nantian.cloud.dbcapp.entity.ConfigureDataCollect;
import com.nantian.cloud.dbcapp.mapper.record.ConfigureDataCollectMapper;
import com.nantian.cloud.dbcapp.service.ConfigureDataCollectService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("ConfigureDataCollectService")
public class ConfigureDataCollectImpl extends ServiceImpl<ConfigureDataCollectMapper, ConfigureDataCollect> implements ConfigureDataCollectService {
    @Override
    public Map<String, Object> getList(Page page, String epc, String collectItemName) {
        Map<String,Object> map = new HashMap<>();
        map.put("size",page.getSize());
        map.put("current",page.getCurrent());
        List<Map<String, Object>> list = baseMapper.getList(page, epc, collectItemName);
        List<Map<String, Object>> assisList = baseMapper.getAssistList(epc);
        map.put("list",list);
        map.put("assisList",assisList);
        Integer total = baseMapper.getTotal(epc, collectItemName);
        map.put("total",total);
        return map;
    }

    @Override
    public List<Map<String, Object>> getListData( String epc, String collectItemName) {
        Map<String,Object> map = new HashMap<>();
        List<Map<String, Object>> list = baseMapper.getListData(epc, collectItemName);
        return list;
    }

    @Override
    public List<Map<String, Object>> getListDataNew( String epc, String collectItemName) {
        Map<String,Object> map = new HashMap<>();
        List<Map<String, Object>> list = baseMapper.getListDataNew(epc, collectItemName);
        return list;
    }

    @Override
    public ConfigureDataCollect getListDataNewMap( String epc, String collectItemName) {
        return baseMapper.getListDataNewMap(epc, collectItemName);
    }

    @Override
    public boolean updateByepc(ConfigureDataCollect obj) {
        return baseMapper.updateByepc(obj);
    }

    @Override
    public boolean saveData(ConfigureDataCollect configureDataCollect) {
        return baseMapper.saveData(configureDataCollect);
    }
}
