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.
|
|
|
package test;
|
|
|
|
|
|
|
|
import com.engine.matfron.entity.SurnameParam;
|
|
|
|
import com.engine.matfron.util.CommonDateUtil;
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
import java.time.YearMonth;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.regex.Matcher;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
/**
|
|
|
|
* @Author weaver_cl
|
|
|
|
* @Description:
|
|
|
|
* @Date 2022/10/9
|
|
|
|
* @Version V1.0
|
|
|
|
**/
|
|
|
|
public class MainTest {
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
|
|
List<SurnameParam> surnameList = new ArrayList<>();
|
|
|
|
surnameList.add(SurnameParam.builder().companyworkyear(1.72).count(8).build());
|
|
|
|
surnameList.add(SurnameParam.builder().companyworkyear(2.19).count(18).build());
|
|
|
|
surnameList.add(SurnameParam.builder().companyworkyear(3.12).count(9).build());
|
|
|
|
surnameList.add(SurnameParam.builder().companyworkyear(2.80).count(8).build());
|
|
|
|
surnameList.add(SurnameParam.builder().companyworkyear(5.72).count(6).build());
|
|
|
|
surnameList.add(SurnameParam.builder().companyworkyear(10.72).count(28).build());
|
|
|
|
Integer sum = surnameList.stream().filter(item -> item.getCompanyworkyear() > 10 && item.getCompanyworkyear() <= 100)
|
|
|
|
.mapToInt(SurnameParam::getCount).sum();
|
|
|
|
System.out.println(sum);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|