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.WindpowerstationstandardpointMapper;
import com.gyee.frame.model.auto.Windpowerstationstandardpoint;
import com.gyee.frame.model.auto.WindpowerstationstandardpointExample;
import com.gyee.frame.util.SnowflakeIdWorker;
import org.springframework.stereotype.Service;

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


@Service
public class WindpowerstationstandardpointService implements BaseService<Windpowerstationstandardpoint, WindpowerstationstandardpointExample> {
    @Resource
    private WindpowerstationstandardpointMapper windpowerstationstandardpointMapper;


    @Override
    public int deleteByPrimaryKey(String ids) {

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


    }


    @Override
    public Windpowerstationstandardpoint selectByPrimaryKey(String id) {

        return windpowerstationstandardpointMapper.selectByPrimaryKey(id);

    }


    @Override
    public int updateByPrimaryKeySelective(Windpowerstationstandardpoint record) {
        return windpowerstationstandardpointMapper.updateByPrimaryKeySelective(record);
    }


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

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


        return windpowerstationstandardpointMapper.insertSelective(record);
    }


    @Override
    public int updateByExampleSelective(Windpowerstationstandardpoint record, WindpowerstationstandardpointExample example) {

        return windpowerstationstandardpointMapper.updateByExampleSelective(record, example);
    }


    @Override
    public int updateByExample(Windpowerstationstandardpoint record, WindpowerstationstandardpointExample example) {

        return windpowerstationstandardpointMapper.updateByExample(record, example);
    }

    @Override
    public List<Windpowerstationstandardpoint> selectByExample(WindpowerstationstandardpointExample example) {

        return windpowerstationstandardpointMapper.selectByExample(example);
    }


    @Override
    public long countByExample(WindpowerstationstandardpointExample example) {

        return windpowerstationstandardpointMapper.countByExample(example);
    }


    @Override
    public int deleteByExample(WindpowerstationstandardpointExample example) {

        return windpowerstationstandardpointMapper.deleteByExample(example);
    }


    public  List<Windpowerstationstandardpoint> findAllList() {

        WindpowerstationstandardpointExample example = new WindpowerstationstandardpointExample();

        List<Windpowerstationstandardpoint> vos = windpowerstationstandardpointMapper.selectByExample(example);


        return vos;

    }


}
