You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
Java
35 lines
1.2 KiB
Java
import com.engine.common.util.DateUtil;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Sets;
|
|
|
|
import java.time.LocalDate;
|
|
import java.time.temporal.ChronoUnit;
|
|
import java.util.*;
|
|
|
|
|
|
public class Test {
|
|
public static void main(String[] args) {
|
|
// String str = "where 1=1 and t1.formmodeid = 200 and t1.dgcx = '1'";
|
|
// String[] strs = str.split("and");
|
|
// for (String beanSqlWhere :strs){
|
|
// if (beanSqlWhere.indexOf("t1.dgcx") >=0){
|
|
// String[] conditions = beanSqlWhere.split("=");
|
|
// System.out.println(conditions[1].trim());
|
|
// if (conditions[1].trim().equals("'1'")){
|
|
// System.out.println(111);
|
|
// }
|
|
// }
|
|
// }
|
|
Set<String> personnelGroupIds = new HashSet<>();
|
|
System.out.println(DateUtil.getBetWeenDays("2023-09-22"));
|
|
}
|
|
|
|
public static int getDaysBetween(String date1, String date2) {
|
|
LocalDate startDate = LocalDate.parse(date1);
|
|
LocalDate endDate = LocalDate.parse(date2);
|
|
|
|
long daysBetween = ChronoUnit.DAYS.between(startDate, endDate);
|
|
return Math.toIntExact(daysBetween);
|
|
}
|
|
}
|