Package ru.bgcrm.dao
Class AddressDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.AddressDAO
-
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 intFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddHouseSelectQueryJoins(StringBuilder query, int loadLevel) voiddeleteAddressArea(int id) voiddeleteAddressCity(int id) voiddeleteAddressCountry(int id) voiddeleteAddressHouse(int id) voiddeleteAddressQuarter(int id) voiddeleteAddressStreet(int id) getAddressArea(int id, boolean loadCountryData, boolean loadCityData) getAddressCities(List<Integer> ids) Selects cities restricted and ordered by their IDsgetAddressCity(int id, boolean loadCountryData) 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 streetSubstring, List<Integer> cityIds) Поиск улиц по подстроке в заданных городахintgetCityIdByAddress(String address) getCountryIdByCityId(int[] citiesId) getHouseIdsByStreetAndHouse(int streetId, String house, List<Integer> cityIds) getUpdatedAreas(long time, int[] citiesId) getUpdatedCities(long time, int[] citiesId) getUpdatedCountries(long time, int[] countriesId) getUpdatedHouses(long time, int[] citiesId) getUpdatedQuarters(long time, int[] citiesId) getUpdatedStreets(long time, int[] citiesId) voidsearchAddressAreaList(Pageable<AddressItem> searchResult, int cityId) voidsearchAddressAreaList(Pageable<AddressItem> searchResult, int cityId, List<String> title, boolean loadCountryData, boolean loadCityData) voidsearchAddressCityList(Pageable<AddressCity> searchResult, int countryId, String title, boolean loadCountryData, Set<Integer> cityIdFilter) voidsearchAddressCountryList(Pageable<AddressCountry> searchResult, String title) voidsearchAddressHouseList(Pageable<AddressHouse> searchResult, int streetId, String housePrefix) voidsearchAddressHouseList(Pageable<AddressHouse> searchResult, int streetId, String house, boolean absolute, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) voidsearchAddressQuarterList(Pageable<AddressItem> searchResult, int cityId) voidsearchAddressQuarterList(Pageable<AddressItem> searchResult, int cityId, List<String> title, boolean loadCountryData, boolean loadCityData) voidsearchAddressStreetList(Pageable<AddressItem> searchResult, int cityId) voidsearchAddressStreetList(Pageable<AddressItem> searchResult, Set<Integer> cityIds, List<String> title, boolean loadCountryData, boolean loadCityData) updateAddressArea(AddressItem item) updateAddressCity(AddressCity city) updateAddressHouse(AddressHouse addressHouse) updateAddressQuarter(AddressItem addressItem) updateAddressStreet(AddressItem addressItem) 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
-
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:
-
-
Constructor Details
-
AddressDAO
-
-
Method Details
-
searchAddressCountryList
public void searchAddressCountryList(Pageable<AddressCountry> searchResult, String title) throws SQLException - Throws:
SQLException
-
getAddressCountry
- Throws:
SQLException
-
searchAddressCityList
public void searchAddressCityList(Pageable<AddressCity> searchResult, int countryId, String title, boolean loadCountryData, Set<Integer> cityIdFilter) throws SQLException - Throws:
SQLException
-
getAddressCity
- Throws:
SQLException
-
getAddressCities
Selects cities restricted and ordered by their IDs- Parameters:
ids- the IDs- Returns:
- Throws:
SQLException
-
searchAddressAreaList
public void searchAddressAreaList(Pageable<AddressItem> searchResult, int cityId) throws SQLException - Throws:
SQLException
-
searchAddressAreaList
public void searchAddressAreaList(Pageable<AddressItem> searchResult, int cityId, List<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(Pageable<AddressItem> searchResult, int cityId) throws SQLException - Throws:
SQLException
-
searchAddressQuarterList
public void searchAddressQuarterList(Pageable<AddressItem> searchResult, int cityId, List<String> title, boolean loadCountryData, boolean loadCityData) throws SQLException - Throws:
SQLException
-
getAddressQuarter
public AddressItem getAddressQuarter(int id, boolean loadCountryData, boolean loadCityData) throws SQLException - Throws:
SQLException
-
searchAddressStreetList
public void searchAddressStreetList(Pageable<AddressItem> searchResult, int cityId) throws SQLException - Throws:
SQLException
-
searchAddressStreetList
public void searchAddressStreetList(Pageable<AddressItem> searchResult, Set<Integer> cityIds, List<String> title, boolean loadCountryData, boolean loadCityData) throws SQLException - Throws:
SQLException
-
getAddressStreet
public AddressItem getAddressStreet(int id, boolean loadCountryData, boolean loadCityData) throws SQLException - Throws:
SQLException
-
searchAddressHouseList
public void searchAddressHouseList(Pageable<AddressHouse> searchResult, int streetId, String housePrefix) throws SQLException - Throws:
SQLException
-
searchAddressHouseList
public void searchAddressHouseList(Pageable<AddressHouse> searchResult, int streetId, 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 SQLException - Throws:
SQLException
-
addHouseSelectQueryJoins
-
updateAddressCountry
- Throws:
SQLException
-
deleteAddressCountry
- Throws:
SQLExceptionBGMessageException
-
updateAddressCity
- Throws:
SQLException
-
deleteAddressCity
- Throws:
SQLExceptionBGMessageException
-
updateAddressArea
- Throws:
SQLException
-
updateAddressQuarter
- Throws:
SQLException
-
updateAddressStreet
- Throws:
SQLException
-
deleteAddressArea
- Throws:
SQLExceptionBGMessageException
-
deleteAddressQuarter
- Throws:
SQLExceptionBGMessageException
-
deleteAddressStreet
- Throws:
SQLExceptionBGMessageException
-
updateAddressHouse
- Throws:
SQLException
-
deleteAddressHouse
- Throws:
SQLExceptionBGMessageException
-
getAddressHouseFromRs
public static AddressHouse getAddressHouseFromRs(ResultSet rs, String prefix, int loadLevel) throws SQLException - Throws:
SQLException
-
getAddressItemFromRs
- Throws:
SQLException
-
getAddressCountryFromRs
public static AddressCountry getAddressCountryFromRs(ResultSet rs, String prefix) throws SQLException - Throws:
SQLException
-
getAddressCityFromRs
- Throws:
SQLException
-
getUpdatedCountries
- 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 streetSubstring, List<Integer> cityIds) throws SQLException Поиск улиц по подстроке в заданных городах- Parameters:
streetSubstring- подстрока поискаcityIds- список 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
-