Class ChargeDao
java.lang.Object
ru.bitel.common.dao.AbstarctDaoConstant
ru.bitel.common.dao.AbstractDao<B>
ru.bitel.common.dao.AbstractIdDao<Charge>
ru.bitel.bgbilling.kernel.contract.balance.server.bean.ChargeDao
- All Implemented Interfaces:
java.lang.AutoCloseable
public class ChargeDao extends ru.bitel.common.dao.AbstractIdDao<Charge>
DAO для манипулирования расходами договоров.
-
Nested Class Summary
Nested classes/interfaces inherited from class ru.bitel.common.dao.AbstractDao
ru.bitel.common.dao.AbstractDao.ResultSetIterator -
Field Summary
Fields 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 ChargeDao(java.sql.Connection con) -
Method Summary
Modifier and Type Method Description intdeleteCharges(int contractId)Удаление всех расходов для договораjava.util.List<Charge>getChargeList(int contractId, int chargeTypeId, Period period, int members, javax.xml.ws.Holder<java.math.BigDecimal> holderTotalSum)Получает список расходов для договораjava.util.List<Charge>getChargeList(java.util.List<java.lang.Integer> contractIds, Period period, javax.xml.ws.Holder<java.math.BigDecimal> totalSum)protected ChargegetFromRS(java.sql.ResultSet rs)java.util.List<Charge>getPaybackList(int contractId, int paybackTypeId, Period period, int members, javax.xml.ws.Holder<java.math.BigDecimal> totalSum)java.math.BigDecimalgetSum(int contractId, java.util.Date dateFrom, java.util.Date dateTo, int typeId, int members, java.lang.Boolean isPayback)Получение суммы по расходам или возвратам.voidsearchChargeList(SearchResult<Charge> searchResult, java.util.List<java.lang.Integer> contractIds)voidsearchLastChargeList(SearchResult<Charge> searchResult, java.util.List<java.lang.Integer> contractIds, int lastCharges)protected voidupdateImpl(Charge charge)Обновляет существующий (charge.getId() > 0) или добавляет новый расход (charge.getId() <= 0).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
-
Constructor Details
-
ChargeDao
public ChargeDao(java.sql.Connection con)
-
-
Method Details
-
getChargeList
public java.util.List<Charge> getChargeList(int contractId, int chargeTypeId, Period period, int members, javax.xml.ws.Holder<java.math.BigDecimal> holderTotalSum) throws ru.bitel.bgbilling.common.BGExceptionПолучает список расходов для договора- Parameters:
contractId- код договора.chargeTypeId- код типа расхода, если <1, то значит всех типов.period- период начисления расхода для поиска. может быть = null(тогда вернет все) или может быть одна из дат = null.members- - если == 1, то только расходы данного договора, если = 2 то вернет еще и расходы з.субдоговоров, если = 3 то только расходы зависемых субдоговоров.holderTotalSum- - возвращаемое поле, если != null, то сюда занесется общая сумма по всем выбранным приходам. Если вам не нужно это, ставте null.- Throws:
ru.bitel.bgbilling.common.BGException
-
getChargeList
public java.util.List<Charge> getChargeList(java.util.List<java.lang.Integer> contractIds, Period period, javax.xml.ws.Holder<java.math.BigDecimal> totalSum) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
searchChargeList
public void searchChargeList(SearchResult<Charge> searchResult, java.util.List<java.lang.Integer> contractIds) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
searchLastChargeList
public void searchLastChargeList(SearchResult<Charge> searchResult, java.util.List<java.lang.Integer> contractIds, int lastCharges) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getPaybackList
public java.util.List<Charge> getPaybackList(int contractId, int paybackTypeId, Period period, int members, javax.xml.ws.Holder<java.math.BigDecimal> totalSum) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
deleteCharges
public int deleteCharges(int contractId) throws ru.bitel.bgbilling.common.BGExceptionУдаление всех расходов для договора- Parameters:
contractId-- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
getSum
public java.math.BigDecimal getSum(int contractId, java.util.Date dateFrom, java.util.Date dateTo, int typeId, int members, java.lang.Boolean isPayback) throws ru.bitel.bgbilling.common.BGExceptionПолучение суммы по расходам или возвратам.- Parameters:
contractId- - код договора.dateFrom- - от даты, может быть = null.dateTo- - до даты, может быть = null.typeId- - тип, если < 1, то все типы.members- - если == 1, то только данного договора, если = 2 то вернет еще и з.субдоговоров, если = 3 то только зависемых субдоговоров.isPayback- - true - возврат, false - расход, null - все.- Throws:
ru.bitel.bgbilling.common.BGException
-
updateImpl
protected void updateImpl(Charge charge) throws ru.bitel.bgbilling.common.BGException, java.sql.SQLExceptionОбновляет существующий (charge.getId() > 0) или добавляет новый расход (charge.getId() <= 0).- Specified by:
updateImplin classru.bitel.common.dao.AbstractDao<Charge>- Parameters:
charge- объект с данными расхода- Throws:
ru.bitel.bgbilling.common.BGExceptionjava.sql.SQLException
-
getFromRS
protected Charge getFromRS(java.sql.ResultSet rs) throws java.sql.SQLException, ru.bitel.bgbilling.common.BGException- Specified by:
getFromRSin classru.bitel.common.dao.AbstractDao<Charge>- Throws:
java.sql.SQLExceptionru.bitel.bgbilling.common.BGException
-