Package org.bgerp.dao.customer
Class CustomerDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
org.bgerp.dao.customer.CustomerDAO
- Direct Known Subclasses:
CustomerDAO
-
Nested Class Summary
Nested classes/interfaces inherited from class ru.bgcrm.dao.CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id>
-
Field Summary
Fields inherited from class ru.bgcrm.dao.CommonDAO
con, log, SQL_AND, SQL_DELETE, SQL_DELETE_FROM, SQL_DESC, SQL_DISTINCT, SQL_FROM, SQL_GROUP_BY, SQL_INNER_JOIN, SQL_INSERT_IGNORE_INTO, SQL_INSERT_INTO, SQL_LEFT_JOIN, SQL_LIMIT, SQL_ON_DUP_KEY_UPDATE, SQL_ORDER_BY, SQL_REPLACE, SQL_SELECT, SQL_SELECT_ALL_FROM, SQL_SELECT_COUNT_ROWS, SQL_SET, SQL_UNION_ALL, SQL_UPDATE, SQL_VALUES, SQL_VALUES_1, SQL_VALUES_2, SQL_VALUES_3, SQL_VALUES_4, SQL_VALUES_5, SQL_WHERE
-
Constructor Summary
ConstructorsConstructorDescriptionCustomerDAO
(Connection con) CustomerDAO
(Connection con, boolean history, int userId) -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteCustomer
(int id) Удаляет контрагента из БД по коду.extractCustomerWithRef
(int customerId) Deprecated.getCustomerById
(int customerId) Выбирает контрагента по его коду.getCustomerByTitle
(String customerTitle) Deprecated.static Customer
getCustomerFromRs
(ResultSet rs, String prefix) getCustomerTitles
(String title, int count) Возвращает названия контрагенов с подстрокой.getGroupIds
(int customerId) void
searchCustomerByLinkedObjectTitle
(Pageable<Customer> searchResult, String linkedObjectTypeLike, String linkedObjectTitle) Deprecated.void
searchCustomerList
(Pageable<Customer> searchResult, String title) Выбирает контрагентов по названию.void
searchCustomerList
(Pageable<Customer> searchResult, Set<Integer> groupIds) Deprecated.void
searchCustomerListByAddress
(Pageable<ParameterSearchedObject<Customer>> searchResult, List<Integer> addressParamIdList, int houseId, String houseFlat, String houseRoom) Выбирает контрагентов по адресному параметру.void
searchCustomerListByAddress
(Pageable<ParameterSearchedObject<Customer>> searchResult, List<Integer> addressParamIdList, int streetId, String house, String houseFlat, String houseRoom) Выбирает контрагентов по адресному параметру.void
searchCustomerListByEmail
(Pageable<ParameterSearchedObject<Customer>> searchResult, List<Integer> emailParamIdList, String email) Выбирает контрагентов по параметру типа Email.void
searchCustomerListByPhone
(Pageable<Customer> searchResult, Collection<Integer> phoneParamIdList, String... phoneNumbers) Выбирает контрагентов по номеру или номерам телефонов.void
searchCustomerListByText
(Pageable<Customer> searchResult, List<Integer> textParamIdList, String value) Выбирает контрагентов по строковому параметру.void
updateCustomer
(Customer customer) Обновляет информацию о контрагенте в БД.void
updateCustomerTitle
(String titleBefore, Customer customer, int changedParamId, Response response) Обновляет название контрагента,генерируя его из параметров.void
updateGroupIds
(int customerId, Set<Integer> groupIds) Methods inherited from class ru.bgcrm.dao.CommonDAO
deleteById, foundRows, getById, getGroupedIds, getGroupedIds, getIds, getIds, getPageLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, update, updateColumn, updateIds, updateIds, updateOrInsert
-
Constructor Details
-
CustomerDAO
-
CustomerDAO
-
-
Method Details
-
searchCustomerList
Выбирает контрагентов по названию.- Parameters:
searchResult
-title
-- Throws:
SQLException
-
searchCustomerListByEmail
public void searchCustomerListByEmail(Pageable<ParameterSearchedObject<Customer>> searchResult, List<Integer> emailParamIdList, String email) Выбирает контрагентов по параметру типа Email.- Parameters:
searchResult
-emailParamIdList
-email
- Email, поиск идёт по точному совпадению и совпадению домена- Throws:
SQLException
-
searchCustomerListByText
public void searchCustomerListByText(Pageable<Customer> searchResult, List<Integer> textParamIdList, String value) throws SQLException Выбирает контрагентов по строковому параметру.- Parameters:
searchResult
-textParamIdList
-value
-- Throws:
SQLException
-
searchCustomerListByAddress
public void searchCustomerListByAddress(Pageable<ParameterSearchedObject<Customer>> searchResult, List<Integer> addressParamIdList, int streetId, String house, String houseFlat, String houseRoom) throws SQLException Выбирает контрагентов по адресному параметру.- Parameters:
searchResult
-addressParamIdList
-streetId
-house
-houseFlat
-houseRoom
-- Throws:
SQLException
-
searchCustomerListByAddress
public void searchCustomerListByAddress(Pageable<ParameterSearchedObject<Customer>> searchResult, List<Integer> addressParamIdList, int houseId, String houseFlat, String houseRoom) Выбирает контрагентов по адресному параметру.- Parameters:
searchResult
-addressParamIdList
-houseId
- код домаhouseFlat
- квартираhouseRoom
- комната- Throws:
SQLException
-
searchCustomerListByPhone
public void searchCustomerListByPhone(Pageable<Customer> searchResult, Collection<Integer> phoneParamIdList, String... phoneNumbers) Выбирает контрагентов по номеру или номерам телефонов.- Parameters:
searchResult
-phoneParamIdList
-phoneNumbers
-
-
getCustomerById
Выбирает контрагента по его коду.- Parameters:
customerId
-- Returns:
-
updateCustomer
Обновляет информацию о контрагенте в БД.- Parameters:
customer
-- Throws:
SQLException
-
deleteCustomer
Удаляет контрагента из БД по коду.- Parameters:
id
-- Throws:
SQLException
-
updateCustomerTitle
public void updateCustomerTitle(String titleBefore, Customer customer, int changedParamId, Response response) throws Exception Обновляет название контрагента,генерируя его из параметров.- Parameters:
titleBefore
- исходное название.customer
- контрагент.changedParamId
- код изменённого параметра.response
- если параметр передан, туда будет добавлено событие о изменении названия договора.- Throws:
Exception
-
getCustomerTitles
Возвращает названия контрагенов с подстрокой.- Parameters:
title
- подстрока, поиск идёт с помощью LIKE выражения.count
- количество первых названий.- Returns:
-
getGroupIds
- Throws:
SQLException
-
updateGroupIds
- Throws:
SQLException
-
getCustomerFromRs
- Parameters:
rs
-prefix
-- Throws:
SQLException
-
searchCustomerList
Deprecated. -
extractCustomerWithRef
Deprecated. -
searchCustomerByLinkedObjectTitle
@Deprecated public void searchCustomerByLinkedObjectTitle(Pageable<Customer> searchResult, String linkedObjectTypeLike, String linkedObjectTitle) Deprecated. -
getCustomerByTitle
Deprecated.- Throws:
SQLException
-