Skip to content

Commit

Permalink
chore: Reformat code and update user repository
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGT96 committed Nov 5, 2024
1 parent 7894952 commit 12ca092
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/isf/menu/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,15 @@ public LocalDateTime getLastLogin() {
public void setLastLogin(LocalDateTime lastLogin) {
this.lastLogin = lastLogin;
}

public boolean isDeleted() {
return deleted;
}

public void setDeleted(boolean deleted) {
this.deleted = deleted;
}

@Override
public String toString() {
return getUserName();
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/isf/menu/model/UserGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ public String getCode() {
public void setCode(String code) {
this.code = code;
}

public boolean isDeleted() {
return deleted;
}

public void setDeleted(boolean deleted) {
this.deleted = deleted;
}

public String getDesc() {
return desc;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ int updateUser(@Param("description") String description, @Param("groupName") Use
@Query(value = "update User set lastLogin=:lastLoggedIn where userName=:id")
void setLastLogin(@Param("lastLoggedIn") LocalDateTime lockTime, @Param("id") String id);

@Query("select count(u) from User u where active=1 and deleted!=true")
@Query("select count(u) from User u where active=1 and deleted=false")
long countAllActiveUsers();

@Query("select count(u) from User u where active=1 and deleted=:deleted")
long countAllActiveUsersByDeleted(@Param("deleted") boolean deleted);

@Query("select count(g) from UserGroup g where active=1 and deleted!=true")
@Query("select count(g) from UserGroup g where active=1 and deleted=false")
long countAllActiveGroups();

@Query("select count(g) from UserGroup g where active=1 and deleted=:deleted")
Expand Down

0 comments on commit 12ca092

Please sign in to comment.