package ink.wgink.module.form.dao.design;

import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import ink.wgink.interfaces.init.IInitBaseTable;
import ink.wgink.module.form.pojo.dtos.design.FormDTO;
import ink.wgink.module.form.pojo.pos.design.FormPO;
import org.springframework.stereotype.Repository;

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

@Repository
public interface IFormDao extends IInitBaseTable {

    void createDynamicForm(String createTableSQL) throws SaveException;

    void deleteDynamicForm(String deleteTableSQL) throws RemoveException;

    void updateDynamicFormField(String alterFieldSQL) throws UpdateException;

    void deleteDynamicFormField(String alterFieldSQL) throws RemoveException;

    Integer countTable(String tableName) throws SearchException;

    void save(Map<String, Object> params) throws SaveException;

    void delete(Map<String, Object> params) throws RemoveException;

    void remove(Map<String, Object> params) throws RemoveException;

    void update(Map<String, Object> params) throws UpdateException;

    FormDTO get(Map<String, Object> params) throws SearchException;

    FormPO getPO(Map<String, Object> params) throws SearchException;

    Integer getLatestVersionByCode(String formCode) throws SearchException;

    List<FormDTO> list(Map<String, Object> params) throws SearchException;

    List<FormPO> listPO(Map<String, Object> params) throws SearchException;

    String getSavePageCodeByCodeAndVersion(Map<String, Object> params) throws SearchException;

    String getUpdatePageCodeByCodeAndVersion(Map<String, Object> params) throws SearchException;

    String getShowPageCodeByCodeAndVersion(Map<String, Object> params) throws SearchException;

    String getPrintPageCodeByCodeAndVersion(Map<String, Object> params) throws SearchException;

    String getAppSavePageCodeByCodeAndVersion(Map<String, Object> params) throws SearchException;

    String getAppUpdatePageCodeByCodeAndVersion(Map<String, Object> params) throws SearchException;

    String getAppShowPageCodeByCodeAndVersion(Map<String, Object> params) throws SearchException;

}
