Package ru.bgcrm.dao
Class ParamValueDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.ParamValueDAO
- Direct Known Subclasses:
ParamValueDAOWrapper,PonParamValueDAO
-
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 TypeFieldDescriptionprotected booleanstatic final Stringstatic final Stringstatic final StringFields inherited from class ru.bgcrm.dao.CommonDAO
con, dateFormat_DDMMYYYY, dateFormat_DDMMYYYY_HHMM, 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
ConstructorsConstructorDescriptionParamValueDAO(Connection con) ParamValueDAO(Connection con, boolean history, int userId) -
Method Summary
Modifier and TypeMethodDescriptionintaddElement(int id, int paramId, boolean isInvertId) protected StringbuildSearchByFilledParamsQuery(List<Parameter> parameters) voidcopyParam(int fromObjectId, int toObjectId, int paramId) voidcopyParam(int fromObjectId, int fromParamId, int toObjectId, int toParamId) voidcopyParams(int fromObjectId, int toObjectId, String copyMapping) voidcopyParams(int fromObjectId, int toObjectId, Collection<Integer> paramIds) voiddeleteElement(int id, int paramId, int lineId) voiddeleteParams(String objectType, int id) getObjectIdAndParamIdByLineId(int lineId) getParamAddress(int id, int paramId) Возвращает значения адресного параметра объекта, ключ SortedMap - позиция, значение - значение на позиции.getParamAddress(int id, int paramId, int position) Возвращает адресный параметр объекта.getParamAddressExt(int id, int paramId, boolean loadDirs) Возвращает значения адресного параметра объекта, ключ SortedMap - позиция, значение - значение на позиции.getParamAddressExt(int id, int paramId, boolean loadDirs, String formatName) Возвращает значения адресного параметра объекта, ключ SortedMap - позиция, значение - значение на позиции.getParamAddressFirst(int id, int paramId) getParamBlob(int id, int paramId) booleangetParamBoolean(int id, int paramId) getParamDate(int id, int paramId) getParamDateTime(int id, int paramId) getParamEmail(int id, int paramId) getParamEmail(int id, int paramId, int position) static ParameterAddressValuestatic ParameterAddressValuegetParameterAddressValueFromRs(ResultSet rs, String prefix) static ParameterAddressValuegetParameterAddressValueFromRs(ResultSet rs, String prefix, boolean loadDirs, String formatName) @NotNull List<ParameterPhoneValueItem> getParameterPhoneValueItems(int id, int paramId) getParamFile(int id, int paramId) getParamFile(int id, int paramId, int position) getParamFile(int id, int paramId, int position, int version) getParamFileFirst(int id, int paramId) getParamFilesByPositions(int objectId, int paramId, String sqlPositions) static StringgetParamJoinFilters(String expression, String objectId) * Добавление INNER JOIN фильтров по параметрам, пока поддерживается только значение вида для списковых.getParamList(int id, int paramId) booleangetParamListAsBool(int objectId, int paramId) Зачитывание листового параметра как bool значение.getParamListCount(int id, int paramId) Deprecated.getParamListCountWithTitles(int id, int paramId) getParamListCountWithTitlesAndCount(int objectId, int paramId) getParamListCountWithTitlesAndValues(int id, int paramId) getParamListWithComments(int id, int paramId) getParamListWithTitles(int id, int paramId) getParamListWithTitlesAndComments(int id, int paramId) getParamNumber(int id, int paramId) getParamObjectList(int id, int paramId) getParamPhone(int id, int paramId) getParamText(int id, int paramId) getParamTree(int id, int paramId) getParamTreeWithTitles(int id, int paramId) getProcessFilledParamIds(int id) Получить список Id заполненных параметров процессаbooleanisParameterFilled(int id, Parameter param) Проверяет заполненость параметра для объекта с кодом id.loadParameters(List<Parameter> paramList, int id, boolean offEncription) Загрузка значений в список параметров.voidloadParameterValue(ParameterValuePair param, int objectId, boolean offEncription) voidobjectIdInvert(String objectType, int currentObjectId) static voidparamSelectQuery(String paramRef, String linkColumn, StringBuilder selectPart, StringBuilder joinPart, boolean addColumnValueAlias) Добавляет в запрос выборку параметра.booleanparamValueFilter(String expression, int objectId, Map valuesCache) Фильтр сущности по значению параметра, пока поддерживается только значение вида param::cityId in 1,2,3 param::value in 1,2,3voidsaveElement(int id, int paramId, int lineId) searchObjectByDateAndMonth(int paramId, @NotNull LocalDate date) searchObjectByDateParam(int paramId, @NotNull LocalDate date) searchObjectByFilledParams(List<Parameter> parameters) searchObjectByParameterAddress(int parameterId, ParameterAddressValue parameterAddressValue) Функция поиска объектов по значениям связанного адресного параметраsearchObjectByParameterPhone(int parameterId, ParameterPhoneValue parameterPhoneValue) Функция поиска объектов по значениям связанного телефонного параметраsearchObjectByParameterText(int parameterId, String parameterTextValue) voidupdateParamAddress(int id, int paramId, int position, ParameterAddressValue value) Обновляет/добавляет/удаляет значения адресного параметра.voidupdateParamBlob(int id, int paramId, String value) voidupdateParamBoolean(int id, int paramId, boolean value) voidupdateParamDate(int id, int paramId, Date value) voidupdateParamDateTime(int id, int paramId, Date value) voidupdateParamEmail(int id, int paramId, int position, ParameterEmailValue value) Обновляет/добавляет/удаляет значения параметра типа EMail.voidupdateParamFile(int id, int paramId, int position, int version, String comment, FileData fileData) voidupdateParamList(int id, int paramId, Map<Integer, String> values) voidupdateParamList(int id, int paramId, Set<Integer> values) voidupdateParamListAsBool(int objectId, int paramId, boolean value) Обновление листового параметра представенного как bool значение.voidupdateParamListCount(int id, int paramId, Map<Integer, Double> values, Map<Integer, String> valuesComments) voidupdateParamNumber(int id, int paramId, BigDecimal value) voidupdateParamPhone(int id, int paramId, ParameterPhoneValue value) voidupdateParamsAddressOnHouseUpdate(int houseId) voidupdateParamText(int id, int paramId, String value) voidupdateParamTree(int id, int paramId, Set<String> values) voidupdateParamValueMap(Map<Integer, ParameterValuePair> paramMap, String type, Collection<Integer> ids, int objectId, boolean offEncription) Загрузка значений параметров определённого типа.voidupdatePosition(List<Integer> lineIds) 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
-
history
protected boolean history -
PARAM_ADDRESS_FIELD_QUARTER
- See Also:
-
PARAM_ADDRESS_FIELD_STREET
- See Also:
-
PARAM_ADDRESS_FIELD_FLAT
- See Also:
-
PARAM_ADDRESS_FIELDS
-
-
Constructor Details
-
ParamValueDAO
-
ParamValueDAO
-
-
Method Details
-
getParamAddressFirst
-
getParamAddress
Возвращает адресный параметр объекта.- Parameters:
id- - код объекта.paramId- - код параметра.position- - позиция, начиная от 1, если в параметре установлены несколько значений.- Throws:
BGException
-
getParamAddress
public SortedMap<Integer,ParameterAddressValue> getParamAddress(int id, int paramId) throws BGException Возвращает значения адресного параметра объекта, ключ SortedMap - позиция, значение - значение на позиции.- Parameters:
id- - код объекта.paramId- - код параметра.- Throws:
BGException
-
getParamAddressExt
public SortedMap<Integer,ParameterAddressValue> getParamAddressExt(int id, int paramId, boolean loadDirs) throws BGException Возвращает значения адресного параметра объекта, ключ SortedMap - позиция, значение - значение на позиции.- Parameters:
id- - код объекта.paramId- - код параметра.loadDirs- - признак необходимости загрузить справочники, чтобы был корректно заполненParameterAddressValue.getHouse()/- Throws:
BGException
-
getParamAddressExt
public SortedMap<Integer,ParameterAddressValue> getParamAddressExt(int id, int paramId, boolean loadDirs, String formatName) throws BGException Возвращает значения адресного параметра объекта, ключ SortedMap - позиция, значение - значение на позиции.- Parameters:
id- - код объекта.paramId- - код параметра.loadDirs- - признак необходимости загрузить справочники, чтобы был корректно заполненParameterAddressValue.getHouse().formatName- - наименование формата адреса из конфигурации, с помощью которого форматировать значение адреса.- Throws:
BGException
-
getParamFileFirst
-
getParamFile
-
getParamFilesByPositions
public List<FileData> getParamFilesByPositions(int objectId, int paramId, String sqlPositions) throws BGException - Throws:
BGException
-
getParamFile
- Throws:
BGException
-
getParamFile
- Throws:
BGException
-
getParamDate
- Throws:
BGException
-
getParamDateTime
- Throws:
BGException
-
getParamText
- Throws:
BGException
-
getParamBlob
- Throws:
BGException
-
getParamBoolean
- Throws:
BGException
-
getParamNumber
- Throws:
BGException
-
getParamEmail
- Throws:
BGException
-
getParamEmail
- Throws:
BGException
-
getParamPhone
- Throws:
BGException
-
getParameterPhoneValueItems
@NotNull public @NotNull List<ParameterPhoneValueItem> getParameterPhoneValueItems(int id, int paramId) throws BGException - Throws:
BGException
-
getParamListWithTitles
- Throws:
BGException
-
getParamListWithTitlesAndComments
public List<IdTitleComment> getParamListWithTitlesAndComments(int id, int paramId) throws BGException - Throws:
BGException
-
getParamListCountWithTitles
- Throws:
BGException
-
getParamListCountWithTitlesAndCount
public List<ParameterListCountValue> getParamListCountWithTitlesAndCount(int objectId, int paramId) throws BGException - Throws:
BGException
-
getParamListCountWithTitlesAndValues
public List<ParameterListCountValue> getParamListCountWithTitlesAndValues(int id, int paramId) throws BGException - Throws:
BGException
-
getObjectIdAndParamIdByLineId
-
getParamObjectList
- Throws:
BGException
-
getParamListCount
@Deprecated public Map<Integer,ParameterListCountValue> getParamListCount(int id, int paramId) throws BGException Deprecated.- Throws:
BGException
-
getParamList
- Throws:
BGException
-
getParamListWithComments
- Throws:
BGException
-
getParamTree
- Throws:
BGException
-
updateParamText
- Throws:
BGException
-
updateParamBlob
- Throws:
BGException
-
updateParamBoolean
- Throws:
BGException
-
updateParamNumber
- Throws:
BGException
-
updateParamEmail
public void updateParamEmail(int id, int paramId, int position, ParameterEmailValue value) throws BGException Обновляет/добавляет/удаляет значения параметра типа EMail.- Parameters:
id- - код сущности в БД.paramId- - код параметра.position- - позиция значения, начинается с 1, 0 - добавить новое значение с позицией MAX+1.value- - значение, null - удаление параметра на указанной позиции, если position>0; иначе - удаление всех значений.- Throws:
BGException
-
addElement
- Throws:
BGException
-
updatePosition
- Throws:
BGException
-
saveElement
- Throws:
BGException
-
deleteElement
- Throws:
BGException
-
updateParamList
- Throws:
BGException
-
updateParamList
- Throws:
BGException
-
updateParamListCount
public void updateParamListCount(int id, int paramId, Map<Integer, Double> values, Map<Integer, throws BGExceptionString> valuesComments) - Throws:
BGException
-
updateParamFile
public void updateParamFile(int id, int paramId, int position, int version, String comment, FileData fileData) throws BGException - Throws:
BGException
-
updateParamAddress
public void updateParamAddress(int id, int paramId, int position, ParameterAddressValue value) throws BGException Обновляет/добавляет/удаляет значения адресного параметра.- Parameters:
id- - код сущности в БД.paramId- - код параметра.position- - позиция значения, начинается с 1, 0 - добавить новое значение с позицией MAX+1.value- - значение, null - удаление параметра на указанной позиции, если position>0; иначе - удаление всех значений.- Throws:
BGException
-
updateParamsAddressOnHouseUpdate
- Throws:
BGException
-
updateParamPhone
- Throws:
BGException
-
updateParamDate
- Throws:
BGException
-
updateParamDateTime
- Throws:
BGException
-
deleteParams
- Throws:
SQLException
-
objectIdInvert
- Throws:
SQLException
-
copyParams
- Throws:
BGException
-
copyParams
public void copyParams(int fromObjectId, int toObjectId, Collection<Integer> paramIds) throws BGException - Throws:
BGException
-
copyParam
- Throws:
BGException
-
copyParam
public void copyParam(int fromObjectId, int fromParamId, int toObjectId, int toParamId) throws BGException - Throws:
BGException
-
isParameterFilled
Проверяет заполненость параметра для объекта с кодом id.- Throws:
BGException
-
loadParameters
public List<ParameterValuePair> loadParameters(List<Parameter> paramList, int id, boolean offEncription) throws BGException Загрузка значений в список параметров.- Throws:
BGException
-
getProcessFilledParamIds
Получить список Id заполненных параметров процесса- Parameters:
id- - id процесса- Throws:
BGException
-
loadParameterValue
public void loadParameterValue(ParameterValuePair param, int objectId, boolean offEncription) throws BGException - Throws:
BGException
-
updateParamValueMap
public void updateParamValueMap(Map<Integer, ParameterValuePair> paramMap, String type, Collection<Integer> ids, int objectId, boolean offEncription) throws BGExceptionЗагрузка значений параметров определённого типа.- Throws:
BGException
-
paramSelectQuery
public static void paramSelectQuery(String paramRef, String linkColumn, StringBuilder selectPart, StringBuilder joinPart, boolean addColumnValueAlias) Добавляет в запрос выборку параметра.- Parameters:
addColumnValueAlias- - добавляет в запрос алиас колонки, например в запросе param_79.value AS param_79_value добавит строку " AS param_79_value"
-
getParameterAddressValueFromRs
- Throws:
BGException
-
getParameterAddressValueFromRs
public static ParameterAddressValue getParameterAddressValueFromRs(ResultSet rs, String prefix) throws BGException - Throws:
BGException
-
getParameterAddressValueFromRs
public static ParameterAddressValue getParameterAddressValueFromRs(ResultSet rs, String prefix, boolean loadDirs, String formatName) throws BGException - Throws:
BGException
-
paramValueFilter
public boolean paramValueFilter(String expression, int objectId, Map valuesCache) throws BGException Фильтр сущности по значению параметра, пока поддерживается только значение вида param::cityId in 1,2,3 param::value in 1,2,3- Throws:
BGException
-
getParamJoinFilters
* Добавление INNER JOIN фильтров по параметрам, пока поддерживается только значение вида для списковых. param::value in 1,2,3- Throws:
BGException
-
updateParamTree
- Throws:
BGException
-
getParamTreeWithTitles
- Throws:
BGException
-
getParamListAsBool
Зачитывание листового параметра как bool значение. Считается что значения листового параметра имеют следующий вид: 1=Нет (false) 2=Да (true)- Throws:
BGException
-
updateParamListAsBool
Обновление листового параметра представенного как bool значение. Считается что значения листового параметра имеют следующий вид: 1=Нет (false) 2=Да (true)- Throws:
BGException
-
searchObjectByParameterPhone
public Set<Integer> searchObjectByParameterPhone(int parameterId, ParameterPhoneValue parameterPhoneValue) throws SQLException Функция поиска объектов по значениям связанного телефонного параметра- Parameters:
parameterId- - ID параметраparameterPhoneValue- - набор телефонов для поиска- Throws:
SQLException
-
searchObjectByParameterAddress
public Set<Integer> searchObjectByParameterAddress(int parameterId, ParameterAddressValue parameterAddressValue) throws SQLException Функция поиска объектов по значениям связанного адресного параметра- Parameters:
parameterId- - ID параметраparameterAddressValue- - значение адресного параметра- Throws:
SQLException
-
searchObjectByParameterText
public Set<Integer> searchObjectByParameterText(int parameterId, String parameterTextValue) throws BGException - Throws:
BGException
-
searchObjectByDateParam
@NotNull public @NotNull Set<Integer> searchObjectByDateParam(int paramId, @NotNull @NotNull LocalDate date) throws BGException - Throws:
BGException
-
searchObjectByDateAndMonth
@NotNull public @NotNull Map<Integer,LocalDate> searchObjectByDateAndMonth(int paramId, @NotNull @NotNull LocalDate date) throws BGException - Throws:
BGException
-
searchObjectByFilledParams
-
buildSearchByFilledParamsQuery
-