package com.gyee.frame.service.report;

import com.gyee.frame.common.base.BaseService;
import com.gyee.frame.common.support.Convert;
import com.gyee.frame.mapper.auto.Wttragetreportfnlyl3Mapper;
import com.gyee.frame.model.auto.Wttragetreportfnlyl3;
import com.gyee.frame.model.auto.Wttragetreportfnlyl3Example;
import com.gyee.frame.util.StringUtils;
import org.springframework.stereotype.Service;

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

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

	@Override
	public int deleteByPrimaryKey(String ids) {
				
			List<Integer> lista=Convert.toIntArrayList(ids);
			Wttragetreportfnlyl3Example example=new Wttragetreportfnlyl3Example();
			example.createCriteria().andIdIn(lista);
			return wttragetreportfnlyl3Mapper.deleteByExample(example);
			
				
	}
	
	
	@Override
	public Wttragetreportfnlyl3 selectByPrimaryKey(String id) {
				
			return wttragetreportfnlyl3Mapper.selectByPrimaryKey(Integer.valueOf(id));
				
	}

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

			
				
		return wttragetreportfnlyl3Mapper.insertSelective(record);
	}
	
	
	@Override
	public int updateByExampleSelective(Wttragetreportfnlyl3 record, Wttragetreportfnlyl3Example example) {
		
		return wttragetreportfnlyl3Mapper.updateByExampleSelective(record, example);
	}

	
	@Override
	public int updateByExample(Wttragetreportfnlyl3 record, Wttragetreportfnlyl3Example example) {
		
		return wttragetreportfnlyl3Mapper.updateByExample(record, example);
	}

	@Override
	public List<Wttragetreportfnlyl3> selectByExample(Wttragetreportfnlyl3Example example) {
		
		return wttragetreportfnlyl3Mapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(Wttragetreportfnlyl3Example example) {
		
		return wttragetreportfnlyl3Mapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(Wttragetreportfnlyl3Example example) {
		
		return wttragetreportfnlyl3Mapper.deleteByExample(example);
	}


	public List<Wttragetreportfnlyl3> findWttragetreportfnlyl3(Integer tid,String wtId) {


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

		if(StringUtils.notEmp(tid) && StringUtils.notEmp(wtId))
		{
			Wttragetreportfnlyl3Example example=new Wttragetreportfnlyl3Example();
			example.setOrderByClause("recorddate asc");

			Wttragetreportfnlyl3Example.Criteria criteria =example.createCriteria();

			criteria.andTidEqualTo(tid);
			criteria.andWtidEqualTo(wtId);
			list= wttragetreportfnlyl3Mapper.selectByExample(example);
		}




		return list;

	}
}
