Spring jpa添加查询条件
if ( StringUtils.isNotEmpty(companyId)){
current = criteriaBuilder.equal(root.get("companyId"),companyId);
result = criteriaBuilder.and(result,current);}
if (StringUtils.isNotEmpty(name)){
current = criteriaBuilder.like(root.get("name"),"%" + name + "%");
result = criteriaBuilder.and(result,current);}