同另一个问题!http://www.eova.cn/qa/detail/376
给个Demo你参考下 元数据中添加业务拦截器 public class WxConfigIntercept extends BaseMetaObjectIntercept{ @Override public void queryBefore(AopContext ac) throws Exception { int id = ac.user.getInt("id"); int rId = ac.user.role.getInt("id"); System.out.println("用户ID>"+id); System.out.println("角色ID>"+rId); if (rId <=2) { //查询所有 }else { //根据用户ID查询 ac.condition = " and uid = " + id; } super.queryBefore(ac); } @Override public String addBefore(AopContext ac) throws Exception { ac.record.set("uid", ac.user.getInt("id")); return super.addBefore(ac); } }
默认值里写:${user.login_id}