package com.palmnest.dao.notice.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.palmnest.application.ElementConstant;
import com.palmnest.application.bean.Page;
import com.palmnest.dao.hibernate.GenericDaoHibernate;
import com.palmnest.dao.notice.WxtemplateConfigParaDao;
import com.palmnest.dao.notice.WxtemplateMessageDao;
import com.palmnest.model.notice.WxtemplateConfigPara;
import com.palmnest.model.notice.WxtemplateMessageConfigModel;
import com.palmnest.model.notice.WxtemplateMessageModel;
import com.palmnest.model.notice.WxtemplateMessageTypeModel;

@Repository("wxtemplateConfigParaDao")
public class WxtemplateConfigParaDaoImpl extends GenericDaoHibernate<WxtemplateConfigPara, Integer> implements WxtemplateConfigParaDao {

	public WxtemplateConfigParaDaoImpl() {
		super(WxtemplateConfigPara.class);

	}

	@Override
	public List<WxtemplateConfigPara> getWxTemplConfigByTypeId(
			int msgId) throws Exception {
		String strHQL = "from WxtemplateConfigPara where  message_id=?  ";
		List<WxtemplateConfigPara> list = getSession().createQuery(strHQL).setInteger(0, msgId).list();
		return list;
	}

	@Override
	public void deleteByMsgId(int id) {
		String strHQL = "DELETE FROM tb_wxtemplate_config_para WHERE message_id =" + id;
		getSession().createSQLQuery(strHQL).executeUpdate();
	}
}
