package cn.com.tenlion.configtable.service.configtableoperation;

import cn.com.tenlion.configtable.pojo.dtos.configtableoperation.ConfigTableOperationDTO;
import ink.wgink.exceptions.SearchException;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResultList;
import java.util.List;
import java.util.Map;

/**
 * @ClassName: IConfigTableOperationSubService
 * @Description: 动态表单操作
 * @Author: CodeFactory
 * @Date: 2021-06-24 10:59:30
 * @Version: 3.0
 **/
public interface IConfigTableOperationSubService extends IConfigTableOperationService{


    /**
     * 查询真实表单是否存在
     * @param configTableCode
     */
    Integer getTableExist(String configTableCode);

    /**
     *  查询动态表单的基础信息
     * @param configTableCode
     * @return
     * @throws SearchException
     */
    List<ConfigTableOperationDTO> getTableFieldConfig(String configTableCode);

    /**
     *  查询动态表单的基础信息(不带基础字段)
     * @param configTableCode
     * @return
     * @throws SearchException
     */
    List<ConfigTableOperationDTO> getTableFieldConfigNotBase(String configTableCode);

    /**
     * 查询动态表单数据
     * @param configTableCode
     * @return
     * @throws SearchException
     */
    List<Map<String, Object>> getTableFieldData(String configTableCode, Map<String, Object> query);

    /**
     * 修改动态表单数据
     * @param configTableCode
     * @param updateList
     */
    void updateTableFieldData(String configTableCode, List<ConfigTableOperationDTO> updateList);

    /**
     * 新增动态表单数据
     * @param configTableCode
     * @param saveList
     */
    void saveTableFieldData(String configTableCode, List<ConfigTableOperationDTO> saveList);

    /**
     * 删除动态表单数据
     * @param configTableCode
     * @param uid
     */
    void deleteTableFieldData(String configTableCode, String uid);

    /**
     * 动态表单数据列表
     * @param params
     * @return
     */
    List<Map<String, Object>> list(Map<String, Object> params);

    /**
     * 动态表单数据列表(分页)
     * @param page
     * @return
     */
    SuccessResultList<List<Map<String, Object>>> listPage(ListPage page);

    /**
     * 创建真实的数据库表
     * @param params
     */
    void saveTable(Map<String, Object> params);

    /**
     * 删除数据库表
     * @param configTableCode
     */
    void deleteTable(String configTableCode);

}
