Package ru.bgcrm.dao.user
Class UserDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.user.UserDAO
- Direct Known Subclasses:
UserPermsetDAO
-
Nested Class Summary
Nested classes/interfaces inherited from class ru.bgcrm.dao.CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id>
-
Field Summary
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_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 TypeMethodDescriptionvoid
addUserGroup
(int userId, UserGroup group) void
closeUserGroupPeriod
(int userId, int groupId, Date date, Date dateFrom, Date dateTo) void
deleteUser
(int id) getAllPermissions
(String tableName, String selectColumn) protected String
getPageLimit
(Page page) Generates pageLIMIT offset, rows
query.getPermissions
(int userId) getUser
(int id) Retrieves user by ID.getUserByLogin
(String name) getUserGroupIds
(int userId) getUserGroupList
(int userId, Date date) Complete user list with passwords.getUserList
(Set<Integer> groupIds) getUserList
(Set<Integer> groupIds, String userTitleMask) getUserList
(Set<Integer> groupIds, String userTitleMask, boolean loadPassword) getUserList
(Set<Integer> groupFilter, Date dateGroupFrom, Date dateGroupTo) getUserPermsetIds
(int userId) getUserQueueIds
(int userId) void
removeUserGroup
(int userId, int groupId, Date dateFrom, Date dateTo) void
searchUser
(Pageable<User> searchResult, String filterLike, Set<Integer> groupFilter, Set<Integer> groupSelectFilter, Date date, Set<Integer> permsetFilter, int statusFilter) void
searchUserListByEmail
(Pageable<ParameterSearchedObject<User>> searchResult, List<Integer> emailParamIdList, String email) Выбирает пользователей по параметру типа E-Mail.void
updatePermissions
(Set<String> action, Set<String> config, int userId) protected void
void
updatePersonalization
(String mapDataBefore, User user) Updates user personalization map in DB if it changes frommapDataBefore
.void
updatePersonalization
(User user, ConfigMap newMap) void
updateUser
(int userId, String title, String login, String pswd, String description) void
updateUser
(User user) void
updateUserGroups
(User user) Sets user groups to values fromUser.getGroupIds()
, opened from current date.Methods inherited from class ru.bgcrm.dao.CommonDAO
deleteById, foundRows, getById, getGroupedIds, getGroupedIds, getIds, getIds, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, update, updateColumn, updateIds, updateIds, updateOrInsert
-
Constructor Details
-
UserDAO
-
-
Method Details
-
searchUser
public void searchUser(Pageable<User> searchResult, String filterLike, Set<Integer> groupFilter, Set<Integer> groupSelectFilter, Date date, Set<Integer> permsetFilter, int statusFilter) throws SQLException - Throws:
SQLException
-
searchUserListByEmail
public void searchUserListByEmail(Pageable<ParameterSearchedObject<User>> searchResult, List<Integer> emailParamIdList, String email) Выбирает пользователей по параметру типа E-Mail.- Parameters:
searchResult
-emailParamIdList
-email
- E-Mail, поиск идёт по точному совпадению и совпадению домена- Throws:
SQLException
-
getUserList
Complete user list with passwords.- Returns:
- Throws:
SQLException
-
getUserList
- Throws:
SQLException
-
getUserList
- Throws:
SQLException
-
getUserList
public List<User> getUserList(Set<Integer> groupIds, String userTitleMask, boolean loadPassword) throws SQLException - Throws:
SQLException
-
getUserList
public List<User> getUserList(Set<Integer> groupFilter, Date dateGroupFrom, Date dateGroupTo) throws SQLException - Throws:
SQLException
-
getAllUserGroups
- Throws:
SQLException
-
getUserGroupIds
- Throws:
SQLException
-
getAllUserGroupIds
- Throws:
SQLException
-
getUserPermsetIds
- Throws:
SQLException
-
getAllUserPermsetIds
- Throws:
SQLException
-
getUserQueueIds
- Throws:
SQLException
-
getAllUserQueueIds
- Throws:
SQLException
-
updateUser
public void updateUser(int userId, String title, String login, String pswd, String description) throws SQLException - Throws:
SQLException
-
updateUser
- Throws:
SQLException
-
getUserByLogin
-
getUser
Retrieves user by ID.- Parameters:
id
- unique ID.- Returns:
- found user or
null
. - Throws:
SQLException
-
deleteUser
- Throws:
SQLException
-
getPageLimit
Description copied from class:CommonDAO
Generates pageLIMIT offset, rows
query.- Overrides:
getPageLimit
in classCommonDAO
- Parameters:
page
- page instance.- Returns:
-
getAllPermissions
public Map<Integer,Map<String, getAllPermissionsConfigMap>> (String tableName, String selectColumn) throws SQLException - Throws:
SQLException
-
getAllUserPerm
- Throws:
SQLException
-
updatePermissions
public void updatePermissions(Set<String> action, Set<String> config, int userId) throws SQLException - Throws:
SQLException
-
updatePermissions
protected void updatePermissions(Set<String> action, Set<String> config, String table, String column, int id) throws SQLException - Throws:
SQLException
-
getPermissions
-
updatePersonalization
Updates user personalization map in DB if it changes frommapDataBefore
.- Parameters:
mapDataBefore
- the current state of the map,null
when no comparing is needed.user
- the user with personalization to be updated.- Throws:
SQLException
-
updatePersonalization
- Throws:
SQLException
-
addUserGroup
- Throws:
SQLException
-
removeUserGroup
public void removeUserGroup(int userId, int groupId, Date dateFrom, Date dateTo) throws SQLException - Throws:
SQLException
-
getUserGroupList
-
updateUserGroups
Sets user groups to values fromUser.getGroupIds()
, opened from current date. All the existing groups are replaced.- Parameters:
user
-- Throws:
SQLException
-
closeUserGroupPeriod
public void closeUserGroupPeriod(int userId, int groupId, Date date, Date dateFrom, Date dateTo) throws SQLException - Throws:
SQLException
-