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

import com.chenyang.nse.bussiness.dao.BaseDao;
import com.chenyang.nse.bussiness.entity.orm.table.core.config.TcoreBaseConfig;
import java.util.List;
import org.springframework.stereotype.Repository;

@Repository
public class TcoreBaseConfigDao extends BaseDao<TcoreBaseConfig, String> {
   public List<String> getCategoryNameList() {
      String sql = "select category_name from  t_core_base_config   group by category_name";
      List<String> list = this.getSession().createNativeQuery(sql).getResultList();
      return list;
   }

   public List<String> getGroupNameList(String categoryId) {
      String sql = "select group_name from   t_core_base_config where category_name = '" + categoryId + "'   group by group_name";
      List<String> list = this.getSession().createNativeQuery(sql).getResultList();
      return list;
   }

   public String getCategoryNameCnt(String categoryName) {
      String sql = "select count(*) from t_core_base_config where category_name = '" + categoryName + "'";
      List resultList = this.getSession().createNativeQuery(sql).getResultList();
      String cnt = resultList.get(0).toString();
      return cnt;
   }
}
