package com.zioinfo.cms.form.mapper;

import com.zioinfo.cms.form.CmsForm;
import com.zioinfo.cms.form.CmsFormSubmission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FormMapper {
    List<CmsForm> findAll();
    CmsForm findById(@Param("id") Long id);
    CmsForm findBySlug(@Param("slug") String slug);
    int insert(CmsForm f);
    int update(CmsForm f);
    int delete(@Param("id") Long id);

    int insertSubmission(CmsFormSubmission s);
    List<CmsFormSubmission> findSubmissions(@Param("formId") Long formId, @Param("includeSpam") boolean includeSpam);
}
