@@ -882,14 +882,14 @@ public String getColumnString(boolean inSQLJoin) throws Exception {
882882 }
883883
884884 // 简单点, 后台配置就带上 AS
885- // int index = expression.lastIndexOf(":");
886- // String alias = expression.substring(index+1);
887- // boolean hasAlias = StringUtil.isName(alias);
888- // String pre = index > 0 && hasAlias ? expression.substring(0, index) : expression;
889- // if (RAW_MAP.containsValue(pre) || "".equals(RAW_MAP.get(pre))) { // newSQLConfig 提前处理好的
890- // expression = pre + (hasAlias ? " AS " + alias : "");
891- // continue;
892- // }
885+ // int index = expression.lastIndexOf(":");
886+ // String alias = expression.substring(index+1);
887+ // boolean hasAlias = StringUtil.isName(alias);
888+ // String pre = index > 0 && hasAlias ? expression.substring(0, index) : expression;
889+ // if (RAW_MAP.containsValue(pre) || "".equals(RAW_MAP.get(pre))) { // newSQLConfig 提前处理好的
890+ // expression = pre + (hasAlias ? " AS " + alias : "");
891+ // continue;
892+ // }
893893 }
894894
895895
@@ -1572,8 +1572,7 @@ else if (isSideJoin) { // ^ SIDE JOIN: ! (A & B)
15721572 * @return
15731573 * @throws Exception
15741574 */
1575- private String getWhereItem (String key , Object value
1576- , RequestMethod method , boolean verifyName ) throws Exception {
1575+ protected String getWhereItem (String key , Object value , RequestMethod method , boolean verifyName ) throws Exception {
15771576 Log .d (TAG , "getWhereItem key = " + key );
15781577 //避免筛选到全部 value = key == null ? null : where.get(key);
15791578 if (key == null || value == null || key .endsWith ("()" ) || key .startsWith ("@" )) { //关键字||方法, +或-直接报错
@@ -1593,7 +1592,7 @@ private String getWhereItem(String key, Object value
15931592 if (key .endsWith ("$" )) {
15941593 keyType = 1 ;
15951594 }
1596- else if (key .endsWith ("~" ) || key . endsWith ( "?" )) { //TODO ?可能以后会被废弃,全用 ~ 和 *~ 替代,更接近 PostgreSQL 语法
1595+ else if (key .endsWith ("~" )) {
15971596 keyType = key .charAt (key .length () - 2 ) == '*' ? -2 : 2 ; //FIXME StringIndexOutOfBoundsException
15981597 }
15991598 else if (key .endsWith ("%" )) {
@@ -1623,7 +1622,7 @@ else if (key.endsWith("<")) {
16231622 keyType = 0 ;
16241623 }
16251624
1626- key = getRealKey (method , key , false , true , verifyName , getQuote () );
1625+ key = getRealKey (method , key , false , true , verifyName );
16271626
16281627 switch (keyType ) {
16291628 case 1 :
@@ -2223,8 +2222,6 @@ public String getSetString(RequestMethod method, Map<String, Object> content, bo
22232222 String setString = "" ;
22242223
22252224 if (set != null && set .size () > 0 ) {
2226- String quote = getQuote ();
2227-
22282225 boolean isFirst = true ;
22292226 int keyType ;// 0 - =; 1 - +, 2 - -
22302227 Object value ;
@@ -2244,7 +2241,7 @@ public String getSetString(RequestMethod method, Map<String, Object> content, bo
22442241 keyType = 0 ; //注意重置类型,不然不该加减的字段会跟着加减
22452242 }
22462243 value = content .get (key );
2247- key = getRealKey (method , key , false , true , verifyName , quote );
2244+ key = getRealKey (method , key , false , true , verifyName );
22482245
22492246 setString += (isFirst ? "" : ", " ) + (getKey (key ) + " = " + (keyType == 1 ? getAddString (key , value ) : (keyType == 2
22502247 ? getRemoveString (key , value ) : getValue (value )) ) );
@@ -2967,8 +2964,8 @@ LEFT JOIN ( SELECT count(*) AS count FROM sys.Comment ) AS Comment ON Comment.m
29672964 * @return
29682965 */
29692966 public static String getRealKey (RequestMethod method , String originKey
2970- , boolean isTableKey , boolean saveLogic , String quote ) throws Exception {
2971- return getRealKey (method , originKey , isTableKey , saveLogic , true , quote );
2967+ , boolean isTableKey , boolean saveLogic ) throws Exception {
2968+ return getRealKey (method , originKey , isTableKey , saveLogic , true );
29722969 }
29732970 /**获取客户端实际需要的key
29742971 * @param method
@@ -2979,19 +2976,18 @@ public static String getRealKey(RequestMethod method, String originKey
29792976 * @return
29802977 */
29812978 public static String getRealKey (RequestMethod method , String originKey
2982- , boolean isTableKey , boolean saveLogic , boolean verifyName , String quote ) throws Exception {
2979+ , boolean isTableKey , boolean saveLogic , boolean verifyName ) throws Exception {
29832980 Log .i (TAG , "getRealKey saveLogic = " + saveLogic + "; originKey = " + originKey );
2984- if (originKey == null || originKey .startsWith (quote ) || apijson .JSONObject .isArrayKey (originKey )) {
2985- Log .w (TAG , "getRealKey originKey == null || originKey.startsWith(`)"
2986- + " || apijson.JSONObject.isArrayKey(originKey) >> return originKey;" );
2981+ if (originKey == null || apijson .JSONObject .isArrayKey (originKey )) {
2982+ Log .w (TAG , "getRealKey originKey == null || apijson.JSONObject.isArrayKey(originKey) >> return originKey;" );
29872983 return originKey ;
29882984 }
29892985
29902986 String key = new String (originKey );
29912987 if (key .endsWith ("$" )) {//搜索 LIKE,查询时处理
29922988 key = key .substring (0 , key .length () - 1 );
29932989 }
2994- else if (key .endsWith ("~" ) || key . endsWith ( "?" )) {//匹配正则表达式 REGEXP,查询时处理 TODO ?可能以后会被废弃,全用 ~ 和 *~ 替代,更接近 PostgreSQL 语法
2990+ else if (key .endsWith ("~" )) {//匹配正则表达式 REGEXP,查询时处理
29952991 key = key .substring (0 , key .length () - 1 );
29962992 if (key .endsWith ("*" )) {//忽略大小写
29972993 key = key .substring (0 , key .length () - 1 );
0 commit comments