package com.palmnest.dao.estateserve.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.palmnest.dao.estateserve.ScPicandtextdetailstempDao;
import com.palmnest.dao.hibernate.GenericDaoHibernate;
import com.palmnest.model.estateserve.Picandtextdetailstemp;

/**
 * 报修图片信息管理实现DAO
 *
 * @author ldb
 */
@Repository("scPicandtextdetailstempDao")
public class ScPicandtextdetailstempDaoImpl extends GenericDaoHibernate<Picandtextdetailstemp, Integer>
		implements ScPicandtextdetailstempDao {
	public ScPicandtextdetailstempDaoImpl() {
		super(Picandtextdetailstemp.class);
	}

	@Override
	public Picandtextdetailstemp save(Picandtextdetailstemp scPicandtextdetailstemp) {
		return super.save(scPicandtextdetailstemp);
	}

	public void delPicandtextdetailstemp(final Integer... ids) {
		this.getSession().createQuery("delete from Picandtextdetailstemp where replyKeywordsId in (:ids)")
				.setParameterList("ids", ids)
				.executeUpdate();
	}

	public void delPicandtextdetailstempByKeyId(Integer keywordId) {
		this.getSession().createQuery("delete from Picandtextdetailstemp where replyKeywordsId=:id").setParameter("id", keywordId).executeUpdate();
	}

	public List<Picandtextdetailstemp> getScPicandtextdetailstemps(Integer kid) {
		return this.getSession().createQuery("from Picandtextdetailstemp where replyKeywordsId=:id").setParameter("id", kid).list();
	}

	public void removeScPicandtextdetailstemp(Integer detailid) {
		this.getSession().createQuery("delete from Picandtextdetailstemp where picAndTextDetailsTempId=:detailid").setParameter("detailid", detailid).executeUpdate();
	}
}
