package com.yihu.hos.resource.dao;

import com.yihu.hos.resource.model.RsAppResourceDetail;
import com.yihu.hos.web.framework.dao.SQLGeneralDAO;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by chenweida on 2016/1/25.
 */
@Repository("rsAppResourceDetailDao")
public class RsAppResourceDetailDaoImpl extends SQLGeneralDAO {

    public static final String BEAN_ID = "rsAppResourceDetailDao";

    public List<RsAppResourceDetail> getAppResourceDetailByAppResouceId(String id) throws Exception {
        return (List<RsAppResourceDetail>) super.hibernateTemplate.find("from RsAppResourceDetail r where r.appResouceId=? ", id);
    }

    public void deleteByAppResourceId(String id) throws Exception {
        super.hibernateTemplate.deleteAll(super.hibernateTemplate.find("from RsAppResourceDetail r where r.appResouceId=? ", id));
    }
}
