package com.chenyang.nse.bussiness.dao.table.core;

import com.chenyang.nse.bussiness.dao.BaseDao;
import com.chenyang.nse.bussiness.entity.orm.table.core.TEncryptionProxyHost;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Repository;

@Repository
public class TEncryptionProxyHostDao extends BaseDao<TEncryptionProxyHost, String> {
   public List<String> getProxyHostByProject(String projectId) {
      StringBuilder sql = new StringBuilder();
      sql.append("SELECT HOST_URL FROM T_ENCRYPTION_PROXY_HOST");
      if (StringUtils.isNotEmpty(projectId)) {
         sql.append(" WHERE PROJECT_ID = '" + projectId + "'");
      }

      List<String> resultList = this.getSession().createNativeQuery(sql.toString()).getResultList();
      return resultList;
   }
}
