优化grid分页控件,增加可自定义参数而不被纳入自动生成的where语句中
This commit is contained in:
parent
869f427ae2
commit
61429bec36
|
|
@ -121,14 +121,11 @@ public abstract class BaseGridFactory implements IGrid {
|
||||||
if (Func.isEmpty(map)) {
|
if (Func.isEmpty(map)) {
|
||||||
map = new HashMap<>();
|
map = new HashMap<>();
|
||||||
}
|
}
|
||||||
if (Func.isPostgresql()) {
|
for (String key : map.keySet()) {
|
||||||
//postgresql8.3+版本 字段类型敏感,如果是int型需要做强制类型转换,mysql和oracle可以无视
|
if (key.startsWith(SqlKeyword.TOINT) || key.startsWith(SqlKeyword.IT) || key.startsWith(SqlKeyword.F_IT)) {
|
||||||
for (String key : map.keySet()) {
|
map.put(key.replace(SqlKeyword.SKIP, ""), Convert.toInt(map.get(key)));
|
||||||
if (key.startsWith(SqlKeyword.TOINT) || key.startsWith(SqlKeyword.IT) || key.startsWith(SqlKeyword.F_IT)) {
|
}
|
||||||
map.put(key, Convert.toInt(map.get(key)));
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
map.put(Const.ORDER_BY_STR, Func.isAllEmpty(sort, order) ? "" : (sort + " " + order));
|
map.put(Const.ORDER_BY_STR, Func.isAllEmpty(sort, order) ? "" : (sort + " " + order));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import java.util.Map;
|
||||||
* 定义常用的 sql关键字
|
* 定义常用的 sql关键字
|
||||||
*/
|
*/
|
||||||
public class SqlKeyword {
|
public class SqlKeyword {
|
||||||
|
public static final String SKIP = "_skip_true";
|
||||||
private static final String EQUAL = "_equal";
|
private static final String EQUAL = "_equal";
|
||||||
private static final String NOT_EQUAL = "_notequal";
|
private static final String NOT_EQUAL = "_notequal";
|
||||||
private static final String LIKE = "_like";
|
private static final String LIKE = "_like";
|
||||||
|
|
@ -57,6 +58,7 @@ public class SqlKeyword {
|
||||||
w = Func.decodeUrl(w);
|
w = Func.decodeUrl(w);
|
||||||
Map<String, String> mm = JsonKit.parse(w, HashMap.class);
|
Map<String, String> mm = JsonKit.parse(w, HashMap.class);
|
||||||
for (String m : mm.keySet()) {
|
for (String m : mm.keySet()) {
|
||||||
|
if (m.endsWith(SKIP)) break;
|
||||||
String col = clearKeyWord(m);
|
String col = clearKeyWord(m);
|
||||||
String k = "";
|
String k = "";
|
||||||
for (String key : keyWord.keySet()) {
|
for (String key : keyWord.keySet()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user