package com.ifish.daoImpl;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.ifish.dao.VenderListDao;
import com.ifish.entity.VenderList;
import com.ifish.enums.BooleanEnum;
import com.ifish.hibernate.HibernateBaseDao;
import com.ifish.hibernate.Pagination;

/** 
 * @ClassName: VenderDaoImpl 
 * @Description: TODO 
 * @author ggw 
 *  
 */

@Repository
public class VenderListDaoImpl extends HibernateBaseDao<VenderList, String> implements VenderListDao {

	@Override
	protected Class<VenderList> getEntityClass() {
		return VenderList.class;
	}


	@Override
	public Pagination<VenderList> findByCriteria(Integer firstResult, Integer pageSize) {
		Criterion appShow = Restrictions.eq("appShow", BooleanEnum.YES.getKey());
		Criterion brandCode = Restrictions.ne("brandCode", "AYQ");
		return this.findByCriteria(firstResult, pageSize,null, appShow ,brandCode);
	}


	@Override
	public VenderList getDefaultVenderList() {
		return this.get("AYQ");
	}
}
