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
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
Fields 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, SQL_INSERT_IGNORE, 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_WHERE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addHouseSelectQueryJoins
(StringBuilder query, int loadLevel) void
deleteAddressArea
(int id) void
deleteAddressCity
(int id) void
deleteAddressCountry
(int id) void
deleteAddressHouse
(int id) void
deleteAddressQuarter
(int id) void
deleteAddressStreet
(int id) getAddressArea
(int id, boolean loadCountryData, boolean loadCityData) getAddressCity
(int id, boolean loadCountryData) static AddressCity
getAddressCityFromRs
(ResultSet rs, String prefix) getAddressCountry
(int id) static AddressCountry
getAddressCountryFromRs
(ResultSet rs, String prefix) getAddressHouse
(int id, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) static AddressHouse
getAddressHouseFromRs
(ResultSet rs, String prefix, int loadLevel) static AddressItem
getAddressItemFromRs
(ResultSet rs, String prefix) getAddressQuarter
(int id, boolean loadCountryData, boolean loadCityData) getAddressStreet
(int id, boolean loadCountryData, boolean loadCityData) getAddressStreetsBySubstring
(String streetSubstring, List<Integer> cityIds) Поиск улиц по подстроке в заданных городахint
getCityIdByAddress
(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) void
searchAddressAreaList
(Pageable<AddressItem> searchResult, int cityId) void
searchAddressAreaList
(Pageable<AddressItem> searchResult, int cityId, List<String> title, boolean loadCountryData, boolean loadCityData) void
searchAddressCityList
(Pageable<AddressCity> searchResult, int countryId, String title, boolean loadCountryData, Set<Integer> cityIdFilter) void
searchAddressCountryList
(Pageable<AddressCountry> searchResult, String title) void
searchAddressHouseList
(Pageable<AddressHouse> searchResult, int streetId, String housePrefix) void
searchAddressHouseList
(Pageable<AddressHouse> searchResult, int streetId, String house, boolean absolute, boolean loadCountryData, boolean loadCityData, boolean loadStreetData) void
searchAddressQuarterList
(Pageable<AddressItem> searchResult, int cityId) void
searchAddressQuarterList
(Pageable<AddressItem> searchResult, int cityId, List<String> title, boolean loadCountryData, boolean loadCityData) void
searchAddressStreetList
(Pageable<AddressItem> searchResult, int cityId) void
searchAddressStreetList
(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, getFoundRows, getGroupedIds, getGroupedIds, getIds, getIds, getLikePatternEnd, getLikePatternStart, getLikePatternSub, getPageLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, sqlToBgException, 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
-
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:
SQLException
BGMessageException
-
updateAddressCity
- Throws:
SQLException
-
deleteAddressCity
- Throws:
SQLException
BGMessageException
-
updateAddressArea
- Throws:
SQLException
-
updateAddressQuarter
- Throws:
SQLException
-
updateAddressStreet
- Throws:
SQLException
-
deleteAddressArea
- Throws:
SQLException
BGMessageException
-
deleteAddressQuarter
- Throws:
SQLException
BGMessageException
-
deleteAddressStreet
- Throws:
SQLException
BGMessageException
-
updateAddressHouse
- Throws:
SQLException
-
deleteAddressHouse
- Throws:
SQLException
BGMessageException
-
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
-