package com.yunzhupaas.onlinedev.service;


import com.yunzhupaas.base.ActionResult;
import com.yunzhupaas.base.entity.VisualdevEntity;
import com.yunzhupaas.base.model.FormDataField;
import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO;
import com.yunzhupaas.base.model.VisualDevJsonModel;
import com.yunzhupaas.base.model.flow.DataModel;
import com.yunzhupaas.base.model.flow.FlowFormDataModel;
import com.yunzhupaas.base.service.SuperService;
import com.yunzhupaas.exception.DataException;
import com.yunzhupaas.onlinedev.entity.VisualdevModelDataEntity;
import com.yunzhupaas.onlinedev.model.PaginationModel;
import com.yunzhupaas.onlinedev.model.PaginationModelExport;
import com.yunzhupaas.onlinedev.model.VisualParamModel;

import java.io.IOException;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * 0代码功能数据表
 * 版本： V3.0.0
 * 版权： 深圳市乐程软件有限公司
 * 作者： 管理员/admin
 * 日期： 2020-07-24 11:59
 */
public interface VisualdevModelDataService extends SuperService<VisualdevModelDataEntity> {

    /**
     * 获取表单主表属性下拉框
     *
     * @return
     */
    List<FormDataField> fieldList(String id, Integer filterType);

    /**
     * 弹窗数据分页
     *
     * @param visualdevEntity
     * @param paginationModel
     * @return
     */
    List<Map<String, Object>> getPageList(VisualdevEntity visualdevEntity, PaginationModel paginationModel);

    List<VisualdevModelDataEntity> getList(String modelId);

    VisualdevModelDataEntity getInfo(String id);

    VisualdevModelDataInfoVO infoDataChange(String id, VisualdevEntity visualdevEntity) throws IOException, ParseException, DataException, SQLException;

    void delete(VisualdevModelDataEntity entity);

    boolean tableDelete(String id, VisualDevJsonModel visualDevJsonModel) throws Exception;

    ActionResult tableDeleteMore(List<String> id, VisualDevJsonModel visualDevJsonModel) throws Exception;

    List<Map<String, Object>> exportData(String[] keys, PaginationModelExport paginationModelExport, VisualDevJsonModel visualDevJsonModel) throws IOException, ParseException, SQLException, DataException;

    DataModel visualCreate(VisualParamModel visualParamModel) throws Exception;

    DataModel visualUpdate(VisualParamModel visualParamModel) throws Exception;

    void visualDelete(VisualdevEntity visualdevEntity, List<Map<String, Object>> data) throws Exception;

    /**
     * 根据表名和规则删除功能表单数据
     */
    void deleteByTableName(FlowFormDataModel model) throws Exception;
}

