Class OltOnuDAO

java.lang.Object
ru.bgcrm.dao.CommonDAO
org.bgerp.plugin.bgb.getolt.dao.OltOnuDAO

public class OltOnuDAO extends CommonDAO
  • Constructor Details

  • Method Details

    • getByPortId

      public List<OltOnu> getByPortId(int oltPortId) throws SQLException
      Throws:
      SQLException
    • countByOltId

      public int countByOltId(int oltId) throws SQLException
      Throws:
      SQLException
    • countActiveByOltId

      public int countActiveByOltId(int oltId) throws SQLException
      Throws:
      SQLException
    • getByOltId

      public List<OltOnu> getByOltId(int oltId) throws SQLException
      Throws:
      SQLException
    • getByContract

      public List<OltOnu> getByContract(String operator, int contractId, String numDogovor) throws SQLException
      Parameters:
      operator - оператор ONU; пустой или null — искать по всем операторам (режим getolt:api.operator.filter=0)
      contractId - id договора в биллинге, <= 0 — искать только по номеру
      numDogovor - номер договора
      Returns:
      найденные ONU, свежие первыми
      Throws:
      SQLException
    • searchOltIds

      public Set<Integer> searchOltIds(String query) throws SQLException
      Search ONU by mac, num_dogovor, abon_fio, abon_addr. Returns distinct OLT IDs containing matching ONUs.
      Throws:
      SQLException
    • getByMac

      public OltOnu getByMac(String mac) throws SQLException
      Throws:
      SQLException
    • insertOrUpdate

      public void insertOrUpdate(OltOnu onu) throws SQLException
      Throws:
      SQLException
    • deleteByOltId

      public void deleteByOltId(int oltId) throws SQLException
      Throws:
      SQLException
    • deleteByOltPortId

      public void deleteByOltPortId(int oltPortId) throws SQLException
      Throws:
      SQLException
    • deleteStale

      public void deleteStale(int oltId, int oltPortId, List<Integer> activeOnuNums) throws SQLException
      Throws:
      SQLException
    • getAllMacEntries

      public List<OltOnuDAO.OnuMacEntry> getAllMacEntries() throws SQLException
      Get all ONU MAC entries for billing mapping. Returns id, mac, macTo, and whether billing data is already present.
      Throws:
      SQLException
    • batchUpdateBillingData

      public int batchUpdateBillingData(Map<Integer,Object[]> updates) throws SQLException
      Batch update billing data for matched ONUs. Uses PreparedStatement.addBatch() for efficiency.
      Parameters:
      updates - map of ONU id → billing data array [operator, serviceId, contractId, numDogovor, login, abonFio, abonAddr]
      Returns:
      number of updated rows
      Throws:
      SQLException