
package com.jeelowcode.core.framework.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.jeelowcode.framework.global.JeeLowCodeBaseConstant;
import com.jeelowcode.framework.utils.annotation.JeelowCodeCache;
import org.apache.ibatis.annotations.Delete;

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

/**
 * 低代码平台
 */
@DS(JeeLowCodeBaseConstant.DS_JEELOWCODE)
public interface JeeLowCodeMapper {

    //获取前端显示列
    @JeelowCodeCache(cacheNames = "'JeeLowCodeMapper:getWebViewFieldList:' + #dbFormId", reflexClass = String.class)
    List<String> getWebViewFieldList(Long dbFormId);

    //获取开启搜索列
    @JeelowCodeCache(cacheNames = "'JeeLowCodeMapper:getDbWhereFieldList:' + #dbFormId", reflexClass = Map.class,nullIsSave = true)
    List<Map<String,String>> getDbWhereFieldList(Long dbFormId);

    @JeelowCodeCache(cacheNames = "'JeeLowCodeMapper:getAllDbWhereFieldList:' + #dbFormId", reflexClass = Map.class,nullIsSave = true)
    List<Map<String,String>> getAllDbWhereFieldList(Long dbFormId);

    //获取开启搜索列-数据报表
    @JeelowCodeCache(cacheNames = "'JeeLowCodeMapper:getReportWhereFieldList:' + #reportId", reflexClass = Map.class,nullIsSave=true)
    List<Map<String,String>> getReportWhereFieldList(Long reportId);

    //获取导出字段
    List<Map<String,Object>> getExcelExportFieldList(Long dbFormId);
    List<Map<String,Object>> getExcelImportFieldList(Long dbFormId);

    //获取数量
    Map<String,Object> getFormCou(Long dbFormId);


    //清除ExcelData
    @Delete("delete from lowcode_log_excel_file_data where create_time<#{clearDate}")
    Integer clearExcelData(Date clearDate);

    //表单开发国际化
    List<Map<String,Object>> getDbFormI18nMapList();
    List<Map<String,Object>> getReportI18nMapList();
    List<Map<String,Object>> getTabI18nMapList();
    List<Map<String,Object>> getDesFormI18nMapList();
    List<Map<String,Object>> getButtonI18nMapList();
}
