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.Wttragetreportmain3Mapper;
import com.gyee.frame.model.auto.Wttragetreportmain3;
import com.gyee.frame.model.auto.Wttragetreportmain3Example;
import com.gyee.frame.util.StringUtils;
import org.springframework.stereotype.Service;

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

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

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

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

			
				
		return wttragetreportmain3Mapper.insertSelective(record);
	}
	
	
	@Override
	public int updateByExampleSelective(Wttragetreportmain3 record, Wttragetreportmain3Example example) {
		
		return wttragetreportmain3Mapper.updateByExampleSelective(record, example);
	}

	
	@Override
	public int updateByExample(Wttragetreportmain3 record, Wttragetreportmain3Example example) {
		
		return wttragetreportmain3Mapper.updateByExample(record, example);
	}

	@Override
	public List<Wttragetreportmain3> selectByExample(Wttragetreportmain3Example example) {
		
		return wttragetreportmain3Mapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(Wttragetreportmain3Example example) {
		
		return wttragetreportmain3Mapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(Wttragetreportmain3Example example) {
		
		return wttragetreportmain3Mapper.deleteByExample(example);
	}

	public List<Wttragetreportmain3> findWttragetreportmain3(Integer tid,String wtId) {


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

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

			Wttragetreportmain3Example.Criteria criteria =example.createCriteria();

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

		return list;

	}

}
