package com.gyee.frame.service;

import com.gyee.frame.common.base.BaseService;
import com.gyee.frame.common.dataSources.DataSource;
import com.gyee.frame.common.dataSources.DataSourceType;
import com.gyee.frame.common.support.Convert;
import com.gyee.frame.mapper.auto.EliminatingeqMapper;
import com.gyee.frame.model.auto.Eliminatingeq;
import com.gyee.frame.model.auto.EliminatingeqExample;
import com.gyee.frame.util.StringUtils;
import org.springframework.stereotype.Service;

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

/**
 * 线路 EliminatingeqService
 * @Title: EliminatingeqService.java 
 * @Package com.gyee.frame.service 
 * @author gyee_自动生成
 * @email 1@qq.com
 * @date 2019-12-31 14:58:09  
 **/
@Service
public class EliminatingeqService implements BaseService<Eliminatingeq, EliminatingeqExample> {
	@Resource
	private EliminatingeqMapper eliminatingeqMapper;
	


	@Override
	public int deleteByPrimaryKey(String ids) {
				
			List<Double> lista=Convert.toDoubleArrayList(ids);
			EliminatingeqExample example=new EliminatingeqExample();
			example.createCriteria().andIdIn(lista);
			return eliminatingeqMapper.deleteByExample(example);


	}
	
	
	@Override
	public Eliminatingeq selectByPrimaryKey(String id) {
				
			return eliminatingeqMapper.selectByPrimaryKey(Double.valueOf(id));
				
	}

	
	@Override
	public int updateByPrimaryKeySelective(Eliminatingeq record) {
		return eliminatingeqMapper.updateByPrimaryKeySelective(record);
	}
	
	
	/**
	 * 添加
	 */
	@Override
	public int insertSelective(Eliminatingeq record) {
				

				
		return eliminatingeqMapper.insertSelective(record);
	}
	
	
	@Override
	public int updateByExampleSelective(Eliminatingeq record, EliminatingeqExample example) {
		
		return eliminatingeqMapper.updateByExampleSelective(record, example);
	}

	
	@Override
	public int updateByExample(Eliminatingeq record, EliminatingeqExample example) {
		
		return eliminatingeqMapper.updateByExample(record, example);
	}

	@Override
	public List<Eliminatingeq> selectByExample(EliminatingeqExample example) {
		
		return eliminatingeqMapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(EliminatingeqExample example) {
		
		return eliminatingeqMapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(EliminatingeqExample example) {
		
		return eliminatingeqMapper.deleteByExample(example);
	}
	@DataSource(value = DataSourceType.TICKET)
	public List<Eliminatingeq> findEliminatingeqById(String bugnum) {

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

		if(StringUtils.notEmp(bugnum) )
		{
			EliminatingeqExample example=new EliminatingeqExample();
			example.setOrderByClause("bugnum asc");

			EliminatingeqExample.Criteria criteria =example.createCriteria();

			criteria.andBugnumEqualTo(bugnum);

			list= eliminatingeqMapper.selectByExample(example);
		}

		return list;

	}



}
