package com.zkqy.execution.produce.dispersed.entity.runbpm;

import java.util.Map;

/**
 * @author hanzihang
 * @date 2023/12/13 3:24 PM
 */
public class BpmRunNodeFormFilterConditionsVo {

    /**
     * 表名称
     */
    private String tableName;

    /**
     * 查询表条件
     */
    private Map<String, Object> condition;

    /**
     * 是否当前节点回填数据
     * <p>
     * 例如：下拉框是当前节点表单的回显数据，并不是回填的操作数据
     * <p>
     * 默认拼接当前任务、节点编码
     */
    private boolean isNodeOnlyData;


    /**
     * 如果是数组，那么这就是返回数据的key
     * <p>
     * key:[
     * {label:value},
     * {label:value}
     * ]
     */
    private String listKey;

    public BpmRunNodeFormFilterConditionsVo() {
        this.isNodeOnlyData = true;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("BpmRunNodeFormFilterConditionsVo{");
        sb.append("tableName='").append(tableName).append('\'');
        sb.append(", condition=").append(condition);
        sb.append(", isNodeOnlyData=").append(isNodeOnlyData);
        sb.append(", listKey='").append(listKey).append('\'');
        sb.append('}');
        return sb.toString();
    }

    public BpmRunNodeFormFilterConditionsVo(String tableName, Map<String, Object> condition) {
        this.tableName = tableName;
        this.condition = condition;
    }

    public BpmRunNodeFormFilterConditionsVo(String tableName, Map<String, Object> condition, String listKey) {
        this.tableName = tableName;
        this.condition = condition;
        this.listKey = listKey;
    }

    public BpmRunNodeFormFilterConditionsVo(String tableName, Map<String, Object> condition, boolean isNodeOnlyData) {
        this.tableName = tableName;
        this.condition = condition;
        this.isNodeOnlyData = isNodeOnlyData;
    }

    public BpmRunNodeFormFilterConditionsVo(String tableName, Map<String, Object> condition, boolean isNodeOnlyData, String listKey) {
        this.tableName = tableName;
        this.condition = condition;
        this.isNodeOnlyData = isNodeOnlyData;
        this.listKey = listKey;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Map<String, Object> getCondition() {
        return condition;
    }

    public void setCondition(Map<String, Object> condition) {
        this.condition = condition;
    }

    public boolean isNodeOnlyData() {
        return isNodeOnlyData;
    }

    public void setNodeOnlyData(boolean nodeOnlyData) {
        isNodeOnlyData = nodeOnlyData;
    }

    public String getListKey() {
        return listKey;
    }

    public void setListKey(String listKey) {
        this.listKey = listKey;
    }

}
