|
@@ -115,32 +115,9 @@ public class LhbgCtl extends BaseWebCtl {
|
|
|
|
|
|
list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
|
|
|
// 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
|
|
|
- /*
|
|
|
- * if (!isJyr()) { //
|
|
|
- * list.add(cb.like(root.get("szd").get("id").as(String.class),
|
|
|
- * // "%" + SecUtils.getCurrUser().getSzd().getId() + "%"));
|
|
|
- *
|
|
|
- * In<String> in =
|
|
|
- * cb.in(root.get("szgq").get("id").as(String.class));
|
|
|
- * List<String> gqlist = (List<String>)
|
|
|
- * Utils.getSession().getAttribute("gqList"); if (gqlist != null
|
|
|
- * && gqlist.size() > 0) { for (int i = 0; i < gqlist.size();
|
|
|
- * i++) { in.value(gqlist.get(i)); } list.add(in); }
|
|
|
- *
|
|
|
- * } else { Subquery<GkjyrEntity> subquery =
|
|
|
- * query.subquery(GkjyrEntity.class); Root<GkjyrEntity> dpRoot =
|
|
|
- * subquery.from(GkjyrEntity.class); subquery.select(dpRoot);
|
|
|
- * List<Predicate> subQueryPredicates = new
|
|
|
- * ArrayList<Predicate>();
|
|
|
- * subQueryPredicates.add(cb.equal(root.get
|
|
|
- * ("jyrid").as(String.class),
|
|
|
- * dpRoot.get("id").as(String.class)));
|
|
|
- * subQueryPredicates.add(cb
|
|
|
- * .equal(dpRoot.get("yjyrid").as(String.class),
|
|
|
- * getSsjyr().getId()));
|
|
|
- * subquery.where(subQueryPredicates.toArray(new Predicate[]
|
|
|
- * {})); list.add(cb.exists(subquery)); }
|
|
|
- */
|
|
|
+ if(isJyr()){
|
|
|
+ list.add(cb.like(root.get("jyrid").as(String.class), "%" + securityMgr.getCurrUser().getSsjyr().getId() + "%"));
|
|
|
+ }
|
|
|
|
|
|
return cb.and(list.toArray(new Predicate[] {}));
|
|
|
}
|