Commit b0fca55d authored by xiandafu's avatar xiandafu
Browse files
parents b13f4fed f94da76b
batchDelByIds batchDelByIds
=== ===
update core_org set u.del_flag = 1 where u.id in( #join(ids)#); update core_org set u.del_flag = 1 where u.id in( #join(ids)#)
queryByCondtion queryByCondtion
=== ===
......
...@@ -49,19 +49,19 @@ batchDelByIds ...@@ -49,19 +49,19 @@ batchDelByIds
* 批量删除角色,同时也参考batchDeleteRoleFunction,batchDeleteRoleMenu等方法删除其他关联数据 * 批量删除角色,同时也参考batchDeleteRoleFunction,batchDeleteRoleMenu等方法删除其他关联数据
delete from core_role where id in( #join(ids)#); delete from core_role where id in( #join(ids)#)
batchDeleteRoleFunction batchDeleteRoleFunction
=== ===
delete from core_role_function where role_id in( #join(ids)#); delete from core_role_function where role_id in( #join(ids)#)
batchDeleteRoleMenu batchDeleteRoleMenu
=== ===
delete from core_role_menu where role_id in( #join(ids)#); delete from core_role_menu where role_id in( #join(ids)#)
batchDeleteUserRole batchDeleteUserRole
=== ===
delete from core_user_role where role_id in( #join(ids)#); delete from core_user_role where role_id in( #join(ids)#)
queryAllByDelflag queryAllByDelflag
......
...@@ -82,7 +82,7 @@ public class DataAccessFunction implements Function { ...@@ -82,7 +82,7 @@ public class DataAccessFunction implements Function {
List<Object> list = (List<Object>)ctx.getGlobal("_paras"); List<Object> list = (List<Object>)ctx.getGlobal("_paras");
StringBuilder sb = new StringBuilder(" "); StringBuilder sb = new StringBuilder("( ");
//数据权限范围划定 //数据权限范围划定
boolean hasAppend = false; boolean hasAppend = false;
for(int i=0;i<roleFuns.size();i++){ for(int i=0;i<roleFuns.size();i++){
...@@ -106,6 +106,7 @@ public class DataAccessFunction implements Function { ...@@ -106,6 +106,7 @@ public class DataAccessFunction implements Function {
case AllOrg:{ case AllOrg:{
//sql 不包含组织机构过滤信息 //sql 不包含组织机构过滤信息
sb.append(" 1=1 /* AllOrg */ "); sb.append(" 1=1 /* AllOrg */ ");
break;
} }
case OnlyUser:{ case OnlyUser:{
List<Long> ids = ret.getUserIds(); List<Long> ids = ret.getUserIds();
...@@ -164,7 +165,7 @@ public class DataAccessFunction implements Function { ...@@ -164,7 +165,7 @@ public class DataAccessFunction implements Function {
} }
sb.append(" ) ");
return sb.toString(); return sb.toString();
} }
......
package com.ibeetl.admin.core.web.query; package com.ibeetl.admin.core.web.query;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ibeetl.admin.core.annotation.Query;
import org.beetl.sql.core.engine.PageQuery; import org.beetl.sql.core.engine.PageQuery;
import java.lang.reflect.Field;
/** /**
* 子类继承此类获得翻页功能 * 子类继承此类获得翻页功能
* @author lijiazhi * @author lijiazhi
...@@ -21,6 +24,26 @@ public class PageParam { ...@@ -21,6 +24,26 @@ public class PageParam {
@JsonIgnore @JsonIgnore
public PageQuery getPageQuery() { public PageQuery getPageQuery() {
Field[] fs =this.getClass().getDeclaredFields();
for(Field f:fs){
Query query = f.getAnnotation(Query.class);
if(query==null){
continue ;
}
if (query.fuzzy()) {
try {
if ( f.getType() == String.class) {
f.setAccessible(true);
Object o = f.get(this);
if (o != null && !o.toString().isEmpty()) {
f.set(this,"%"+o.toString()+"%");
}
}
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
PageQuery query = new PageQuery(); PageQuery query = new PageQuery();
query.setParas(this); query.setParas(this);
if (page != null) { if (page != null) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment