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.Wttragetreportxndjpj3Mapper;
import com.gyee.frame.model.auto.Wttragetreportxndjpj3;
import com.gyee.frame.model.auto.Wttragetreportxndjpj3Example;
import com.gyee.frame.util.StringUtils;
import org.springframework.stereotype.Service;

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

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

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

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

			
				
		return wttragetreportxndjpj3Mapper.insertSelective(record);
	}
	
	
	@Override
	public int updateByExampleSelective(Wttragetreportxndjpj3 record, Wttragetreportxndjpj3Example example) {
		
		return wttragetreportxndjpj3Mapper.updateByExampleSelective(record, example);
	}

	
	@Override
	public int updateByExample(Wttragetreportxndjpj3 record, Wttragetreportxndjpj3Example example) {
		
		return wttragetreportxndjpj3Mapper.updateByExample(record, example);
	}

	@Override
	public List<Wttragetreportxndjpj3> selectByExample(Wttragetreportxndjpj3Example example) {
		
		return wttragetreportxndjpj3Mapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(Wttragetreportxndjpj3Example example) {
		
		return wttragetreportxndjpj3Mapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(Wttragetreportxndjpj3Example example) {
		
		return wttragetreportxndjpj3Mapper.deleteByExample(example);
	}


	public List<Wttragetreportxndjpj3> findWttragetreportxndjpj3(Integer tid,String wtId) {


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


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

			Wttragetreportxndjpj3Example.Criteria criteria =example.createCriteria();

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

		return list;

	}
}
