All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.schoolwow.util.domain.query.jsonarray.QueryJSONArray Maven / Gradle / Ivy

The newest version!
package cn.schoolwow.util.domain.query.jsonarray;

import cn.schoolwow.util.module.query.jsonarray.domain.JSONArrayQueryOption;
import com.alibaba.fastjson.JSONArray;

import java.util.List;

public class QueryJSONArray {
    private JSONArrayQueryOption jsonQueryOption = new JSONArrayQueryOption();

    /**创建实例列表查询*/
    public static  QueryJSONArray newQuery(JSONArray array){
        QueryJSONArray jsonQuery = new QueryJSONArray();
        jsonQuery.jsonQueryOption.array = array;
        return jsonQuery;
    }

    /**是否去重*/
    public QueryJSONArray distinct(){
        jsonQueryOption.distinct = true;
        return this;
    }

    /**添加字段值查询*/
    public QueryJSONArray addQuery(String fieldName, Object value){
        jsonQueryOption.fieldValueMap.put(fieldName, value);
        return this;
    }

    /**添加字段列表查询*/
    public QueryJSONArray addInQuery(String fieldName, List valueList){
        jsonQueryOption.fieldValueListMap.put(fieldName, valueList);
        return this;
    }

    public QueryJSONArrayResponse execute(){
        return new QueryJSONArrayResponse(jsonQueryOption);
    }
}