package com.ruoyi.web.report.mapper;

import com.ruoyi.web.report.domain.design.ReportAggregatePolicyDesign;
import com.ruoyi.web.report.domain.design.ReportFieldDesign;
import com.ruoyi.web.report.domain.design.ReportJoinDesign;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 报表设计配置 Mapper。
 */
public interface ReportDesignMapper {
    List<ReportFieldDesign> selectFieldsByReportId(Long reportId);

    List<ReportJoinDesign> selectJoinsByReportId(Long reportId);

    String selectCustomSqlByReportId(Long reportId);

    ReportAggregatePolicyDesign selectAggregatePolicyByReportId(Long reportId);

    int deleteFieldsByReportId(Long reportId);

    int deleteJoinsByReportId(Long reportId);

    int insertFieldBatch(@Param("reportId") Long reportId, @Param("list") List<ReportFieldDesign> list);

    int insertJoinBatch(@Param("reportId") Long reportId, @Param("list") List<ReportJoinDesign> list);

    int deleteCustomSqlByReportId(Long reportId);

    int insertCustomSql(@Param("reportId") Long reportId, @Param("sqlText") String sqlText);

    int deleteAggregatePolicyByReportId(Long reportId);

    int insertAggregatePolicy(@Param("reportId") Long reportId, @Param("policy") ReportAggregatePolicyDesign policy);
}
