package com.gyee.frame.service;

import com.gyee.frame.common.base.BaseService;
import com.gyee.frame.common.support.Convert;
import com.gyee.frame.mapper.auto.ForecaststationtandardpointMapper;
import com.gyee.frame.model.auto.Forecaststationtandardpoint;
import com.gyee.frame.model.auto.ForecaststationtandardpointExample;
import com.gyee.frame.util.SnowflakeIdWorker;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class ForecaststationtandardpointService implements BaseService<Forecaststationtandardpoint, ForecaststationtandardpointExample> {
    @Resource
    private ForecaststationtandardpointMapper forecaststationtandardpointMapper;


    @Override
    public int deleteByPrimaryKey(String ids) {

        List<String> lista = Convert.toListStrArray(ids);
        ForecaststationtandardpointExample example = new ForecaststationtandardpointExample();
        example.createCriteria().andIdIn(lista);
        return forecaststationtandardpointMapper.deleteByExample(example);


    }


    @Override
    public Forecaststationtandardpoint selectByPrimaryKey(String id) {

        return forecaststationtandardpointMapper.selectByPrimaryKey(id);

    }


    @Override
    public int updateByPrimaryKeySelective(Forecaststationtandardpoint record) {
        return forecaststationtandardpointMapper.updateByPrimaryKeySelective(record);
    }


    /**
     * 添加
     */
    @Override
    public int insertSelective(Forecaststationtandardpoint record) {

        //添加雪花主键id
        record.setId(SnowflakeIdWorker.getUUID());


        return forecaststationtandardpointMapper.insertSelective(record);
    }


    @Override
    public int updateByExampleSelective(Forecaststationtandardpoint record, ForecaststationtandardpointExample example) {

        return forecaststationtandardpointMapper.updateByExampleSelective(record, example);
    }


    @Override
    public int updateByExample(Forecaststationtandardpoint record, ForecaststationtandardpointExample example) {

        return forecaststationtandardpointMapper.updateByExample(record, example);
    }

    @Override
    public List<Forecaststationtandardpoint> selectByExample(ForecaststationtandardpointExample example) {

        return forecaststationtandardpointMapper.selectByExample(example);
    }


    @Override
    public long countByExample(ForecaststationtandardpointExample example) {

        return forecaststationtandardpointMapper.countByExample(example);
    }


    @Override
    public int deleteByExample(ForecaststationtandardpointExample example) {

        return forecaststationtandardpointMapper.deleteByExample(example);
    }


    public  List<Forecaststationtandardpoint> findAllList() {

        ForecaststationtandardpointExample example = new ForecaststationtandardpointExample();

        List<Forecaststationtandardpoint> vos = forecaststationtandardpointMapper.selectByExample(example);


        return vos;

    }


}
