随笔分类 - java
摘要:1.集合中获取指定的一个属性值 List<String> items = li.stream().map(ScdCostChargeItemEntity::getItem).collect(Collectors.toList()); 2.集合分组 Map<String, List<T>> yearD
阅读全文
摘要:public class MenuTree1 { /** * 构建结束的树 */ private static List<Menu> menuList ; /** * 构建树 * @param menuId 树的根节点id 0:代表顶级节点 * @param nodeList 要构建的数据 * @r
阅读全文
摘要:方式一: List<String> listTemp = new ArrayList<String>(); for(int i=0;i<list.size();i++){ if(!listTemp.contains(list.get(i))){ listTemp.add(list.get(i));
阅读全文
摘要:@Test public void test10(){ //根据device_code去重,取出重复值 List<Employee> emps =new ArrayList<>(); List<String> dupList = emps.stream().collect(Collectors.gr
阅读全文
摘要:@Test public void test12(){ // 需要过滤的集合 List<Employee> first = Arrays.asList( new Employee(102, "李四", 79, 6666.66, Status.BUSY), new Employee(101, "张三"
阅读全文
摘要:Mapper @Mapper public interface EmpMapper { /** * 查询所有的职工信息 */ List<Emp> getAllEmp(); /** * 查询职工及职工所对应的部门信息 */ Emp getEmpAndDept(@Param("eid") Integer
阅读全文
摘要:(一) mybatis-plus自带map下划线转驼峰配置类 我们只需要在yml中配置一下object-wrapper-factory指定MybatisMapWrapperFactory就可以了 mybatis-plus: mapper-locations: classpath:mapper/*Ma
阅读全文

浙公网安备 33010602011771号