Java Code Examples for org.springframework.data.jpa.domain.Specification

The following examples show how to use org.springframework.data.jpa.domain.Specification. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: genericdao   Source File: GenericJpaRepositoryImpl.java    License: Artistic License 2.0 6 votes vote down vote up
protected <S> Root<T> applySpecificationToCriteria(Specification<T> spec, CriteriaQuery<S> query) {

		Assert.notNull(query);
		Root<T> root = query.from(getDomainClass());

		if (spec == null) {
			return root;
		}

		CriteriaBuilder builder = entityManager.getCriteriaBuilder();
		Predicate predicate = spec.toPredicate(root, query, builder);

		if (predicate != null) {
			query.where(predicate);
		}

		return root;
	}
 
Example 2
/**
 * 按照条件查询全部登录日志
 * @return IPage<LoginLog>
 */
public Page<LoginLog> findLoginLogByCondition(LoginLog loginLog, Pageable pageable) {
    Specification<LoginLog> condition = (root, query, builder) -> {
        List<Predicate> predicates = new ArrayList<>();
        if (StringUtils.isNotEmpty(loginLog.getClientIp())) {
            predicates.add(builder.like(root.get("clientIp"), "%" + loginLog.getClientIp()));
        }
        return query.where(predicates.toArray(new Predicate[0])).getRestriction();
    };
    Page<LoginLog> queryResults = loginLogDao.findAll(condition, pageable);
 List<User> userList = userServiceRpc.findUser().getData().getResults();
 queryResults.getContent().forEach(
   userLogList -> userList.forEach(
	    user -> {
		    if (user.getId().equals(userLogList.getUserId())) {
			    userLogList.setUserName(user.getUserName());
		    }
	    }
   )
 );
    return queryResults;

}
 
Example 3
Source Project: JavaQuarkBBS   Source File: ReplyServiceImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Page<Reply> getReplyByPage(Integer postsId, int pageNo, int length) {
    Sort.Order order = new Sort.Order(Sort.Direction.ASC, "id");
    Sort sort = new Sort(order);
    PageRequest pageable = new PageRequest(pageNo, length, sort);

    Specification<Reply> specification = new Specification<Reply>() {

        @Override
        public Predicate toPredicate(Root<Reply> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {
            Path<Integer> $posts = root.get("posts");
            Predicate predicate = criteriaBuilder.and(criteriaBuilder.equal($posts, postsId));
            return predicate;
        }
    };
    Page<Reply> page = repository.findAll(specification, pageable);
    return page;
}
 
Example 4
@Test
public void resolvesJoinContainerWithJoinFetch() throws Exception {
	MethodParameter param = MethodParameter.forExecutable(testMethod("testMethod_joinContainerWithJoinFetch"), 0);
    NativeWebRequest req = mock(NativeWebRequest.class);
    QueryContext queryCtx = new WebRequestQueryContext(req);
    when(req.getParameterValues("path1")).thenReturn(new String[] { "value1" });

    Specification<?> resolved = (Specification<?>) resolver.resolveArgument(param, null, req, null);

    assertThat(innerSpecs(resolved))
        .hasSize(2)
        .contains(new Like<Object>(queryCtx, "path1", new String[] { "value1" }))
        .contains(new Conjunction<Object>(
        		new net.kaczmarzyk.spring.data.jpa.domain.JoinFetch<Object>(new String[] { "fetch1" }, JoinType.LEFT),
        		new net.kaczmarzyk.spring.data.jpa.domain.JoinFetch<Object>(new String[] { "fetch2" }, JoinType.INNER)));
}
 
Example 5
Source Project: Groza   Source File: JpaBaseEventDao.java    License: Apache License 2.0 6 votes vote down vote up
private Specification<EventEntity> getEntityFieldsSpec(UUID tenantId, EntityId entityId, String eventType) {
    return (root, criteriaQuery, criteriaBuilder) -> {
        List<Predicate> predicates = new ArrayList<>();
        if (tenantId != null) {
            Predicate tenantIdPredicate = criteriaBuilder.equal(root.get("tenantId"), UUIDConverter.fromTimeUUID(tenantId));
            predicates.add(tenantIdPredicate);
        }
        if (entityId != null) {
            Predicate entityTypePredicate = criteriaBuilder.equal(root.get("entityType"), entityId.getEntityType());
            predicates.add(entityTypePredicate);
            Predicate entityIdPredicate = criteriaBuilder.equal(root.get("entityId"), UUIDConverter.fromTimeUUID(entityId.getId()));
            predicates.add(entityIdPredicate);
        }
        if (eventType != null) {
            Predicate eventTypePredicate = criteriaBuilder.equal(root.get("eventType"), eventType);
            predicates.add(eventTypePredicate);
        }
        return criteriaBuilder.and(predicates.toArray(new Predicate[]{}));
    };
}
 
Example 6
Source Project: JuniperBot   Source File: AuditDao.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Transactional
public List<AuditActionDto> getActions(long guildId, AuditActionRequest request) {
    Specification<AuditAction> spec = rootAuditSpec(guildId);
    if (request != null) {
        if (request.getActionType() != null) {
            spec = spec.and(withActionType(request.getActionType()));
        }
        if (request.getUserId() != null) {
            spec = spec.and(withUserId(request.getUserId()));
        }
        if (request.getChannelId() != null) {
            spec = spec.and(withChannelId(request.getChannelId()));
        }
        if (request.getOlderThan() != null) {
            spec = spec.and(withOlderThan(request.getOlderThan()));
        }
        if (request.getStartDate() != null) {
            spec = spec.and(withStartDate(request.getStartDate()));
        }
        if (request.getEndDate() != null) {
            spec = spec.and(withEndDate(request.getEndDate()));
        }
    }
    List<AuditAction> actions = actionRepository.findAll(spec, PageRequest.of(0, 50)).getContent();
    return apiMapper.getAuditActionDtos(actions);
}
 
Example 7
Source Project: jpa-spec   Source File: GreatEqualTest.java    License: MIT License 6 votes vote down vote up
@Test
public void should_be_able_to_find_by_using_great_equal() {
    // given
    Person jack = new PersonBuilder()
            .name("Jack")
            .age(20)
            .build();
    Person eric = new PersonBuilder()
            .name("Eric")
            .age(18)
            .build();
    personRepository.save(jack);
    personRepository.save(eric);

    // when
    Specification<Person> specification = Specifications.<Person>and()
            .ge("age", 20)
            .build();

    List<Person> persons = personRepository.findAll(specification);

    // then
    assertThat(persons.size()).isEqualTo(1);
}
 
Example 8
@Test // TC-1. interface with @Conjunction spec
public void createsSpecFromSimpleAnnotatedInterface() throws Exception {
	MethodParameter param = methodParameter("annotatedInterface", GenderOrLastNameAndRegistrationDateFilter.class);

	NativeWebRequest req = nativeWebRequest()
			.withParameterValues("gender", "MALE")
			.withParameterValues("lastName", "Simpson")
			.withParameterValues("registrationDate", "2014-03-20").build();

	WebRequestProcessingContext ctx = new WebRequestProcessingContext(param, req);

	Specification<?> resolved = (Specification<?>) specificationArgumentResolver.resolveArgument(param, null, req, null);

	assertThat(resolved)
			.isInstanceOf(GenderOrLastNameAndRegistrationDateFilter.class);

	assertThat(innerSpecs(resolved))
			.hasSize(2)
			.containsExactlyInAnyOrder(
					new Disjunction<>(
							new EmptyResultOnTypeMismatch<>(equal(ctx, "gender", "MALE")),
							new EmptyResultOnTypeMismatch<>(equal(ctx, "lastName", "Simpson"))
					),
					new EmptyResultOnTypeMismatch<>(in(ctx, "registrationDate", "2014-03-20"))
			);
}
 
Example 9
Source Project: code   Source File: SpecTest.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 分页查询
 */
@Test
public void testPage() {
    Specification<Customer> specification = new Specification<Customer>() {
        @Override
        public Predicate toPredicate(Root<Customer> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
            return cb.like(root.get("custName").as(String.class), "阿里巴%");
        }
    };
    /*
     * 构造分页参数
     * 		Pageable : 接口
     * 			PageRequest实现了Pageable接口,调用构造方法的形式构造
     * 				第一个参数:页码(从0开始)
     * 				第二个参数:每页查询条数
     * Pageable pageable = new PageRequest(0, 5);
     */
    Pageable pageable = PageRequest.of(0, 5);
    
    Page<Customer> page = customerDao.findAll(specification, pageable);

    System.out.println("总记录数"+page.getTotalElements());
    System.out.println("总页数"+page.getTotalPages());
    page.getContent().forEach(System.out::println);

}
 
Example 10
@Test
public void resolvesJoinContainerWithRegularJoin() throws Exception {
	MethodParameter param = MethodParameter.forExecutable(testMethod("testMethod_joinContainerWithRegularJoin"), 0);
	FakeWebRequest req = new FakeWebRequest();
    QueryContext queryCtx = new WebRequestQueryContext(req);
    req.setParameterValues("path1", "value1");

    Specification<?> resolved = (Specification<?>) resolver.resolveArgument(param, null, req, null);

    assertThat(innerSpecs(resolved))
        .hasSize(2)
        .contains(new Like<Object>(queryCtx, "path1", new String[] { "value1" }))
        .contains(new Conjunction<Object>(
        		new net.kaczmarzyk.spring.data.jpa.domain.Join<Object>(queryCtx, "join1", "alias1", JoinType.INNER, true),
        		new net.kaczmarzyk.spring.data.jpa.domain.Join<Object>(queryCtx, "join2", "alias2", JoinType.LEFT, false)));
}
 
Example 11
Source Project: danyuan-application   Source File: SysComnLogsService.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 方法名: findAllLongtime
 * 功 能: TODO(这里用一句话描述这个方法的作用)
 * 参 数: @param vo
 * 参 数: @return
 * 返 回: Page<SysComnLogs>
 * 作 者 : Administrator
 * @throws
 */
public Page<SysComnLogs> findAllLongtime(SysComnLogsVo vo) {
	Sort sort = Sort.by(new Order(Direction.DESC, "createTime"));
	PageRequest request = PageRequest.of(vo.getPageNumber() - 1, vo.getPageSize(), sort);
	Page<SysComnLogs> sourceCodes = sysComnLoggersDao.findAll(new Specification<SysComnLogs>() {
		/**
		 * @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
		 */
		private static final long serialVersionUID = 1L;
		
		@Override
		public Predicate toPredicate(Root<SysComnLogs> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
			List<Predicate> list = new ArrayList<>();
			list.add(cb.gt((root.get("requestLong").as(Long.class)), 1000));
			// list.add(cb.equal((root.get("url").as(String.class)), "/zhcx/findAllTableRow"));
			// list.add(cb.equal((root.get("classMethod").as(String.class)), "findAllTableRow"));
			return cb.and(list.toArray(new Predicate[list.size()]));
		}
	}, request);
	return sourceCodes;
}
 
Example 12
public Specification<Object> buildSpecification(WebRequestProcessingContext context, Disjunction def) {
	List<Specification<Object>> innerSpecs = new ArrayList<Specification<Object>>();
	for (And innerAndDef : def.value()) {
		Specification<Object> innerAnd = andResolver.buildSpecification(context, innerAndDef);
		if (innerAnd != null) {
			innerSpecs.add(innerAnd);
		}
	}
	for (Spec innerDef : def.or()) {
		Specification<Object> innerSpec = specResolver.buildSpecification(context, innerDef);
		if (innerSpec != null) {
			innerSpecs.add(innerSpec);
		}
	}

	return innerSpecs.isEmpty() ? null : new net.kaczmarzyk.spring.data.jpa.domain.Disjunction<>(innerSpecs);
}
 
Example 13
Source Project: es   Source File: SimpleBaseRepository.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Applies the given {@link org.springframework.data.jpa.domain.Specification} to the given {@link javax.persistence.criteria.CriteriaQuery}.
 *
 * @param spec  can be {@literal null}.
 * @param query must not be {@literal null}.
 * @return
 */
private <S> Root<M> applySpecificationToCriteria(Specification<M> spec, CriteriaQuery<S> query) {

    Assert.notNull(query);
    Root<M> root = query.from(entityClass);

    if (spec == null) {
        return root;
    }

    CriteriaBuilder builder = em.getCriteriaBuilder();
    Predicate predicate = spec.toPredicate(root, query, builder);

    if (predicate != null) {
        query.where(predicate);
    }

    return root;
}
 
Example 14
@Test
public void returnsNullIfTheWebParameterIsMissing_defaultParameterName() throws Exception {
    MethodParameter param = MethodParameter.forExecutable(testMethod("testMethod1"), 0);
    NativeWebRequest req = mock(NativeWebRequest.class);

 WebRequestProcessingContext ctx = new WebRequestProcessingContext(param, req);

 Specification<?> resolved = resolver.buildSpecification(ctx, param.getParameterAnnotation(Spec.class));

    assertThat(resolved).isNull();
}
 
Example 15
/**
 * {@link Specification} for retrieving {@link DistributionSet}s by tag.
 *
 * @param tagId
 *            the ID of the distribution set which must be assigned
 * @return the {@link DistributionSet} {@link Specification}
 */
public static Specification<JpaDistributionSet> hasTag(final Long tagId) {

    return (targetRoot, query, cb) -> {
        final SetJoin<JpaDistributionSet, JpaDistributionSetTag> tags = targetRoot.join(JpaDistributionSet_.tags,
                JoinType.LEFT);
        return cb.equal(tags.get(JpaDistributionSetTag_.id), tagId);
    };
}
 
Example 16
@Test
public void resolvesJoinFetchEvenIfOtherSpecificationIsNotPresent() throws Exception {
    MethodParameter param = MethodParameter.forExecutable(testMethod("testMethod"), 0);
    NativeWebRequest req = mock(NativeWebRequest.class);

    Specification<?> resolved = (Specification<?>) resolver.resolveArgument(param, null, req, null);

    assertThat(resolved)
        .isEqualTo(new net.kaczmarzyk.spring.data.jpa.domain.JoinFetch<Object>(new String[] { "fetch1", "fetch2" }, JoinType.LEFT));
}
 
Example 17
/**
    * 条件查询资源
    *
    * @param resource 资源实体
    * @param queryVO  查询参数
    * @return List
    */
public List<Resource> findResourceByCondition(Resource resource, QueryVO queryVO) {

	Specification<Resource> condition = (root, query, builder) -> {
		List<Predicate> predicates = new ArrayList<>();
		if (StringUtils.isNotEmpty(resource.getName())) {
			predicates.add(builder.like(root.get("name"), "%" + resource.getName() + "%"));
		}
		Predicate[] ps = new Predicate[predicates.size()];
		return query.where(builder.and(predicates.toArray(ps))).getRestriction();
	};
	return resourceDao.findAll(condition);
}
 
Example 18
Source Project: strategy-spring-security-acl   Source File: AclJpaQuery.java    License: Apache License 2.0 5 votes vote down vote up
private void installAclSpec(Specification<Object> aclJpaSpec) {
  // force rerender by resetting alias
  root.alias(null);

  // build acl predicate
  Predicate aclPredicate =
        aclJpaSpec.toPredicate(root, cachedCriteriaQuery, em.getCriteriaBuilder());

  // install acl predicate
  aclPredicateTargetSource.installAcl(aclPredicate);

  logger.debug("ACL Jpa Specification installed for method '{}' and query {}: {}", method,
        query, aclJpaSpec);
}
 
Example 19
Source Project: Qualitis   Source File: TaskDataSourceDaoImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public List<TaskDataSource> findByUserAndDataSource(String username, String clusterName, String databaseName, String tableName, Integer page, Integer size) {
    Sort sort = new Sort(Sort.Direction.DESC, "id");
    Pageable pageable = PageRequest.of(page, size, sort);

    Specification<TaskDataSource> specification = getUserAndDataSourceSpecification(username, clusterName, databaseName, tableName);
    return taskDataSourceRepository.findAll(specification, pageable).getContent();
}
 
Example 20
Source Project: TeamDojo   Source File: BadgeQueryService.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Return a {@link List} of {@link BadgeDTO} which matches the criteria from the database
 *
 * @param criteria The object which holds all the filters, which the entities should match.
 * @return the matching entities.
 */
@Transactional(readOnly = true)
public List<BadgeDTO> findByCriteria(BadgeCriteria criteria) {
    log.debug("find by criteria : {}", criteria);
    final Specification<Badge> specification = createSpecification(criteria);
    return badgeMapper.toDto(badgeRepository.findAll(specification));
}
 
Example 21
Source Project: MultimediaDesktop   Source File: CreditServiceImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public PageDto<CreditDto> findBy(final String userId, final Date start,
		final Date end, PageSize pageSize) {
	if (pageSize == null) {
		pageSize = new PageSize();
	}

	return creditConvert
			.covertToDto(creditRepository.findAll(
					new Specification<Credit>() {

						@Override
						public Predicate toPredicate(Root<Credit> root,
								CriteriaQuery<?> query, CriteriaBuilder cb) {
							List<Predicate> pres = new ArrayList<>(3);

							if (start != null) {
								pres.add(cb.greaterThanOrEqualTo(
										root.get("changeTime").as(
												Date.class), start));
							}

							if (end != null) {
								pres.add(cb.lessThanOrEqualTo(
										root.get("changeTime").as(
												Date.class), end));
							}

							if (!StringUtils.isBlank(userId)) {
								pres.add(cb.equal(
										root.get("user").as(User.class),
										new User(userId)));
							}
							Predicate[] p = new Predicate[pres.size()];
							return cb.and(pres.toArray(p));
						}
					},
					new PageRequest(pageSize.getPage() - 1, pageSize
							.getLimit())));
}
 
Example 22
Source Project: Spring-5.0-Projects   Source File: CountryQueryService.java    License: MIT License 5 votes vote down vote up
/**
 * Return the number of matching entities in the database
 * @param criteria The object which holds all the filters, which the entities should match.
 * @return the number of matching entities.
 */
@Transactional(readOnly = true)
public long countByCriteria(CountryCriteria criteria) {
    log.debug("count by criteria : {}", criteria);
    final Specification<Country> specification = createSpecification(criteria);
    return countryRepository.count(specification);
}
 
Example 23
Source Project: hawkbit   Source File: TargetSpecifications.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@link Specification} for retrieving {@link Target}s that are not in the
 * given {@link RolloutGroup}s
 *
 * @param groups
 *            the {@link RolloutGroup}s
 * @return the {@link Target} {@link Specification}
 */
public static Specification<JpaTarget> isNotInRolloutGroups(final Collection<Long> groups) {
    return (targetRoot, query, cb) -> {
        final ListJoin<JpaTarget, RolloutTargetGroup> rolloutTargetJoin = targetRoot
                .join(JpaTarget_.rolloutTargetGroup, JoinType.LEFT);
        final Predicate inRolloutGroups = rolloutTargetJoin.get(RolloutTargetGroup_.rolloutGroup)
                .get(JpaRolloutGroup_.id).in(groups);
        rolloutTargetJoin.on(inRolloutGroups);
        return cb.isNull(rolloutTargetJoin.get(RolloutTargetGroup_.target));
    };
}
 
Example 24
@RequestMapping(value = "/customers", params = "birthDateBefore")
@ResponseBody
public Object findCustomersBornBefore_defaultDateFormat(
        @Spec(path="birthDate", params="birthDateBefore", spec= LessThan.class) Specification<Customer> spec) {

    return customerRepo.findAll(spec);
}
 
Example 25
Source Project: es   Source File: SimpleBaseRepository.java    License: Apache License 2.0 5 votes vote down vote up
public List<M> findAll(Iterable<ID> ids) {

        return getQuery(new Specification<M>() {
            public Predicate toPredicate(Root<M> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
                Path<?> path = root.get(entityInformation.getIdAttribute());
                return path.in(cb.parameter(Iterable.class, "ids"));
            }
        }, (Sort) null).setParameter("ids", ids).getResultList();
    }
 
Example 26
Source Project: tutorials   Source File: RsqlIntegrationTest.java    License: MIT License 5 votes vote down vote up
@Test
public void givenListOfFirstName_whenGettingListOfUsers_thenCorrect() {
    final Node rootNode = new RSQLParser().parse("firstName=in=(john,jack)");
    final Specification<User> spec = rootNode.accept(new CustomRsqlVisitor<User>());
    final List<User> results = repository.findAll(spec);

    assertThat(userJohn, isIn(results));
    assertThat(userTom, not(isIn(results)));
}
 
Example 27
Source Project: TeamDojo   Source File: TeamSkillQueryService.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Return a {@link List} of {@link TeamSkillDTO} which matches the criteria from the database
 *
 * @param criteria The object which holds all the filters, which the entities should match.
 * @return the matching entities.
 */
@Transactional(readOnly = true)
public List<TeamSkillDTO> findByCriteria(TeamSkillCriteria criteria) {
    log.debug("find by criteria : {}", criteria);
    final Specification<TeamSkill> specification = createSpecification(criteria);
    return teamSkillMapper.toDto(teamSkillRepository.findAll(specification));
}
 
Example 28
@Override
public Page<TargetFilterQuery> findByRsql(final Pageable pageable, final String rsqlFilter) {
    List<Specification<JpaTargetFilterQuery>> specList = Collections.emptyList();
    if (!StringUtils.isEmpty(rsqlFilter)) {
        specList = Collections.singletonList(
                RSQLUtility.parse(rsqlFilter, TargetFilterQueryFields.class, virtualPropertyReplacer, database));
    }
    return convertPage(findTargetFilterQueryByCriteriaAPI(pageable, specList), pageable);
}
 
Example 29
Source Project: hawkbit   Source File: NoCountPagingRepository.java    License: Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Page<T> readPage(final TypedQuery<T> query, final Pageable pageable, final Specification<T> spec) {
    query.setFirstResult((int) pageable.getOffset());
    query.setMaxResults(pageable.getPageSize());

    final List<T> content = query.getResultList();

    return new PageImpl<>(content, pageable, content.size());
}
 
Example 30
Source Project: youkefu   Source File: QcTask.java    License: Apache License 2.0 5 votes vote down vote up
@Scheduled(fixedDelay= 3000 , initialDelay = 20000) 
   public void checkVoiceTrans() {
	if(UKDataContext.model.get("qc") != null) {
		Page<StatusEvent> transList = null ;
		{
			transList = statusEventRes.findAll(new Specification<StatusEvent>(){
				@Override
				public Predicate toPredicate(Root<StatusEvent> root, CriteriaQuery<?> query,
						CriteriaBuilder cb) {
					List<Predicate> list = new ArrayList<Predicate>();  
					list.add(cb.equal(root.get("transtatus").as(String.class),UKDataContext.TransStatus.INTRANS.toString())) ;
					Predicate[] p = new Predicate[list.size()];  
					
					return cb.and(list.toArray(p));
				}}, new PageRequest(0, 100, Sort.Direction.ASC, "transbegin")) ; 
			if(transList.getContent().size()>0) {
				List<StatusEvent> needUpdateList = new ArrayList<StatusEvent>();
				for(StatusEvent statusEvent : transList.getContent()) {
					QualityConfig qConfig = UKTools.initQualityConfig(statusEvent.getOrgi()) ;
					if(qConfig!=null && qConfig.isPhonetic() && !StringUtils.isBlank(qConfig.getEngine())) {
						PhoneticTranscription trans = (PhoneticTranscription) UKDataContext.getContext().getBean(qConfig.getEngine()) ;
						if(trans!=null) {
							if(!StringUtils.isBlank(statusEvent.getTranid())) {//根据转写引擎返回的任务ID去查询,实时转写状态
								boolean needUpdata = trans.getStatus(statusEvent, qConfig) ;
								if(needUpdata) {
									needUpdateList.add(statusEvent)  ;
								}
							}
						}
					}
				}
				if(needUpdateList.size() > 0) {
					statusEventRes.save(needUpdateList) ;
				}
			}
		} ;
	}
}