package com.yida.data.form.customForm.service;


import com.yida.data.customForm.dto.FormDataInput;
import com.yida.data.form.customForm.entity.FormDataReturn;

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

/**
 * 自定义表单 Service接口
 *
 * @author wjm
 * @date 2021-08-11 20:55:19
 */
public interface CoreCustomFormDataService {

    /***
     * @Author jianMingWang
     * @Description 保存表单数据
     * @Date 9:39 2021/9/17
     * @Param formDataInput
     * @return void
     **/
    void saveFormData(FormDataInput formDataInput,Map data);

    /***
     * @Author jianMingWang
     * @Description //分页列表查询表单数据
     * @Date 9:40 2021/9/17
     * @Param [formId, pageSize, pageNo]
     * @return java.util.List<java.util.Map>
     **/
    List<Map> findSubmitFormDataListByFormId(Integer formId, Integer pageSize, Integer pageNo);


    /***
     * @Author jianMingWang
     * @Description //查询提交总数
     * @Date 14:12 2021/9/17
     * @Param [formId]
     * @return java.lang.Integer
     **/
    Integer findSubmitFormDataTotalNumByFormId(Integer formId);


    /***
    * @Author jianMingWang 
    * @Description //分页查询表单数据
    * @Date 14:34 2021/9/23
    * @Param [formId, pageSize, pageNo]
    * @return com.yida.data.customForm.entity.FormDataReturn
    **/
    FormDataReturn findList(Integer formId, Integer pageSize, Integer pageNo);

    /***
    * @Author jianMingWang 
    * @Description //导出表单数据
    * @Date 14:34 2021/9/23
    * @Param [formId, response]
    * @return void
    **/
    void exportData(Integer formId, HttpServletResponse response) throws ParseException;

    Map findData(Long formId, Long userId);

    /**
     * 清空
     * @param sql
     */
    void truncateTable(String sql);
}
