package com.gyee.frame.service;

import com.gyee.frame.common.base.BaseService;
import com.gyee.frame.common.support.Convert;
import com.gyee.frame.mapper.auto.Statejudgmentrecord2Mapper;
import com.gyee.frame.model.auto.Statejudgmentrecord2;
import com.gyee.frame.model.auto.Statejudgmentrecord2Example;
import com.gyee.frame.util.StringUtils;
import org.springframework.stereotype.Service;

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


@Service
public class Statejudgmentrecord2Service implements BaseService<Statejudgmentrecord2, Statejudgmentrecord2Example> {
	@Resource
	private Statejudgmentrecord2Mapper statejudgmentrecord2Mapper;
	

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

	
	@Override
	public int updateByPrimaryKeySelective(Statejudgmentrecord2 record) {
		return statejudgmentrecord2Mapper.updateByPrimaryKeySelective(record);
	}
	
	
	/**
	 * 添加
	 */
	@Override
	public int insertSelective(Statejudgmentrecord2 record) {
	
				
		return statejudgmentrecord2Mapper.insertSelective(record);
	}
	
	
	@Override
	public int updateByExampleSelective(Statejudgmentrecord2 record, Statejudgmentrecord2Example example) {
		
		return statejudgmentrecord2Mapper.updateByExampleSelective(record, example);
	}

	
	@Override
	public int updateByExample(Statejudgmentrecord2 record, Statejudgmentrecord2Example example) {
		
		return statejudgmentrecord2Mapper.updateByExample(record, example);
	}

	@Override
	public List<Statejudgmentrecord2> selectByExample(Statejudgmentrecord2Example example) {
		
		return statejudgmentrecord2Mapper.selectByExample(example);
	}

	
	@Override
	public long countByExample(Statejudgmentrecord2Example example) {
		
		return statejudgmentrecord2Mapper.countByExample(example);
	}

	
	@Override
	public int deleteByExample(Statejudgmentrecord2Example example) {
		
		return statejudgmentrecord2Mapper.deleteByExample(example);
	}

	public List<Statejudgmentrecord2> findStatejudgmentrecord2(String wtId) {

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

		if (StringUtils.notEmp(wtId) ) {

			Statejudgmentrecord2Example example=new Statejudgmentrecord2Example();
			example.setOrderByClause("recodedate DESC");

			Statejudgmentrecord2Example.Criteria criteria =example.createCriteria();

			criteria.andWtidEqualTo(wtId);
			list= statejudgmentrecord2Mapper.selectByExample(example);

		}
		return list;

	}
}
