package com.tofly.common.service.impl;

import com.tofly.common.mapper.CommonInterfaceMapper;
import com.tofly.common.service.CommonInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author tuonbed
 * @date 2020/4/20  10:49
 */
@Service
public class CommonInterfaceServiceImpl implements CommonInterfaceService {

    @Autowired(required = false)
    private CommonInterfaceMapper commonInterfaceMapper;
    @Override
    public boolean getExistsNum(Map map) {
        commonInterfaceMapper.getExistsNum(map);
        BigDecimal count=(BigDecimal) map.get("count");
        if(count.intValue()==0){
            return false;
        }
        return true;
    }


    public List<Map> getDBTable(String filter) {
        return commonInterfaceMapper.getDBTable(filter);
    }


}
