Skip to content

Commit

Permalink
Add sorting org for login
Browse files Browse the repository at this point in the history
  • Loading branch information
yamelsenih committed Nov 16, 2021
1 parent 94b32da commit fecb353
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/spin/base/util/SessionManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public static int getDefaultOrganizationId(int roleId, int userId) {
+ "OR (r.IsUseUserOrgAccess='N' AND EXISTS(SELECT 1 FROM AD_Role_OrgAccess ra WHERE ra.AD_Org_ID = o.AD_Org_ID AND ra.AD_Role_ID = r.AD_Role_ID AND ra.IsActive='Y')) "
+ "OR (r.IsUseUserOrgAccess='Y' AND EXISTS(SELECT 1 FROM AD_User_OrgAccess ua WHERE ua.AD_Org_ID = o.AD_Org_ID AND ua.AD_User_ID = ? AND ua.IsActive='Y'))"
+ ") "
+ "ORDER BY o.Name";
+ "ORDER BY o.AD_Org_ID DESC, o.Name";
return DB.getSQLValue(null, organizationSQL, roleId, userId);
}

Expand Down

0 comments on commit fecb353

Please sign in to comment.