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.WindsubstationtandardpointMapper;
import com.gyee.frame.model.auto.Windsubstationtandardpoint;
import com.gyee.frame.model.auto.WindsubstationtandardpointExample;
import com.gyee.frame.util.SnowflakeIdWorker;
import org.springframework.stereotype.Service;

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


@Service
public class WindsubstationstandardpointService implements BaseService<Windsubstationtandardpoint, WindsubstationtandardpointExample> {
    @Resource
    private WindsubstationtandardpointMapper windsubstationtandardpointMapper;


    @Override
    public int deleteByPrimaryKey(String ids) {

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


    }


    @Override
    public Windsubstationtandardpoint selectByPrimaryKey(String id) {

        return windsubstationtandardpointMapper.selectByPrimaryKey(id);

    }


    @Override
    public int updateByPrimaryKeySelective(Windsubstationtandardpoint record) {
        return windsubstationtandardpointMapper.updateByPrimaryKeySelective(record);
    }


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

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


        return windsubstationtandardpointMapper.insertSelective(record);
    }


    @Override
    public int updateByExampleSelective(Windsubstationtandardpoint record, WindsubstationtandardpointExample example) {

        return windsubstationtandardpointMapper.updateByExampleSelective(record, example);
    }


    @Override
    public int updateByExample(Windsubstationtandardpoint record, WindsubstationtandardpointExample example) {

        return windsubstationtandardpointMapper.updateByExample(record, example);
    }

    @Override
    public List<Windsubstationtandardpoint> selectByExample(WindsubstationtandardpointExample example) {

        return windsubstationtandardpointMapper.selectByExample(example);
    }


    @Override
    public long countByExample(WindsubstationtandardpointExample example) {

        return windsubstationtandardpointMapper.countByExample(example);
    }


    @Override
    public int deleteByExample(WindsubstationtandardpointExample example) {

        return windsubstationtandardpointMapper.deleteByExample(example);
    }


    public  List<Windsubstationtandardpoint> findAllList() {

        WindsubstationtandardpointExample example = new WindsubstationtandardpointExample();

        List<Windsubstationtandardpoint> vos = windsubstationtandardpointMapper.selectByExample(example);


        return vos;

    }


}
