12345678910111213141516171819202122232425262728293031323334353637383940 |
- package com.yihu.hos.rest.common.dao;
- import com.yihu.hos.rest.models.crawler.flow.CrawlerFlowModel;
- import com.yihu.hos.web.framework.dao.SQLGeneralDAO;
- import org.hibernate.Query;
- import org.springframework.stereotype.Repository;
- import java.util.List;
- /**
- * Created by HZY on 2016/4/27.
- */
- @Repository("CrawlerFlowDao")
- public class CrawlerFlowDao extends SQLGeneralDAO {
- public static final String BEAN_ID = "CrawlerFlowDao";
- public List<CrawlerFlowModel> getCrawlerFlowList(Long versionId) {
- String adapterVersionHql = "FROM CrawlerFlowModel where schemeVersionId= :schemeVersionId";
- Query query = getCurrentSession().createQuery(adapterVersionHql);
- query.setParameter("schemeVersionId", versionId);
- List<CrawlerFlowModel> modelList = query.list();
- return modelList;
- }
- public void deleteCrawlerFlowList(Long versionId)throws Exception {
- String sql = "delete from crawler_flow where scheme_version_id='"+versionId+"'";
- super.execute(sql);
- }
- public List<CrawlerFlowModel> getCrawlerFlowList(Integer versionId,List<String> datasetCodes) {
- String adapterVersionHql = "FROM CrawlerFlowModel where schemeVersionId= :schemeVersionId and datasetCode in (:datasetCode) and inputDatasetCode in (:inputDatasetCode)";
- Query query = getCurrentSession().createQuery(adapterVersionHql);
- query.setParameter("schemeVersionId", versionId);
- query.setParameterList("datasetCode", datasetCodes);
- query.setParameterList("inputDatasetCode", datasetCodes);
- List<CrawlerFlowModel> modelList = query.list();
- return modelList;
- }
- }
|