@@ -134,6 +134,7 @@ public JSONObject setUserIdIn(List<Object> list) {
134134 // public static final String KEY_KEEP = "@keep"; //一定会返回,为 null 或 空对象时,会使用默认值(非空),解决其它对象因为不关联的第一个对为空导致也不返回
135135 public static final String KEY_DEFULT = "@default" ; //TODO 自定义默认值 { "@default":true },@default 可完全替代 @keep
136136 public static final String KEY_NULL = "@null" ; //TODO 值为 null 的键值对 "@null":"tag,pictureList",允许 is NULL 条件判断, SET tag = NULL 修改值为 NULL 等
137+ public static final String KEY_CAST = "@cast" ; //TODO 类型转换 cast(date AS DATE)
137138
138139 public static final String KEY_ROLE = "@role" ; //角色,拥有对某些数据的某些操作的权限
139140 public static final String KEY_DATABASE = "@database" ; //数据库类型,默认为MySQL
@@ -161,6 +162,8 @@ public JSONObject setUserIdIn(List<Object> list) {
161162 TABLE_KEY_LIST .add (KEY_CACHE );
162163 TABLE_KEY_LIST .add (KEY_COLUMN );
163164 TABLE_KEY_LIST .add (KEY_FROM );
165+ TABLE_KEY_LIST .add (KEY_NULL );
166+ TABLE_KEY_LIST .add (KEY_CAST );
164167 TABLE_KEY_LIST .add (KEY_COMBINE );
165168 TABLE_KEY_LIST .add (KEY_GROUP );
166169 TABLE_KEY_LIST .add (KEY_HAVING );
@@ -275,15 +278,45 @@ public JSONObject setColumn(String keys) {
275278 return puts (KEY_COLUMN , keys );
276279 }
277280
281+ /**set keys whose value is null
282+ * @param keys key0, key1, key2 ...
283+ * @return {@link #setNull(String)}
284+ */
285+ public JSONObject setNull (String ... keys ) {
286+ return setNull (StringUtil .getString (keys , true ));
287+ }
288+ /**set keys whose value is null
289+ * @param keys "key0,key1,key2..."
290+ * @return
291+ */
292+ public JSONObject setNull (String keys ) {
293+ return puts (KEY_NULL , keys );
294+ }
295+
296+ /**set keys and types whose value should be cast to type, cast(value AS DATE)
297+ * @param keyTypes key0:type0, key1:type1, key2:type2 ...
298+ * @return {@link #setCast(String)}
299+ */
300+ public JSONObject setCast (String ... keyTypes ) {
301+ return setCast (StringUtil .getString (keyTypes , true ));
302+ }
303+ /**set keys and types whose value should be cast to type, cast(value AS DATE)
304+ * @param keyTypes "key0:type0,key1:type1,key2:type2..."
305+ * @return
306+ */
307+ public JSONObject setCast (String keyTypes ) {
308+ return puts (KEY_CAST , keyTypes );
309+ }
310+
278311 /**set combination of keys for conditions
279- * @param keys key0,&key1,|key2,!kye3 ...
312+ * @param keys key0,&key1,|key2,!key3 ... TODO or key0> | (key1{} & !key2) ...
280313 * @return {@link #setColumn(String)}
281314 */
282315 public JSONObject setCombine (String ... keys ) {
283316 return setCombine (StringUtil .getString (keys , true ));
284317 }
285318 /**set combination of keys for conditions
286- * @param keys key0,&key1,|key2,!kye3 ...
319+ * @param keys key0,&key1,|key2,!key3 ... TODO or key0> | (key1{} & !key2) ...
287320 * @return
288321 */
289322 public JSONObject setCombine (String keys ) {
0 commit comments