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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nantian.cloud.jly.entity.ConfigureGaugeVerify;
import com.nantian.cloud.jly.mapper.ConfigureGaugeVerifyMapper;
import com.nantian.cloud.jly.service.ConfigureGaugeVerifyService;
import com.nantian.cloud.jly.vo.ConfigureGaugeVerifyVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 *
 * @date 2018-09-27
 */
@Service("configureGaugeVerifyService")
public class ConfigureGaugeVerifyServiceImpl extends ServiceImpl<ConfigureGaugeVerifyMapper, ConfigureGaugeVerify> implements ConfigureGaugeVerifyService {

    @Resource
    private ConfigureGaugeVerifyMapper configureGaugeVerifyMapper;

    public IPage<ConfigureGaugeVerifyVo> getPageData(Page page, String areaCodes, String industryCode, String cmpName, String cmp){
        String code = "";
        int flag = 0;
        if(areaCodes != null){
            String[] codeList = areaCodes.split(",");
            flag = codeList.length;
            code = codeList[flag-1];
        }
        return configureGaugeVerifyMapper.getPageData(page,code,flag,industryCode,cmpName,cmp);
    }

    @Override
    public IPage<ConfigureGaugeVerify> pageCmp(Page page, ConfigureGaugeVerify configureGaugeVerify) {
        return baseMapper.pageCmp(page,configureGaugeVerify);
    }

    @Override
    public boolean updateGaugeVerify(ConfigureGaugeVerify configureGaugeVerify) {
        return baseMapper.updateGaugeVerify(configureGaugeVerify);
    }

}

