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.StopAnalysisDetailVoMapper;
import com.gyee.frame.model.auto.StopAnalysisDetailVo;
import com.gyee.frame.model.auto.StopAnalysisDetailVoExample;
import org.springframework.stereotype.Service;

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


@Service
public class StopAnalysisDetailVoService implements BaseService<StopAnalysisDetailVo, StopAnalysisDetailVoExample> {
	@Resource
	private StopAnalysisDetailVoMapper stopAnalysisDetailVoMapper;
	

	@Override
	public int deleteByPrimaryKey(String ids) {
				
			List<String> lista=Convert.toListStrArray(ids);
			StopAnalysisDetailVoExample example=new StopAnalysisDetailVoExample();
			example.createCriteria().andIdIn(lista);
			return stopAnalysisDetailVoMapper.deleteByExample(example);
			
				
	}
	
	
	@Override
	public StopAnalysisDetailVo selectByPrimaryKey(String id) {
				
			return stopAnalysisDetailVoMapper.selectByPrimaryKey(id);
				
	}

	
	@Override
	public int updateByPrimaryKeySelective(StopAnalysisDetailVo record) {
		return stopAnalysisDetailVoMapper.updateByPrimaryKeySelective(record);
	}
	
	
	/**
	 * 添加
	 */
	@Override
	public int insertSelective(StopAnalysisDetailVo record) {
				
		//添加雪花主键id
//		record.setId(SnowflakeIdWorker.getUUID());
			
				
		return stopAnalysisDetailVoMapper.insertSelective(record);
	}
	
	
	@Override
	public int updateByExampleSelective(StopAnalysisDetailVo record, StopAnalysisDetailVoExample example) {
		
		return stopAnalysisDetailVoMapper.updateByExampleSelective(record, example);
	}

	
	@Override
	public int updateByExample(StopAnalysisDetailVo record, StopAnalysisDetailVoExample example) {
		
		return stopAnalysisDetailVoMapper.updateByExample(record, example);
	}

	@Override
	public List<StopAnalysisDetailVo> selectByExample(StopAnalysisDetailVoExample example) {
		
		return stopAnalysisDetailVoMapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(StopAnalysisDetailVoExample example) {
		
		return stopAnalysisDetailVoMapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(StopAnalysisDetailVoExample example) {
		
		return stopAnalysisDetailVoMapper.deleteByExample(example);
	}

	public int deleteAll() {

		return stopAnalysisDetailVoMapper.deleteAll();

	}

	public List<StopAnalysisDetailVo> findStopAnalysisDetailVoList() {


		List<StopAnalysisDetailVo> list=new ArrayList<>();

		StopAnalysisDetailVoExample example=new StopAnalysisDetailVoExample();
		example.setOrderByClause("id asc");

		list= stopAnalysisDetailVoMapper.selectByExample(example);

		return list;

	}

	public List<StopAnalysisDetailVo> findStopAnalysisDetailVoList(String wtId) {


		List<StopAnalysisDetailVo> list=new ArrayList<>();

		StopAnalysisDetailVoExample example=new StopAnalysisDetailVoExample();
		example.setOrderByClause("id asc");
		StopAnalysisDetailVoExample.Criteria criteria =example.createCriteria();

		criteria.andWtidEqualTo(wtId);
		list= stopAnalysisDetailVoMapper.selectByExample(example);

		return list;

	}
}
