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.Wttragetreportchart3Mapper;
import com.gyee.frame.model.auto.Wttragetreportchart3;
import com.gyee.frame.model.auto.Wttragetreportchart3Example;
import com.gyee.frame.util.StringUtils;
import org.springframework.stereotype.Service;

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

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

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

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

				
		return wttragetreportchart3Mapper.insertSelective(record);
	}
	
	
	@Override
	public int updateByExampleSelective(Wttragetreportchart3 record, Wttragetreportchart3Example example) {
		
		return wttragetreportchart3Mapper.updateByExampleSelective(record, example);
	}

	
	@Override
	public int updateByExample(Wttragetreportchart3 record, Wttragetreportchart3Example example) {
		
		return wttragetreportchart3Mapper.updateByExample(record, example);
	}

	@Override
	public List<Wttragetreportchart3> selectByExample(Wttragetreportchart3Example example) {
		
		return wttragetreportchart3Mapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(Wttragetreportchart3Example example) {
		
		return wttragetreportchart3Mapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(Wttragetreportchart3Example example) {
		
		return wttragetreportchart3Mapper.deleteByExample(example);
	}

	public List<Wttragetreportchart3> findWttragetreportchart3(Integer tid,String wtId) {


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

		if(StringUtils.notEmp(tid) && StringUtils.notEmp(wtId))
		{
			Wttragetreportchart3Example example=new Wttragetreportchart3Example();
			example.setOrderByClause(" partid,recorddate");

			Wttragetreportchart3Example.Criteria criteria =example.createCriteria();

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





		return list;

	}

}
