package com.zkqy.system.service;

import com.zkqy.system.entity.CommonEntity;
import com.zkqy.system.entity.TableSql;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

public interface ICommonService {


    /**
     * 单表查询列表
     */
    List<CommonEntity> selectList(CommonEntity commonEntity);

    /**
     * 批量新增
     */
    int batchInsert(CommonEntity commonEntity);

    /**
     * 修改
     */
    int edit(CommonEntity commonEntity);

    /**
     * 批量删除
     */
    int batchDelete(CommonEntity commonEntity);

    /**
     * 根据sqlkey 执行sql并返回结果
     */
    List<CommonEntity> queryTableList(CommonEntity commonEntity, TableSql tableSql);

    /**
     * 导出列表
     */
    void export(HttpServletResponse response, CommonEntity commonEntity) throws Exception;

    /**
     * 导出模版
     */
    void exportTemplate(HttpServletResponse response, String tableName, String sqlKey) throws Exception;

    /**
     * 动态表单预览接口
     */
    List<CommonEntity> dragTablePreview(CommonEntity commonEntity);

    /**
     * 查询模板库建表语句
     */
    Map<String, String> selectTableSql(String tableName);

    /**
     * 执行sql
     */
    void executeSql(String sql);

}
