package org.cs.mgr.setting.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.cs.core.dao.impl.BaseDao;
import org.cs.mgr.setting.dao.IAppVersionDao;
import org.cs.mgr.setting.model.AppVersion;
import org.springframework.stereotype.Repository;

@Repository
public class AppVersionDao extends BaseDao<AppVersion> implements IAppVersionDao {

	@SuppressWarnings("unchecked")
	@Override
	public AppVersion check(String plat, String version) {
		Map<String,Object> params = new HashMap<String,Object>();
		params.put("plat", plat);
		
		String hql = "from AppVersion where plat=:plat";
		List<AppVersion> list = (List<AppVersion>)findByHql(hql, params);
        if (list!=null && list.size() > 0) {
        	return list.get(0);
        }
		return null;
	}


}
