Class ContractServiceDao

java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
ru.bitel.bgbilling.common.dao.AbstractDaoConstant
ru.bitel.bgbilling.common.dao.AbstractDao<ContractService>
ru.bitel.bgbilling.common.dao.AbstractIdDao<ContractService>
ru.bitel.bgbilling.kernel.contract.api.server.dao.ContractServiceDao

public class ContractServiceDao extends ru.bitel.bgbilling.common.dao.AbstractIdDao<ContractService>
Класс управления разрешенными услугами договора
  • Nested Class Summary

    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
    Удаление записи из базы.
    void
    deleteContractService(int contractId, int moduleId)
    Удаляет все услуги из базы для данного договора и данного модуля
    int
    Удаление нескольких записей из базы.
    Получает записи из базы по уникальному коду.
    getContractServiceList(int contractId, int moduleId)
    Возвращает список услуг для данного договора и модуля
    getContractServiceList(int contractId, int moduleId, Date onDate)
    Список разрешенных услуг на дату.
    getContractServiceList(int contractId, Calendar date)
    Список разрешенных услуг на дату.
    getContractServiceList(int contractId, List<Integer> serviceIds, Calendar date1, Calendar date2)
    Перечень разрешенных услуг, активных в какой-то период.
    getContractServiceSet(int contractId, Date onDate)
    Коды разрешенных на какую-то дату услуг.
    getContractServiceTitles(int contractId, int moduleId)
     
    protected ContractService
     
    void
    Обновление/добавление записи в базу.
    protected void
     

    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, 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
  • Field Details

  • Constructor Details

    • ContractServiceDao

      public ContractServiceDao(Connection con)
  • Method Details

    • getContractServiceTitles

      public List<IdTitle> getContractServiceTitles(int contractId, int moduleId) throws SQLException
      Throws:
      SQLException
    • getContractServiceList

      public List<ContractService> getContractServiceList(int contractId, int moduleId) throws SQLException
      Возвращает список услуг для данного договора и модуля
      Parameters:
      contractId - код договора
      moduleId - код модуля
      Returns:
      Throws:
      SQLException
    • getContractServiceList

      public List<ContractService> getContractServiceList(int contractId, Calendar date) throws SQLException
      Список разрешенных услуг на дату.
      Parameters:
      contractId - код договора
      date - дата
      Returns:
      Throws:
      SQLException
    • getContractServiceList

      public List<ContractService> getContractServiceList(int contractId, int moduleId, Date onDate) throws SQLException
      Список разрешенных услуг на дату.
      Parameters:
      contractId - код договора
      moduleId - код экземпляра модуля
      onDate - дата
      Returns:
      Throws:
      SQLException
    • getContractServiceSet

      public Set<Integer> getContractServiceSet(int contractId, Date onDate) throws SQLException
      Коды разрешенных на какую-то дату услуг.
      Parameters:
      contractId - код договора
      onDate - дата
      Returns:
      Throws:
      SQLException
    • getContractServiceById

      public ContractService getContractServiceById(int id) throws SQLException
      Получает записи из базы по уникальному коду.
      Parameters:
      id - код записи
      Returns:
      Throws:
      SQLException
    • updateContractService

      public void updateContractService(ContractService contractService) throws SQLException
      Обновление/добавление записи в базу.
      Parameters:
      contractService - параметры разрешенной услуги
      id - строка с кодом записи либо "new" для добавления
      Throws:
      SQLException
    • deleteContractService

      public int deleteContractService(int id) throws SQLException
      Удаление записи из базы.
      Parameters:
      id - код записи
      Throws:
      SQLException
    • deleteContractService

      public void deleteContractService(int contractId, int moduleId) throws SQLException
      Удаляет все услуги из базы для данного договора и данного модуля
      Parameters:
      contractId - код договора
      moduleId - код модуля
      Throws:
      SQLException
    • deleteContractService

      public int deleteContractService(@Nonnull List<Integer> ids) throws SQLException
      Удаление нескольких записей из базы.
      Parameters:
      ids - коды записей через запятую
      Throws:
      SQLException
    • getContractServiceList

      public List<ContractService> getContractServiceList(int contractId, List<Integer> serviceIds, Calendar date1, Calendar date2) throws SQLException
      Перечень разрешенных услуг, активных в какой-то период.
      Parameters:
      contractId - код договора
      serviceIds - коды услуг через запятую
      date1 - начало периода
      date2 - конец периода
      Returns:
      Throws:
      SQLException
    • getFromRS

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

      protected void updateImpl(ContractService b) throws SQLException
      Specified by:
      updateImpl in class ru.bitel.bgbilling.common.dao.AbstractDao<ContractService>
      Throws:
      SQLException