Commit c678d93e by huangjinxin

fix:组织结构过滤查询

1 parent a569e4f2
......@@ -518,13 +518,11 @@ public class DispatchServiceImpl implements DispatchService {
if (ListUtils.isNotEmpty(reqDTO.getGroupCategory())) {
Subquery<OrderInfoEntity> skillGroupCategorySubquery = criteriaQuery.subquery(OrderInfoEntity.class);
Root<SkillInfoEntity> skillInfoRoot = skillGroupCategorySubquery.from(SkillInfoEntity.class);
Root<OrgGroupEntity> orgGroupEntityRoot = skillGroupCategorySubquery.from(OrgGroupEntity.class);
skillGroupCategorySubquery.select(root) // 注意这里的 select 使用主查询的 root
.where(
criteriaBuilder.equal(skillInfoRoot.get("brand"), root.get("brand")),
criteriaBuilder.equal(skillInfoRoot.get("type"), root.get("type")),
criteriaBuilder.equal(skillInfoRoot.get("skill"), root.get("skill")),
skillInfoRoot.get("groupCategory").in(reqDTO.getGroupCategory())
criteriaBuilder.equal(orgGroupEntityRoot.get("groupId"), root.get("orgGroupId")),
orgGroupEntityRoot.get("category").in(reqDTO.getGroupCategory())
);
predicates.add(criteriaBuilder.exists(skillGroupCategorySubquery));
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!