package com.yida.data.customForm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yida.data.common.core.entity.customform.CoreCustomForm;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 自定义表单 Mapper
 *
 * @author wjm
 * @date 2021-08-11 20:55:19
 */
public interface CoreCustomFormMapper extends BaseMapper<CoreCustomForm> {

    IPage<CoreCustomForm> findPageList(@Param("page") Page page, @Param("coreCustomForm") CoreCustomForm coreCustomForm);

    Integer initSqlReturnInt(@Param("sql") String sql);

    void initSqlReturnVoid(@Param("sql") String sql);


    /**
     * 查询用户对应填写表单
     * @param page
     * @param userId
     * @param tableName
     * @param status
     * @param schoolId
     * @return
     */
    IPage<CoreCustomForm> appFindFormList(@Param("page") Page<CoreCustomForm> page,
                                          @Param("userIdList") List<Long> userIdList,
                                          @Param("tableName") String tableName,
                                          @Param("status") Integer status,
                                          @Param("schoolId") Long schoolId,
                                          @Param("type") Integer type);


    /**
     * 查询用户对应管理表单
     * @param page
     * @param userId
     * @param tableName
     * @param status
     * @param schoolId
     * @return
     */
    IPage<CoreCustomForm> appFindAdminFormList(@Param("page") Page<CoreCustomForm> page,
                                               @Param("userId") Long userId,
                                               @Param("tableName") String tableName,
                                               @Param("status") Integer status,
                                               @Param("schoolId") Long schoolId);
}
