Last active
April 9, 2019 15:30
-
-
Save gaalha/98ed143cbac34d21d00e157b2da824a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Changing user status to inactive. | |
List<String> ldapUsernames = lstLdap.stream() | |
.map(ItemUserLDAP::getUsername) | |
.collect(Collectors.toList()); | |
List<User> inactiveUsers = User.find. | |
where() | |
.not(Expr.in("username", ldapUsernames)) | |
.not(Expr.eq("username", MAIN_USR)) | |
.eq("status_ldap", Parameters.ACTIVE) | |
.findList(); | |
// SORTING | |
find.where().orderBy("fieldname desc").findList(); | |
// Obtener una lista de resultados que esten entre dos números | |
lstDuplicate = find.where() | |
.isNull("deleted_at") | |
.or(Expr.between("lower_limit ", "upper_limit", original.getLowerLimit()), | |
Expr.between("lower_limit ", "upper_limit", original.getUpperLimit())) | |
.eq("periodicity_id", periodicity) | |
.findList(); | |
/** | |
* OBTENET UNA LISTA DE REGISTROS QUE ESTEN ENTRE DOS FECHAS | |
* @param paysheetId paysheet unique id | |
* @param employeeId employee unique id | |
* @param startDate start of date range | |
* @param finishDate finish of date range | |
* @return total as Double | |
*/ | |
public static List<VwRecalculatedRent> getTotalPreRentSalary(Integer paysheetId, Integer employeeId, Date startDate, Date finishDate) { | |
return find.where() | |
.eq(PAYSHEET_ID, paysheetId) | |
.eq(EMPLOYEE_ID, employeeId) | |
.between(PAYSHEET_DATE, new java.sql.Date(startDate.getTime()), new java.sql.Date(finishDate.getTime())) | |
.findList(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment