package com.aps.entity.common;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import java.util.Map;

public class SqlOrder {
    //    命令類型，查詢：SELECT,FIND,GROUP,
//             數據操作: UPDATE,INSERT,DELETE,IMPORTS,BATCH,
    private String type;
    private String name;
    private String table;
    private Object data;

    public SqlOrder() {
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTable() {
        if (table==null|| table.isEmpty()){
            return name;
        }
        return table;
    }

    public void setTable(String table) {
        this.table = table;
    }

    public Object getData() {
        return data;
    }
//    public Paged getPagedData(){
//        return JSONObject.parseObject(JSONObject.toJSONString(data),Paged.class);
//    }
//    public Map<String,Object> get(){
//        return JSONObject.parseObject(JSONObject.toJSONString(data),JSONObject.class);
//    }
//    public JSONArray getJSONArrayData(){
//        return JSONObject.parseObject(JSONObject.toJSONString(data),JSONArray.class);
//    }
    public void setData(Object data) {
        this.data = data;
    }
}
