package com.palmnest.dao.estateserve.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.palmnest.dao.estateserve.ScMenueventDao;
import com.palmnest.dao.hibernate.GenericDaoHibernate;
import com.palmnest.model.estateserve.WxMenuevent;


/**
 * 菜单事件DAO
 *
 * @author ldb
 */
@Repository("scMenueventDao")
public class ScMenueventDaoImpl extends GenericDaoHibernate<WxMenuevent, Integer>
		implements ScMenueventDao {
	public ScMenueventDaoImpl() {
		super(WxMenuevent.class);
	}

	@Override
	public WxMenuevent getMenueventById(Integer id) {
		String sql = "from ScMenuevent where focusEventId='" + id + "'";
		List<WxMenuevent> list = this.getSession().createQuery(sql).list();
		if (list != null && list.size() > 0) {
			return list.get(0);
		}
		return null;
	}


	@Override
	public WxMenuevent saveMenuevent(WxMenuevent scMenuevent) {
		return super.save(scMenuevent);
	}

}
