Class TariffPlanDao

java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
ru.bitel.bgbilling.common.dao.AbstractDaoConstant
ru.bitel.bgbilling.common.dao.AbstractDao<TariffPlan>
ru.bitel.bgbilling.common.dao.AbstractIdDao<TariffPlan>
ru.bitel.bgbilling.common.dao.AbstractDirectoryIdDao<TariffPlan>
ru.bitel.bgbilling.kernel.tariff.server.dao.TariffPlanDao
All Implemented Interfaces:
Directory<TariffPlan>

public class TariffPlanDao extends ru.bitel.bgbilling.common.dao.AbstractDirectoryIdDao<TariffPlan>
Управление объектами типа TariffPlan
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
     

    Nested classes/interfaces inherited from class ru.bitel.bgbilling.common.dao.AbstractDao

    ru.bitel.bgbilling.common.dao.AbstractDao.ListParams
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class ru.bitel.bgbilling.common.dao.AbstractDao

    orderByPattern

    Fields inherited from class ru.bitel.bgbilling.common.dao.AbstractDaoConstant

    con, ERROR, fields, moduleId, SQL_ALL, SQL_AND, SQL_DELETE, SQL_DISTINCT, SQL_EQ, SQL_EQCS, SQL_FROM, SQL_GROUP, SQL_IN, SQL_INSERT, SQL_JOIN, SQL_LEFT_JOIN, SQL_LIMIT, SQL_NOT_IN, SQL_ON, SQL_ORDER, SQL_SELECT, SQL_SET, SQL_UPDATE, SQL_VALUES, SQL_WHERE, tableName
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    copyTariffPlan(int tariffPlanId)
    Создает новый тарифный план, полностью аналогичный заданному
    int
    Создает новый тарифный план с такими же значениями полей, как и у заданного плана.
    get(String title)
     
    protected TariffPlan
     
    Возвращает список модулей для которых может быть определено тарифное дерево
    getModuleTrees(int treeId)
     
     
    getTariffPlanList(int defaultTariffPlanId, List<Integer> contractLabelIds, int face, String title)
    Возвращает список тарифных планов по фильтру
    Deprecated.
    Получение Map с ключами Integer - код тарифа и значениями типа TariffPlan
    int
    getTariffPlanTreeId(int tariffPlanId)
     
    protected int
    insertNode(PreparedStatement psInsertNode, ru.bitel.bgbilling.kernel.tariff.server.dao.TreeNode treeNode)
     
    protected int
    insertNodeCopy(Map<Integer,Integer> linkNodeIds, PreparedStatement psInsertNode, Map<Integer,ru.bitel.bgbilling.kernel.tariff.server.dao.TreeNode> oldNodeMap, ru.bitel.bgbilling.kernel.tariff.server.dao.TreeNode oldTreeNode)
     
    Список всех объектов TariffPlan с сортировкой по названию
    list(List<Integer> idFilter)
    Список объектов TariffPlan упорядоченный по названию
    void
    searchTariffPlans(SearchResult<TariffPlan> searchResult, TariffPlanSearchParameters tariffPlanSearchParameters)
     
    protected void
    updateImpl(TariffPlan tariffPlan)
     
    boolean
    usesModule(int tariffPlanId, int moduleId)
    Проверяет, использует ли тарифный план данный модуль

    Methods inherited from class ru.bitel.bgbilling.common.dao.AbstractDirectoryIdDao

    deleteDirectoryItem, directoryItems, directoryItemsImpl, getDirectoryItem, getDirectoryItem, getDirectoryItemIdImpl, getDirectoryItemTitleImpl, updateDirectoryItem

    Methods inherited from class ru.bitel.bgbilling.common.dao.AbstractIdDao

    delete, executeUpdate, get, getAndDelete, getAndUpdate, loadData, opt, prepareStatement, sqlCommand, sqlCommandAndTable, sqlInsertValues, sqlQuery, sqlUpdateSet, sqlWhereId

    Methods inherited from class ru.bitel.bgbilling.common.dao.AbstractDao

    deleteImpl, dropTemporaryTable, eq, get, getById, getImpl, getListFromRS, getPeriod, getQueryById, getQueryWithFilter, getSQLOrder, list, list, listCountImplPS, listImpl, listImplPS, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, queryPeriod, setPageRecordCount, update

    Methods inherited from class ru.bitel.bgbilling.common.dao.AbstractDaoConstant

    getPlaceholders, getSQLOrder, getSQLOrderFields, getTableName, psSetDate, psSetDateOrNull, psSetInt, psSetIntOrNull, psSetPeriod, psSetString, psSetStringOrNull, psSetTimestampOrNull, queryAndIn, setStatementParam, sqlDelete, sqlDeleteBatch, sqlInsert, sqlInsertBatch, sqlInsertGetId, sqlInsertGetLongId, sqlInsertOnDuplicateKeyUpdate, sqlInsertSelect, sqlInsertUpdateById, sqlSelectCountAsInt, sqlUpdate, sqlUpdateBatch

    Methods inherited from class ru.bitel.bgbilling.kernel.base.server.logger.BGLogger

    error, error, error, getLogger, logError, logError, warn

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ru.bitel.bgbilling.kernel.directory.api.common.bean.Directory

    optDirectoryItem
  • Field Details

  • Constructor Details

    • TariffPlanDao

      public TariffPlanDao(Connection con)
  • Method Details

    • getTariffPlanMap

      public Map<Integer,TariffPlan> getTariffPlanMap() throws SQLException
      Получение Map с ключами Integer - код тарифа и значениями типа TariffPlan
      Returns:
      Map
      Throws:
      SQLException
    • list

      public List<TariffPlan> list() throws SQLException
      Список всех объектов TariffPlan с сортировкой по названию
      Overrides:
      list in class ru.bitel.bgbilling.common.dao.AbstractDao<TariffPlan>
      Returns:
      List
      Throws:
      SQLException
    • getTariffPlanList

      @Deprecated public List<TariffPlan> getTariffPlanList(List<Integer> idFilter) throws SQLException
      Deprecated.
      Список объектов TariffPlan упорядоченный по названию
      Parameters:
      idFilter - - cписок-фильтр с кодами тарифов
      Returns:
      List
      Throws:
      SQLException
    • list

      public List<TariffPlan> list(List<Integer> idFilter) throws SQLException
      Список объектов TariffPlan упорядоченный по названию
      Parameters:
      idFilter - - cписок-фильтр с кодами тарифов
      Returns:
      List
      Throws:
      SQLException
    • getTariffPlanList

      public List<TariffPlan> getTariffPlanList(int defaultTariffPlanId, List<Integer> contractLabelIds, int face, String title) throws SQLException
      Возвращает список тарифных планов по фильтру
      Parameters:
      defaultTariffPlanId - код тарифного плана, который должен быть включен в список независимо от того, удовлетворяет он фильтру или нет
      contractLabelIds - маска групп
      face - физ или юр лицо, для которого предписан тариф
      title - номер договора, который должен удовлетворять паттерну тарифа
      Returns:
      Throws:
      SQLException
    • copyTariffPlan

      public int copyTariffPlan(int tariffPlanId) throws SQLException
      Создает новый тарифный план, полностью аналогичный заданному
      Parameters:
      tariffPlanId - - копируемый тарифный план
      Returns:
      код нового тарифного плана
      Throws:
      SQLException
    • insertNodeCopy

      protected int insertNodeCopy(Map<Integer,Integer> linkNodeIds, PreparedStatement psInsertNode, Map<Integer,ru.bitel.bgbilling.kernel.tariff.server.dao.TreeNode> oldNodeMap, ru.bitel.bgbilling.kernel.tariff.server.dao.TreeNode oldTreeNode) throws SQLException
      Throws:
      SQLException
    • insertNode

      protected int insertNode(PreparedStatement psInsertNode, ru.bitel.bgbilling.kernel.tariff.server.dao.TreeNode treeNode) throws SQLException
      Throws:
      SQLException
    • copyTariffPlan

      public int copyTariffPlan(TariffPlan tp) throws SQLException
      Создает новый тарифный план с такими же значениями полей, как и у заданного плана.
      Parameters:
      tp - - копируемый тарифный план
      Returns:
      код скопированного тарифного плана
      Throws:
      SQLException
    • getTariffPlanTreeId

      public int getTariffPlanTreeId(int tariffPlanId) throws SQLException
      Throws:
      SQLException
    • getModuleTrees

      public Map<Integer,Integer> getModuleTrees(int treeId) throws SQLException
      Parameters:
      treeId -
      Returns:
      Throws:
      SQLException
    • usesModule

      public boolean usesModule(int tariffPlanId, int moduleId) throws SQLException
      Проверяет, использует ли тарифный план данный модуль
      Parameters:
      tariffPlanId - тарифный план
      moduleId - код модуля
      Returns:
      true - если использует
      Throws:
      SQLException
    • searchTariffPlans

      public void searchTariffPlans(SearchResult<TariffPlan> searchResult, TariffPlanSearchParameters tariffPlanSearchParameters) throws SQLException
      Throws:
      SQLException
    • getTariffContractCount

      public Map<Integer,TariffPlanDao.TariffPlanCounts> getTariffContractCount(List<Integer> tariffIds) throws SQLException
      Throws:
      SQLException
    • getModuleList

      public List<IdTitle> getModuleList() throws SQLException
      Возвращает список модулей для которых может быть определено тарифное дерево
      Throws:
      SQLException
    • getFromRS

      protected TariffPlan getFromRS(ResultSet rs) throws SQLException
      Specified by:
      getFromRS in class ru.bitel.bgbilling.common.dao.AbstractDao<TariffPlan>
      Throws:
      SQLException
    • updateImpl

      protected void updateImpl(TariffPlan tariffPlan) throws SQLException
      Specified by:
      updateImpl in class ru.bitel.bgbilling.common.dao.AbstractDao<TariffPlan>
      Throws:
      SQLException
    • get

      public TariffPlan get(String title) throws SQLException
      Throws:
      SQLException