Class TariffPlanDao
java.lang.Object
ru.bitel.common.dao.AbstarctDaoConstant
ru.bitel.common.dao.AbstractDao<B>
ru.bitel.common.dao.AbstractIdDao<TariffPlan>
ru.bitel.bgbilling.kernel.tariff.server.bean.TariffPlanDao
- All Implemented Interfaces:
java.lang.AutoCloseable,Directory<TariffPlan>
- Direct Known Subclasses:
TariffPlanManager
public class TariffPlanDao extends ru.bitel.common.dao.AbstractIdDao<TariffPlan> implements Directory<TariffPlan>
Управление объектами типа
TariffPlan-
Nested Class Summary
Nested Classes Modifier and Type Class Description classTariffPlanDao.TariffPlanCountsNested classes/interfaces inherited from class ru.bitel.common.dao.AbstractDao
ru.bitel.common.dao.AbstractDao.ResultSetIterator -
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringTABLE_TARIFF_PLANFields inherited from class ru.bitel.common.dao.AbstractDao
cacheFilter, cacheJoin, cacheOrderBy, cachePaged, cachePS, cacheWhat, con, getByIdPS, moduleId, orderByPattern, tableNameFields inherited from class ru.bitel.common.dao.AbstarctDaoConstant
ERROR, fields, SQL_CALC_FOUND_ROWS, SQL_DELETE, SQL_DISTINCT, SQL_EQ, SQL_EQCS, SQL_FROM, SQL_GROUP, SQL_IN, SQL_INSERT, SQL_LIMIT, SQL_ON_DUPLICATE_KEY_UPDATE, SQL_ORDER, SQL_SELECT, SQL_SET, SQL_UPDATE, SQL_VALUES, SQL_WHERE -
Constructor Summary
Constructors Constructor Description TariffPlanDao(java.sql.Connection con) -
Method Summary
Modifier and Type Method Description intcopyTariffPlan(int tpid)Создает новый тарифный план, полностью аналогичный заданномуintcopyTariffPlan(TariffPlan tp)Создает новый тарифный план с такими же значениями полей, как и у заданного плана.TariffPlanget(java.lang.String title)Получение элемента по title(name) Может быть не имплементировано - в этом случае бросаетсяUnsupportedOperationExceptionprotected TariffPlangetFromRS(java.sql.ResultSet rs)java.util.List<IdTitle>getModuleList()Возвращает список модулей для которых может быть определено тарифное деревоjava.util.Map<java.lang.Integer,java.lang.Integer>getModuleTrees(int treeId)java.util.Map<java.lang.Integer,TariffPlanDao.TariffPlanCounts>getTariffContractCount(java.util.List<java.lang.Integer> tariffIds)TariffPlangetTariffPlan(int id)Deprecated.java.util.List<TariffPlan>getTariffPlanList()Deprecated.Uselist()insteadjava.util.List<TariffPlan>getTariffPlanList(int defaultID, java.util.List<java.lang.Integer> contractLabelIds, int face, java.lang.String title)Возвращает список тарифных планов по фильтруjava.util.List<TariffPlan>getTariffPlanList(java.util.List<java.lang.Integer> idFilter)Deprecated.Uselist(List<Integer>)insteadjava.util.Map<java.lang.Integer,TariffPlan>getTariffPlanMap()Получение Map с ключами Integer - код тарифа и значениями типа TariffPlanintgetTariffPlanTreeId(int tariffPlanId)protected intinsertNode(java.sql.PreparedStatement psInsertNode, ru.bitel.bgbilling.kernel.tariff.server.bean.TreeNode treeNode)protected intinsertNodeCopy(java.util.Map<java.lang.Integer,java.lang.Integer> linkNodeIds, java.sql.PreparedStatement psInsertNode, java.util.Map<java.lang.Integer,ru.bitel.bgbilling.kernel.tariff.server.bean.TreeNode> oldNodeMap, ru.bitel.bgbilling.kernel.tariff.server.bean.TreeNode oldTreeNode)java.util.List<TariffPlan>list()Список всех объектовTariffPlanс сортировкой по названиюjava.util.List<TariffPlan>list(java.util.List<java.lang.Integer> idFilter)Список объектовTariffPlanупорядоченный по названиюvoidsearchTariffPlans(SearchResult<TariffPlan> searchResult, int showActual, java.util.List<java.lang.Integer> moduleIds, java.util.List<java.lang.Integer> labelIds, java.lang.String titleMask)protected voidupdateImpl(TariffPlan tariffPlan)booleanusesModule(int tariffPlanId, int moduleId)Проверяет, использует ли тарифный план данный модульMethods inherited from class ru.bitel.common.dao.AbstractIdDao
delete, get, getAndDelete, getAndUpdateMethods inherited from class ru.bitel.common.dao.AbstractDao
close, delete, deleteImpl, eq, get, getById, getImpl, getListFromRS, getPeriod, getQueryById, getSQLOrder, getTableName, list, list, listImpl, listImpl, listImplPS, listImplPS, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, processException, recycle, setStatementParam, updateMethods inherited from class ru.bitel.common.dao.AbstarctDaoConstant
getSQLOrderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
TABLE_TARIFF_PLAN
protected static final java.lang.String TABLE_TARIFF_PLAN- See Also:
- Constant Field Values
-
-
Constructor Details
-
TariffPlanDao
public TariffPlanDao(java.sql.Connection con)
-
-
Method Details
-
getTariffPlanMap
public java.util.Map<java.lang.Integer,TariffPlan> getTariffPlanMap() throws ru.bitel.bgbilling.common.BGExceptionПолучение Map с ключами Integer - код тарифа и значениями типа TariffPlan- Returns:
- Map
- Throws:
ru.bitel.bgbilling.common.BGException
-
getTariffPlan
Deprecated.useAbstractIdDao.get(int)получение одного тарифа- Parameters:
id- ид тарифа- Returns:
- тариф
- Throws:
ru.bitel.bgbilling.common.BGException
-
getTariffPlanList
Deprecated.Uselist()insteadСписок всех объектовTariffPlanс сортировкой по названию- Returns:
- List
- Throws:
ru.bitel.bgbilling.common.BGException
-
list
Список всех объектовTariffPlanс сортировкой по названию- Specified by:
listin interfaceDirectory<TariffPlan>- Returns:
- List
- Throws:
ru.bitel.bgbilling.common.BGException
-
getTariffPlanList
public java.util.List<TariffPlan> getTariffPlanList(java.util.List<java.lang.Integer> idFilter) throws ru.bitel.bgbilling.common.BGExceptionDeprecated.Uselist(List<Integer>)insteadСписок объектовTariffPlanупорядоченный по названию- Parameters:
idFilter- - cписок-фильтр с кодами тарифов- Returns:
- List
- Throws:
ru.bitel.bgbilling.common.BGException
-
list
public java.util.List<TariffPlan> list(java.util.List<java.lang.Integer> idFilter) throws ru.bitel.bgbilling.common.BGExceptionСписок объектовTariffPlanупорядоченный по названию- Parameters:
idFilter- - cписок-фильтр с кодами тарифов- Returns:
- List
- Throws:
ru.bitel.bgbilling.common.BGException
-
getTariffPlanList
public java.util.List<TariffPlan> getTariffPlanList(int defaultID, java.util.List<java.lang.Integer> contractLabelIds, int face, java.lang.String title) throws ru.bitel.bgbilling.common.BGExceptionВозвращает список тарифных планов по фильтру- Parameters:
defaultID- код тарифного плана, который должен быть включен в список независимо от того, удовлетворяет он фильтру или нетgroups- маска группface- физ или юр лицо, для которого предписан тарифtitle- номер договора, который должен удовлетворять паттерну тарифа- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
copyTariffPlan
public int copyTariffPlan(int tpid) throws ru.bitel.bgbilling.common.BGExceptionСоздает новый тарифный план, полностью аналогичный заданному- Parameters:
tpid- - копируемый тарифный план- Returns:
- код нового тарифного плана
- Throws:
java.sql.SQLExceptionru.bitel.bgbilling.common.BGException
-
insertNodeCopy
protected int insertNodeCopy(java.util.Map<java.lang.Integer,java.lang.Integer> linkNodeIds, java.sql.PreparedStatement psInsertNode, java.util.Map<java.lang.Integer,ru.bitel.bgbilling.kernel.tariff.server.bean.TreeNode> oldNodeMap, ru.bitel.bgbilling.kernel.tariff.server.bean.TreeNode oldTreeNode) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
insertNode
protected int insertNode(java.sql.PreparedStatement psInsertNode, ru.bitel.bgbilling.kernel.tariff.server.bean.TreeNode treeNode) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
copyTariffPlan
Создает новый тарифный план с такими же значениями полей, как и у заданного плана.- Parameters:
tp- - копируемый тарифный план- Returns:
- код скопированного тарифного плана
- Throws:
ru.bitel.bgbilling.common.BGException
-
getTariffPlanTreeId
public int getTariffPlanTreeId(int tariffPlanId) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getModuleTrees
public java.util.Map<java.lang.Integer,java.lang.Integer> getModuleTrees(int treeId) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
usesModule
public boolean usesModule(int tariffPlanId, int moduleId) throws ru.bitel.bgbilling.common.BGExceptionПроверяет, использует ли тарифный план данный модуль- Parameters:
plan- тарифный планmoduleId- код модуля- Returns:
- true - если использует
- Throws:
ru.bitel.bgbilling.common.BGException
-
searchTariffPlans
public void searchTariffPlans(SearchResult<TariffPlan> searchResult, int showActual, java.util.List<java.lang.Integer> moduleIds, java.util.List<java.lang.Integer> labelIds, java.lang.String titleMask) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getTariffContractCount
public java.util.Map<java.lang.Integer,TariffPlanDao.TariffPlanCounts> getTariffContractCount(java.util.List<java.lang.Integer> tariffIds) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getModuleList
Возвращает список модулей для которых может быть определено тарифное дерево- Throws:
ru.bitel.bgbilling.common.BGException
-
getFromRS
protected TariffPlan getFromRS(java.sql.ResultSet rs) throws java.sql.SQLException, ru.bitel.bgbilling.common.BGException- Specified by:
getFromRSin classru.bitel.common.dao.AbstractDao<TariffPlan>- Throws:
java.sql.SQLExceptionru.bitel.bgbilling.common.BGException
-
updateImpl
protected void updateImpl(TariffPlan tariffPlan) throws ru.bitel.bgbilling.common.BGException, java.sql.SQLException- Specified by:
updateImplin classru.bitel.common.dao.AbstractDao<TariffPlan>- Throws:
ru.bitel.bgbilling.common.BGExceptionjava.sql.SQLException
-
get
Description copied from interface:DirectoryПолучение элемента по title(name) Может быть не имплементировано - в этом случае бросаетсяUnsupportedOperationException- Specified by:
getin interfaceDirectory<TariffPlan>- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
AbstractIdDao.get(int)