public class CustomerDAO extends CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id>con, dateFormat_DDMMYYYY, dateFormat_DDMMYYYY_HHMM, log, SQL_AND, SQL_DELETE, SQL_DESC, SQL_FROM, SQL_GROUP_BY, SQL_INNER_JOIN, SQL_INSERT, SQL_INSERT_IGNORE, SQL_LEFT_JOIN, SQL_LEFT_OUTER_JOIN, SQL_LIMIT, SQL_ON_DUP_KEY_UPDATE, SQL_OR, SQL_ORDER_BY, SQL_REPLACE, SQL_SELECT, SQL_SELECT_ALL_FROM, SQL_SELECT_COUNT_ROWS, SQL_SET, SQL_UPDATE, SQL_WHERE| Constructor and Description | 
|---|
| CustomerDAO(java.sql.Connection con) | 
| CustomerDAO(java.sql.Connection con,
           boolean history,
           int userId) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | deleteCustomer(int id)Удаляет контрагента из БД по коду. | 
| Customer | extractCustomerWithRef(int customerId) | 
| Customer | getCustomerById(int customerId)Выбирает контрагента по его коду. | 
| Customer | getCustomerByLinkedContract(Contract contract)Deprecated.  | 
| Customer | getCustomerByLinkedObject(int id,
                         java.lang.String title) | 
| Customer | getCustomerByTitle(java.lang.String customerTitle)Deprecated.  | 
| static Customer | getCustomerFromRs(java.sql.ResultSet rs,
                 java.lang.String prefix)Возвращает созданный объект  Customerзаполненный изResultSet. | 
| java.util.Set<Customer> | getCustomers(java.util.Collection<java.lang.Integer> customerIds)Получение набора контрагентов по их ID | 
| static java.util.Set<Customer> | getCustomers(java.sql.Connection connection,
            java.util.Collection<java.lang.Integer> customerIds)Получение набора контрагентов по их ID | 
| java.util.List<Customer> | getCustomersByLinkedContractsTitle(java.lang.String contractTitle) | 
| java.util.Set<Customer> | getCustomersByParamGroupId(int paramGroupId) | 
| java.util.ArrayList<Customer> | getCustomersByPhone(java.lang.String phone,
                   int paramId) | 
| void | getCustomersByPhoneByTuu(SearchResult<Customer> searchResult,
                        java.util.Collection<java.lang.Integer> phoneParamIdList,
                        java.lang.String... phoneNumbers) | 
| void | getCustomersByPhoneFromDailyAppeal(SearchResult<Customer> searchResult,
                                  java.util.Collection<java.lang.Integer> phoneParamIdList,
                                  java.lang.String... phoneNumbers) | 
| java.util.List<java.lang.String> | getCustomerTitles(java.lang.String title,
                 int count)Возвращает названия контрагенов с подстрокой. | 
| java.util.Set<java.lang.Integer> | getGroupIds(int customerId) | 
| java.util.Optional<Customer> | getLinkedCustomerToObject(int objectId) | 
| java.util.List<Customer> | getLinkedCustomerToObjectList(int objectId) | 
| java.util.Set<Customer> | searchByParamText(int paramId,
                 java.lang.String value) | 
| java.util.Set<java.lang.Integer> | searchByParamText(java.lang.String text1,
                 int paramId1,
                 java.lang.String text2,
                 int paramId2)Поиск контрагента по параметру типа "текст" | 
| void | searchCustomerByLink(SearchResult<CustomerDTO> searchResult,
                    java.lang.String linkedObjectTitle,
                    java.lang.String linkedObjectType) | 
| java.util.List<Customer> | searchCustomerByLinkedObjectId(int linkedObjectId,
                              java.lang.String linkedObjectTypeLike)Deprecated.  | 
| void | searchCustomerByLinkedObjectTitle(SearchResult<Customer> searchResult,
                                 java.lang.String linkedObjectTypeLike,
                                 java.lang.String linkedObjectTitle) | 
| void | searchCustomerList(SearchResult<Customer> searchResult,
                  java.util.Set<java.lang.Integer> groupIds)Выбирает контрагентов по группам. | 
| void | searchCustomerList(SearchResult<Customer> searchResult,
                  java.lang.String title)Выбирает контрагентов по названию. | 
| void | searchCustomerListByAddress(SearchResult<AddressSearchedObject<Customer>> searchResult,
                           java.util.List<java.lang.Integer> addressParamIdList,
                           int houseId,
                           java.lang.String houseFlat,
                           java.lang.String houseRoom)Выбирает контрагентов по адресному параметру. | 
| void | searchCustomerListByAddress(SearchResult<AddressSearchedObject<Customer>> searchResult,
                           java.util.List<java.lang.Integer> addressParamIdList,
                           int streetId,
                           java.lang.String house,
                           java.lang.String houseFlat,
                           java.lang.String houseRoom)Выбирает контрагентов по адресному параметру. | 
| void | searchCustomerListByEmail(SearchResult<ParameterSearchedObject<Customer>> searchResult,
                         java.util.List<java.lang.Integer> emailParamIdList,
                         java.lang.String email)Выбирает контрагентов по параметру типа E-Mail. | 
| void | searchCustomerListByPhone(SearchResult<Customer> searchResult,
                         java.util.Collection<java.lang.Integer> phoneParamIdList,
                         java.lang.String... phoneNumbers) | 
| void | searchCustomerListByText(SearchResult<Customer> searchResult,
                        java.util.List<java.lang.Integer> textParamIdList,
                        java.lang.String value)Выбирает контрагентов по строковому параметру. | 
| Customer | update(Customer customer) | 
| void | updateCustomer(Customer customer)Deprecated. 
 Use  update(Customer)instead. | 
| void | updateCustomerTitle(java.lang.String titleBefore,
                   Customer customer,
                   int changedParamId,
                   Response response)Обновляет название контрагента,генерируя его из параметров. | 
| void | updateGroupIds(int customerId,
              java.util.Set<java.lang.Integer> groupIds) | 
deleteById, execute, execute, execute, executeInsert, executeUpdate, getById, getFoundRows, getFoundRows, getGroupedIds, getGroupedIds, getIds, getIds, getLikePattern, getLikePatternEnd, getLikePatternStart, getLikePatternSub, getMySQLLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, sqlToBgException, update, updateColumn, updateIds, updateIdspublic CustomerDAO(java.sql.Connection con)
public CustomerDAO(java.sql.Connection con,
                   boolean history,
                   int userId)
public void searchCustomerList(SearchResult<Customer> searchResult, java.lang.String title) throws BGException
searchResult - title - java.sql.SQLExceptionBGExceptionpublic void searchCustomerList(SearchResult<Customer> searchResult, java.util.Set<java.lang.Integer> groupIds) throws BGException
searchResult - groupIds - - группы.java.sql.SQLExceptionBGExceptionpublic Customer extractCustomerWithRef(int customerId) throws BGException
BGExceptionpublic void searchCustomerListByEmail(SearchResult<ParameterSearchedObject<Customer>> searchResult, java.util.List<java.lang.Integer> emailParamIdList, java.lang.String email) throws BGException
searchResult - emailParamIdList - email - java.sql.SQLExceptionBGExceptionpublic void searchCustomerListByText(SearchResult<Customer> searchResult, java.util.List<java.lang.Integer> textParamIdList, java.lang.String value) throws java.sql.SQLException
searchResult - textParamIdList - value - java.sql.SQLExceptionpublic void searchCustomerListByAddress(SearchResult<AddressSearchedObject<Customer>> searchResult, java.util.List<java.lang.Integer> addressParamIdList, int streetId, java.lang.String house, java.lang.String houseFlat, java.lang.String houseRoom) throws java.sql.SQLException
searchResult - addressParamIdList - streetId - house - houseFlat - houseRoom - java.sql.SQLExceptionpublic void searchCustomerListByAddress(SearchResult<AddressSearchedObject<Customer>> searchResult, java.util.List<java.lang.Integer> addressParamIdList, int houseId, java.lang.String houseFlat, java.lang.String houseRoom) throws BGException
searchResult - addressParamIdList - houseId - код домаhouseFlat - квартираhouseRoom - комнатаjava.sql.SQLExceptionBGExceptionpublic void searchCustomerListByPhone(SearchResult<Customer> searchResult, java.util.Collection<java.lang.Integer> phoneParamIdList, java.lang.String... phoneNumbers) throws BGException
BGExceptionpublic java.util.ArrayList<Customer> getCustomersByPhone(java.lang.String phone, int paramId) throws BGException
BGExceptionpublic void getCustomersByPhoneFromDailyAppeal(SearchResult<Customer> searchResult, java.util.Collection<java.lang.Integer> phoneParamIdList, java.lang.String... phoneNumbers) throws BGException
BGExceptionpublic void getCustomersByPhoneByTuu(SearchResult<Customer> searchResult, java.util.Collection<java.lang.Integer> phoneParamIdList, java.lang.String... phoneNumbers) throws BGException
BGExceptionpublic java.util.List<Customer> getCustomersByLinkedContractsTitle(java.lang.String contractTitle) throws BGException
BGExceptionpublic Customer getCustomerByLinkedObject(int id, java.lang.String title) throws BGException
BGException@Deprecated public Customer getCustomerByLinkedContract(Contract contract) throws BGException
BGExceptionpublic void searchCustomerByLinkedObjectTitle(SearchResult<Customer> searchResult, java.lang.String linkedObjectTypeLike, java.lang.String linkedObjectTitle) throws BGException
BGExceptionpublic void searchCustomerByLink(SearchResult<CustomerDTO> searchResult, java.lang.String linkedObjectTitle, java.lang.String linkedObjectType)
@Deprecated public java.util.List<Customer> searchCustomerByLinkedObjectId(int linkedObjectId, java.lang.String linkedObjectTypeLike) throws BGException
linkedObjectId - linkedObjectTypeLike - BGExceptionpublic java.util.Optional<Customer> getLinkedCustomerToObject(int objectId) throws BGException
BGExceptionpublic java.util.List<Customer> getLinkedCustomerToObjectList(int objectId) throws BGException
BGExceptionpublic Customer getCustomerById(int customerId) throws BGException
customerId - BGExceptionpublic static java.util.Set<Customer> getCustomers(java.sql.Connection connection, java.util.Collection<java.lang.Integer> customerIds) throws BGException
customerIds - идентификаторы контрагентовBGExceptionpublic java.util.Set<Customer> getCustomers(java.util.Collection<java.lang.Integer> customerIds) throws BGException
customerIds - идентификаторы контрагентовBGException@Deprecated public Customer getCustomerByTitle(java.lang.String customerTitle) throws java.sql.SQLException
searchCustomerListcustomerTitle - названиеjava.sql.SQLException@Deprecated public void updateCustomer(Customer customer) throws java.sql.SQLException
update(Customer) instead.customer - java.sql.SQLExceptionpublic void deleteCustomer(int id)
                    throws java.sql.SQLException
id - java.sql.SQLExceptionpublic void updateCustomerTitle(java.lang.String titleBefore,
                                Customer customer,
                                int changedParamId,
                                Response response)
                         throws BGException
titleBefore - исходное название.customer - контрагент.changedParamId - код изменённого параметра.response - если параметр передан, туда будет добавлено событие о изменении названия договора.BGExceptionpublic java.util.List<java.lang.String> getCustomerTitles(java.lang.String title,
                                                          int count)
                                                   throws BGException
title - подстрока, поиск идёт с помощью LIKE выражения.count - количество первых названий.BGExceptionpublic java.util.Set<java.lang.Integer> getGroupIds(int customerId)
                                             throws BGException
BGExceptionpublic void updateGroupIds(int customerId,
                           java.util.Set<java.lang.Integer> groupIds)
                    throws BGException
BGExceptionpublic static Customer getCustomerFromRs(java.sql.ResultSet rs, java.lang.String prefix) throws java.sql.SQLException
Customer заполненный из ResultSet.rs - prefix - java.sql.SQLExceptionpublic java.util.Set<java.lang.Integer> searchByParamText(java.lang.String text1,
                                                          int paramId1,
                                                          java.lang.String text2,
                                                          int paramId2)
                                                   throws BGException
text2 - paramId2 - BGExceptionpublic java.util.Set<Customer> searchByParamText(int paramId, java.lang.String value) throws BGException
BGExceptionpublic java.util.Set<Customer> getCustomersByParamGroupId(int paramGroupId)