
package com.lideeyunji.core.framework.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant;
import com.lideeyunji.tool.framework.yunji.annotation.lideeYunjiCache;
import com.lideeyunji.tool.framework.yunji.constant.lideeRedisConstants;
import org.apache.ibatis.annotations.Delete;

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

/**
 * 低代码平台
 */
@DS(lideeYunJiBaseConstant.DS_lideeyunji)
public interface LideeYunJiMapper {

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

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

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

    //获取开启搜索列-数据报表
    @lideeYunjiCache(cacheNames = "'"+ lideeRedisConstants.REDIS_DBFORM + ":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 yunji_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();
}
