package ink.wgink.module.form.service.report;

import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResultList;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: IFormReportService
 * @Description: 表单上报
 * @Author: wanggeng
 * @Date: 2022/3/14 5:30 PM
 * @Version: 1.0
 */
public interface IFormReportService {

    /**
     * 新增
     *
     * @param formCode
     * @param formVersion
     * @param params
     */
    void save(String formCode, Integer formVersion, Map<String, Object> params);

    /**
     * 新增
     *
     * @param token
     * @param formCode
     * @param formVersion
     * @param params
     */
    void saveByToken(String token, String formCode, Integer formVersion, Map<String, Object> params);

    /**
     * 新增
     *
     * @param userId
     * @param formCode
     * @param formVersion
     * @param params
     */
    void saveByUserId(String userId, String formCode, Integer formVersion, Map<String, Object> params);

    /**
     * 新增
     *
     * @param formCode
     * @param formVersion
     * @param params
     * @return id
     */
    String saveAndReturnId(String formCode, Integer formVersion, Map<String, Object> params);

    /**
     * 新增
     *
     * @param token
     * @param formCode
     * @param formVersion
     * @param params
     * @return id
     */
    String saveByTokenAndReturnId(String token, String formCode, Integer formVersion, Map<String, Object> params);

    /**
     * 新增
     *
     * @param userId
     * @param formCode
     * @param formVersion
     * @param params
     * @return id
     */
    String saveByUserIdAndReturnId(String userId, String formCode, Integer formVersion, Map<String, Object> params);

    /**
     * 删除
     *
     * @param formCode
     * @param formVersion
     * @param uids
     */
    void remove(String formCode, Integer formVersion, List<String> uids);

    /**
     * 更新
     *
     * @param formCode
     * @param formVersion
     * @param uid
     * @param params
     */
    void update(String formCode, Integer formVersion, String uid, Map<String, Object> params);

    /**
     * 更新
     *
     * @param token
     * @param formCode
     * @param formVersion
     * @param uid
     * @param params
     */
    void updateByToken(String token, String formCode, Integer formVersion, String uid, Map<String, Object> params);

    /**
     * 更新
     *
     * @param userId
     * @param formCode
     * @param formVersion
     * @param uid
     * @param params
     */
    void updateByUserId(String userId, String formCode, Integer formVersion, String uid, Map<String, Object> params);

    /**
     * 更新
     *
     * @param creator
     * @param modifier
     * @param formCode
     * @param formVersion
     * @param uid
     * @param params
     */
    void updateByCreatorAndModifier(String creator, String modifier, String formCode, Integer formVersion, String uid, Map<String, Object> params);

    /**
     * 更新流程实例
     *
     * @param formCode
     * @param formVersion
     * @param uid
     * @param processInstanceId
     */
    void updateProcessInstanceId(String formCode, Integer formVersion, String uid, String processInstanceId);

    /**
     * 详情
     *
     * @param formCode
     * @param formVersion
     * @param uid
     * @return
     */
    Map<String, Object> get(String formCode, Integer formVersion, String uid);

    /**
     * 详情
     *
     * @param userId
     * @param formCode
     * @param formVersion
     * @param uid
     * @return
     */
    Map<String, Object> getByUserId(String userId, String formCode, Integer formVersion, String uid);

    /**
     * 列表
     *
     * @param formCode
     * @param formVersion
     * @param params
     * @return
     */
    List<Map<String, Object>> list(String formCode, Integer formVersion, Map<String, Object> params);

    /**
     * 列表
     *
     * @param userId
     * @param formCode
     * @param formVersion
     * @param params
     * @return
     */
    List<Map<String, Object>> listByUserId(String userId, String formCode, Integer formVersion, Map<String, Object> params);

    /**
     * 分页列表
     *
     * @param formCode
     * @param formVersion
     * @param page
     * @return
     */
    SuccessResultList<List<Map<String, Object>>> listPage(String formCode, Integer formVersion, ListPage page);

    /**
     * 分页列表
     *
     * @param userId
     * @param formCode
     * @param formVersion
     * @param page
     * @return
     */
    SuccessResultList<List<Map<String, Object>>> listPageByUserId(String userId, String formCode, Integer formVersion, ListPage page);

    /**
     * 分页列表（全部字段）
     *
     * @param formCode
     * @param formVersion
     * @param page
     * @return
     */
    SuccessResultList<List<Map<String, Object>>> listPageAllField(String formCode, Integer formVersion, ListPage page);

    /**
     * 显示字段列表
     *
     * @param formCode
     * @param formVersion
     * @return
     */
    List<String> listShowField(String formCode, Integer formVersion);

    /**
     * 统计
     *
     * @param tableName
     * @return
     */
    Integer count(String tableName);

}
