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.WindturbinestandardpointMapper;
import com.gyee.frame.model.auto.Windturbinestandardpoint;
import com.gyee.frame.model.auto.WindturbinestandardpointExample;
import com.gyee.frame.util.SnowflakeIdWorker;
import org.springframework.stereotype.Service;

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


@Service
public class WindturbinestandardpointService implements BaseService<Windturbinestandardpoint, WindturbinestandardpointExample> {
    @Resource
    private WindturbinestandardpointMapper windturbinestandardpointMapper;


    @Override
    public int deleteByPrimaryKey(String ids) {

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


    }


    @Override
    public Windturbinestandardpoint selectByPrimaryKey(String id) {

        return windturbinestandardpointMapper.selectByPrimaryKey(id);

    }


    @Override
    public int updateByPrimaryKeySelective(Windturbinestandardpoint record) {
        return windturbinestandardpointMapper.updateByPrimaryKeySelective(record);
    }


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

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


        return windturbinestandardpointMapper.insertSelective(record);
    }


    @Override
    public int updateByExampleSelective(Windturbinestandardpoint record, WindturbinestandardpointExample example) {

        return windturbinestandardpointMapper.updateByExampleSelective(record, example);
    }


    @Override
    public int updateByExample(Windturbinestandardpoint record, WindturbinestandardpointExample example) {

        return windturbinestandardpointMapper.updateByExample(record, example);
    }

    @Override
    public List<Windturbinestandardpoint> selectByExample(WindturbinestandardpointExample example) {

        return windturbinestandardpointMapper.selectByExample(example);
    }


    @Override
    public long countByExample(WindturbinestandardpointExample example) {

        return windturbinestandardpointMapper.countByExample(example);
    }


    @Override
    public int deleteByExample(WindturbinestandardpointExample example) {

        return windturbinestandardpointMapper.deleteByExample(example);
    }


    public  List<Windturbinestandardpoint> findAllList() {

        WindturbinestandardpointExample example = new WindturbinestandardpointExample();
        example.setOrderByClause("id ASC");
        List<Windturbinestandardpoint> vos = windturbinestandardpointMapper.selectByExample(example);


        return vos;

    }


}
