Package ru.bgcrm.dao
Class AddressDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.AddressDAO
- Direct Known Subclasses:
AnalyticDAO
-
Nested Class Summary
Nested classes/interfaces inherited from class ru.bgcrm.dao.CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class ru.bgcrm.dao.CommonDAO
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHouseSelectQueryJoins(StringBuilder query, int loadLevel) voiddeleteAddressArea(int id) voiddeleteAddressCity(int id) voiddeleteAddressCountry(int id) voiddeleteAddressHouse(int id) voiddeleteAddressQuarter(int id) voiddeleteAddressStreet(int id) static AddressAgglomerationgetAddressAgglomerationFromRs(ResultSet rs, String prefix) getAddressArea(int id, boolean loadCountryData, boolean loadCityData) getAddressCity(int id, boolean loadCountryData) getAddressCityAgglomeration(int cityId) Deprecated.static AddressCitygetAddressCityFromRs(ResultSet rs, String prefix) getAddressCountry(int id) static AddressCountrygetAddressCountryFromRs(ResultSet rs, String prefix) getAddressHouse(int id, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) static AddressHousegetAddressHouseFromRs(ResultSet rs, String prefix, int loadLevel) static AddressItemgetAddressItemFromRs(ResultSet rs, String prefix) getAddressQuarter(int id, boolean loadCountryData, boolean loadCityData) getAddressStreet(int id, boolean loadCountryData, boolean loadCityData) getAddressStreetsBySubstring(String streetTitleLike, List<Integer> cityIds) Поиск улиц по подстроке в заданных городахstatic AddressSubjectAreagetAddressSubjectAreaFromRs(ResultSet rs, String prefix) static AddressSubjectgetAddressSubjectFromRs(ResultSet rs, String prefix) @Nullable AddressAgglomerationgetAgglomerationByCity(int cityId) @Nullable AddressAgglomerationgetAgglomerationByHouseId(int houseId) getCitiesByAgglomeration(int agglomerationId) intgetCityIdByAddress(String address) getCityIdsByAgglomerationId(int agglomerationId) getCityTitle(int cityId) getCountryIdByCityId(List<Integer> countryIds) getHouseIdsByStreetAndHouse(int streetId, String house, List<Integer> cityIds) voidgetHouseListByTerm(SearchResult searchResult, String term) getQuartersList(int cityId) getSegmentsInCitiesMap(List<Integer> cityIds) getSegmentsList(int cityId) getUpdatedAreas(long time, List<Integer> citiesId) getUpdatedCities(long time, List<Integer> citiesId) getUpdatedCountries(long time, List<Integer> countriesId) getUpdatedHouses(long time, List<Integer> citiesId) getUpdatedQuarters(long time, List<Integer> citiesId) getUpdatedStreets(long time, List<Integer> citiesId) voidsearchAddressAgglomerationList(SearchResult<AddressAgglomeration> searchResult) voidsearchAddressAreaList(SearchResult<AddressItem> searchResult, int cityId) voidsearchAddressAreaList(SearchResult<AddressItem> searchResult, int cityId, String title, boolean loadCountryData, boolean loadCityData) voidsearchAddressCityList(SearchResult<AddressCity> searchResult, int countryId, String title, boolean loadCountryData, Set<Integer> cityIdFilter) voidsearchAddressCountryList(SearchResult<AddressCountry> searchResult, String title) voidsearchAddressHouseList(SearchResult<AddressHouse> searchResult, int streetId, String housePrefix) voidsearchAddressHouseList(SearchResult<AddressHouse> searchResult, int streetId, String house, boolean absolute, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) voidsearchAddressHouseList(SearchResult<AddressHouse> searchResult, Set<Integer> streetIds, String house, boolean absolute, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) voidsearchAddressQuarterList(SearchResult<AddressItem> searchResult, int cityId) voidsearchAddressQuarterList(SearchResult<AddressItem> searchResult, int cityId, String title, boolean loadCountryData, boolean loadCityData) voidsearchAddressQuarterList(SearchResult<AddressItem> searchResult, Set<Integer> cityIds, String title, boolean loadCityData) voidsearchAddressStreetList(SearchResult<AddressItem> searchResult, int cityId) voidsearchAddressStreetList(SearchResult<AddressItem> searchResult, Set<Integer> cityIds, String title, boolean loadCountryData, boolean loadCityData) voidsearchAddressStreetList(SearchResult<AddressItem> searchResult, Set<Integer> cityIds, String title, boolean loadCountryData, boolean loadCityData, boolean sorted) Ищет адреса с сортировкойsearchFullAddressList(String title) voidupdateAddressArea(AddressItem addressItem) voidupdateAddressCity(AddressCity addressCity) voidupdateAddressCityAgglomeration(int cityId, int agglomerationId) voidupdateAddressCountry(AddressCountry addressCountry) voidupdateAddressHouse(AddressHouse addressHouse) voidupdateAddressQuarter(AddressItem addressItem) voidupdateAddressStreet(AddressItem addressItem) voidupdateLastUpdateColumn(int id) Methods inherited from class ru.bgcrm.dao.CommonDAO
buildPlaceholders, deleteById, execute, execute, execute, executeBatch, executeInsert, executeUpdate, getById, getFoundRows, getFoundRows, getGroupedIds, getGroupedIds, getIds, getIds, getLikePattern, getLikePatternEnd, getLikePatternStart, getLikePatternSub, getMySQLLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, sqlToBgException, update, updateColumn, updateIds, updateIds
-
Field Details
-
LOAD_LEVEL_HOUSE
public static final int LOAD_LEVEL_HOUSE- See Also:
-
LOAD_LEVEL_STREET
public static final int LOAD_LEVEL_STREET- See Also:
-
LOAD_LEVEL_CITY
public static final int LOAD_LEVEL_CITY- See Also:
-
LOAD_LEVEL_COUNTRY
public static final int LOAD_LEVEL_COUNTRY- See Also:
-
PARAM_SUBJECT
public static final int PARAM_SUBJECT- See Also:
-
-
Constructor Details
-
AddressDAO
-
-
Method Details
-
searchAddressCountryList
public void searchAddressCountryList(SearchResult<AddressCountry> searchResult, String title) throws SQLException - Throws:
SQLException
-
getAddressCountry
- Throws:
SQLException
-
searchAddressAgglomerationList
public void searchAddressAgglomerationList(SearchResult<AddressAgglomeration> searchResult) throws SQLException - Throws:
SQLException
-
getAgglomerationByCity
-
getAddressCityAgglomeration
Deprecated.- Throws:
SQLException- See Also:
-
searchAddressCityList
public void searchAddressCityList(SearchResult<AddressCity> searchResult, int countryId, String title, boolean loadCountryData, Set<Integer> cityIdFilter) throws SQLException - Throws:
SQLException
-
getAddressCity
- Throws:
SQLException
-
searchAddressAreaList
public void searchAddressAreaList(SearchResult<AddressItem> searchResult, int cityId) throws SQLException - Throws:
SQLException
-
searchAddressAreaList
public void searchAddressAreaList(SearchResult<AddressItem> searchResult, int cityId, String title, boolean loadCountryData, boolean loadCityData) throws SQLException - Throws:
SQLException
-
getAddressArea
public AddressItem getAddressArea(int id, boolean loadCountryData, boolean loadCityData) throws SQLException - Throws:
SQLException
-
searchAddressQuarterList
public void searchAddressQuarterList(SearchResult<AddressItem> searchResult, int cityId) throws SQLException - Throws:
SQLException
-
searchAddressQuarterList
public void searchAddressQuarterList(SearchResult<AddressItem> searchResult, int cityId, String title, boolean loadCountryData, boolean loadCityData) throws SQLException - Throws:
SQLException
-
searchAddressQuarterList
public void searchAddressQuarterList(SearchResult<AddressItem> searchResult, Set<Integer> cityIds, String title, boolean loadCityData) -
getAddressQuarter
public AddressItem getAddressQuarter(int id, boolean loadCountryData, boolean loadCityData) throws SQLException - Throws:
SQLException
-
searchAddressStreetList
public void searchAddressStreetList(SearchResult<AddressItem> searchResult, int cityId) throws SQLException - Throws:
SQLException
-
searchAddressStreetList
public void searchAddressStreetList(SearchResult<AddressItem> searchResult, Set<Integer> cityIds, String title, boolean loadCountryData, boolean loadCityData) throws SQLException - Throws:
SQLException
-
searchAddressStreetList
public void searchAddressStreetList(SearchResult<AddressItem> searchResult, Set<Integer> cityIds, String title, boolean loadCountryData, boolean loadCityData, boolean sorted) throws SQLException Ищет адреса с сортировкой- Throws:
SQLException
-
getAddressStreet
public AddressItem getAddressStreet(int id, boolean loadCountryData, boolean loadCityData) throws SQLException - Throws:
SQLException
-
searchFullAddressList
- Throws:
SQLException
-
getAgglomerationByHouseId
@Nullable public @Nullable AddressAgglomeration getAgglomerationByHouseId(int houseId) throws BGException - Throws:
BGException
-
searchAddressHouseList
public void searchAddressHouseList(SearchResult<AddressHouse> searchResult, int streetId, String housePrefix) throws SQLException - Throws:
SQLException
-
searchAddressHouseList
public void searchAddressHouseList(SearchResult<AddressHouse> searchResult, int streetId, String house, boolean absolute, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) throws SQLException - Throws:
SQLException
-
searchAddressHouseList
public void searchAddressHouseList(SearchResult<AddressHouse> searchResult, Set<Integer> streetIds, String house, boolean absolute, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) throws SQLException - Throws:
SQLException
-
getAddressHouse
public AddressHouse getAddressHouse(int id, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) throws BGException - Throws:
BGException
-
addHouseSelectQueryJoins
-
updateAddressCountry
- Throws:
BGException
-
deleteAddressCountry
- Throws:
BGException
-
updateAddressCity
- Throws:
BGException
-
updateAddressCityAgglomeration
- Throws:
BGException
-
deleteAddressCity
- Throws:
BGException
-
checkItem
public PreparedStatement checkItem(int id, String table, String title) throws SQLException, BGMessageException - Throws:
SQLExceptionBGMessageException
-
updateAddressArea
- Throws:
BGException
-
updateAddressQuarter
- Throws:
BGException
-
updateAddressStreet
- Throws:
BGException
-
deleteAddressArea
- Throws:
BGException
-
deleteAddressQuarter
- Throws:
BGException
-
deleteAddressStreet
- Throws:
BGException
-
updateAddressHouse
- Throws:
SQLException
-
updateLastUpdateColumn
- Throws:
SQLException
-
deleteAddressHouse
- Throws:
BGException
-
getAddressHouseFromRs
public static AddressHouse getAddressHouseFromRs(ResultSet rs, String prefix, int loadLevel) throws SQLException - Throws:
SQLException
-
getAddressItemFromRs
- Throws:
SQLException
-
getAddressSubjectAreaFromRs
public static AddressSubjectArea getAddressSubjectAreaFromRs(ResultSet rs, String prefix) throws SQLException - Throws:
SQLException
-
getAddressSubjectFromRs
public static AddressSubject getAddressSubjectFromRs(ResultSet rs, String prefix) throws SQLException - Throws:
SQLException
-
getAddressCountryFromRs
public static AddressCountry getAddressCountryFromRs(ResultSet rs, String prefix) throws SQLException - Throws:
SQLException
-
getAddressAgglomerationFromRs
public static AddressAgglomeration getAddressAgglomerationFromRs(ResultSet rs, String prefix) throws SQLException - Throws:
SQLException
-
getAddressCityFromRs
- Throws:
SQLException
-
getUpdatedCountries
public List<AddressCountry> getUpdatedCountries(long time, List<Integer> countriesId) throws SQLException - Throws:
SQLException
-
getUpdatedCities
- Throws:
SQLException
-
getUpdatedHouses
- Throws:
SQLException
-
getUpdatedAreas
- Throws:
SQLException
-
getUpdatedQuarters
- Throws:
SQLException
-
getUpdatedStreets
- Throws:
SQLException
-
getCountryIdByCityId
- Throws:
SQLException
-
getAddressStreetsBySubstring
public List<AddressItem> getAddressStreetsBySubstring(String streetTitleLike, List<Integer> cityIds) throws SQLException Поиск улиц по подстроке в заданных городах- Parameters:
streetTitleLike- подстрока поиска в формате SQL-likecityIds- список id городов, в которых нужно искать если cityIds == null, то поиск по всем городам (город не задан)- Returns:
- Throws:
SQLException
-
getCityIdByAddress
- Throws:
SQLException
-
getHouseIdsByStreetAndHouse
public List<Integer> getHouseIdsByStreetAndHouse(int streetId, String house, List<Integer> cityIds) throws SQLException - Throws:
SQLException
-
getCitiesByAgglomeration
- Throws:
BGException
-
getCityIdsByAgglomerationId
- Throws:
SQLException
-
getCityTitle
- Throws:
BGException
-
getCitiesList
- Throws:
BGException
-
getCitiesMap
- Throws:
BGException
-
getQuartersList
- Throws:
BGException
-
getQuartersInCitiesMap
- Throws:
BGException
-
getSegmentsList
- Throws:
BGException
-
getSegmentsInCitiesMap
- Throws:
BGException
-
getHouseListByTerm
- Throws:
BGException
-