Package ru.bitel.bgbilling.kernel.contract.api.server.bean.customer

# Class CustomerDao

java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
ru.bitel.bgbilling.kernel.contract.api.server.bean.customer.CustomerDao

public class CustomerDao extends ru.bitel.bgbilling.kernel.base.server.logger.BGLogger

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `TABLE_CUSTOMER`
  `static final String`
  `TABLE_CUSTOMER_ACCOUNT`
  `static final String`
  `TABLE_CUSTOMER_LINK`
  `static final String`
  `TABLE_CUSTOMER_LOG`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CustomerDao(Connection con)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addCustomerLink(CustomerLink customerLink)`
  `CustomerAccount`
  `customerAccountAdd(int customerId, long account, int userId)`
  `void`
  `customerAccountDelete(int customerId, long account)`
  `List<CustomerAccount>`
  `customerAccounts(int customerId)`
  `void`
  `customerAccountSet(int customerId, int contractId, long account)`
  `Customer`
  `customerByCustomerAccount(long account)`
  `String`
  `customerEmployeeDelete(int customerId, String uuid, int userId)`
  `List<CustomerEmployee>`
  `customerEmployeeList(int customerId)`
  `String`
  `customerEmployeeUpdate(int customerId, CustomerEmployee value, int userId)`
  `void`
  `deleteCustomer(int customerId)`
  `Customer`
  `getCustomer(int customerId)`
  Customer с данными клиента
  `List<CustomerContract>`
  `getCustomerContracts(int customerId, LocalDateTime onTime)`
  `org.json.JSONObject`
  `getCustomerDataJson(int customerId)`
  `Map<Integer,org.json.JSONObject>`
  `getCustomerDataListForContracts(List<Integer> contractIds)`
  `List<CustomerContactItem>`
  `getCustomerEmailsByContractId(int contractId)`
  `Optional<CustomerLink>`
  `getCustomerLink(int contractId, LocalDateTime dateTime)`
  `String`
  `getCustomerParameter(int customerId, String fieldKey)`
  `String`
  `getCustomerParameterHistory(int customerId, String fieldKey, int lastRecordCount)`
  `int`
  `getNewCustomerId(Customer.CustomerType type)`
  `org.json.JSONArray`
  `searchByKey(Customer.CustomerType customerType, String key, String value)`
  `void`
  `searchCustomer(SearchResult<Customer> searchResult, Customer.CustomerType customerType, List<ru.bitel.bgbilling.common.model.KeyValue> filters)`
  `void`
  `setCustomerLink(int contractId, int customerId, LocalDateTime linkDateTimeFrom)`
  Установка связки клиент - договор
  `boolean`
  `setCustomerUnlinkContract(int contractId, LocalDateTime unlinkTime)`
  `String`
  `updateCustomerBank(int customerId, String text, int userId)`
  `String`
  `updateCustomerContact(int customerId, CustomerContactType contactType, String value, int userId)`
  `String`
  `updateCustomerFieldValue(int customerId, String fieldKey, String fieldValue, int userId)`

  ### Methods inherited from class ru.bitel.bgbilling.kernel.base.server.logger.BGLogger

  `error, error, error, getLogger, logError, logError`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### TABLE_CUSTOMER

    public static final String TABLE_CUSTOMER
    See Also:
      - Constant Field Values

  - ### TABLE_CUSTOMER_LOG

    public static final String TABLE_CUSTOMER_LOG
    See Also:
      - Constant Field Values

  - ### TABLE_CUSTOMER_LINK

    public static final String TABLE_CUSTOMER_LINK
    See Also:
      - Constant Field Values

  - ### TABLE_CUSTOMER_ACCOUNT

    public static final String TABLE_CUSTOMER_ACCOUNT
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### CustomerDao

    public CustomerDao(Connection con)

- ## Method Details

  - ### searchCustomer

    public void searchCustomer(SearchResult<Customer> searchResult, Customer.CustomerType customerType, List<ru.bitel.bgbilling.common.model.KeyValue> filters) throws SQLException
    Throws:
      `SQLException`

  - ### getCustomerEmailsByContractId

    public List<CustomerContactItem> getCustomerEmailsByContractId(int contractId) throws SQLException
    Throws:
      `SQLException`

  - ### getCustomerLink

    public Optional<CustomerLink> getCustomerLink(int contractId, LocalDateTime dateTime) throws SQLException
    Throws:
      `SQLException`

  - ### getCustomerDataListForContracts

    public Map<Integer,org.json.JSONObject> getCustomerDataListForContracts(List<Integer> contractIds) throws SQLException
    Throws:
      `SQLException`

  - ### addCustomerLink

    public void addCustomerLink(CustomerLink customerLink) throws SQLException
    Throws:
      `SQLException`

  - ### getNewCustomerId

    public int getNewCustomerId(Customer.CustomerType type) throws SQLException
    Throws:
      `SQLException`

  - ### updateCustomerFieldValue

    public String updateCustomerFieldValue(int customerId, String fieldKey, String fieldValue, int userId) throws SQLException
    Throws:
      `SQLException`

  - ### updateCustomerContact

    public String updateCustomerContact(int customerId, CustomerContactType contactType, String value, int userId) throws SQLException
    Throws:
      `SQLException`

  - ### updateCustomerBank

    public String updateCustomerBank(int customerId, String text, int userId) throws SQLException
    Throws:
      `SQLException`

  - ### customerEmployeeList

    public List<CustomerEmployee> customerEmployeeList(int customerId) throws SQLException
    Throws:
      `SQLException`

  - ### customerEmployeeUpdate

    public String customerEmployeeUpdate(int customerId, CustomerEmployee value, int userId) throws SQLException
    Throws:
      `SQLException`

  - ### customerEmployeeDelete

    public String customerEmployeeDelete(int customerId, String uuid, int userId) throws SQLException
    Throws:
      `SQLException`

  - ### getCustomerDataJson

    public org.json.JSONObject getCustomerDataJson(int customerId) throws SQLException
    Throws:
      `SQLException`

  - ### getCustomer

    public Customer getCustomer(int customerId) throws SQLException
    Customer с данными клиента
    Parameters:
      `customerId` -
    Returns:
    Throws:
      `ru.bitel.bgbilling.common.BGException`
      `SQLException`

  - ### searchByKey

    public org.json.JSONArray searchByKey(Customer.CustomerType customerType, String key, String value) throws SQLException
    Throws:
      `SQLException`

  - ### setCustomerLink

    public void setCustomerLink(int contractId, int customerId, LocalDateTime linkDateTimeFrom) throws SQLException
    Установка связки клиент - договор
    Parameters:
      `contractId` - id договора
      `customerId` - id кастомера
      `linkDateTimeFrom` - время привязки
    Throws:
      `ru.bitel.bgbilling.common.BGException`
      `SQLException`

  - ### getCustomerContracts

    public List<CustomerContract> getCustomerContracts(int customerId, LocalDateTime onTime) throws SQLException
    Throws:
      `SQLException`

  - ### setCustomerUnlinkContract

    public boolean setCustomerUnlinkContract(int contractId, LocalDateTime unlinkTime) throws SQLException
    Throws:
      `SQLException`

  - ### getCustomerParameterHistory

    public String getCustomerParameterHistory(int customerId, String fieldKey, int lastRecordCount) throws SQLException
    Throws:
      `SQLException`

  - ### getCustomerParameter

    public String getCustomerParameter(int customerId, String fieldKey) throws SQLException
    Throws:
      `SQLException`

  - ### deleteCustomer

    public void deleteCustomer(int customerId) throws SQLException
    Throws:
      `SQLException`

  - ### customerByCustomerAccount

    public Customer customerByCustomerAccount(long account) throws SQLException
    Throws:
      `SQLException`

  - ### customerAccounts

    public List<CustomerAccount> customerAccounts(int customerId) throws SQLException
    Throws:
      `SQLException`

  - ### customerAccountAdd

    public CustomerAccount customerAccountAdd(int customerId, long account, int userId) throws SQLException
    Throws:
      `SQLException`

  - ### customerAccountDelete

    public void customerAccountDelete(int customerId, long account) throws SQLException
    Throws:
      `SQLException`

  - ### customerAccountSet

    public void customerAccountSet(int customerId, int contractId, long account) throws SQLException
    Throws:
      `SQLException`