package com.dao;
import com.model.po.ChartConfig;
import com.model.po.ChartConfigList;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface ChartsConfigMapper {
@Insert("insert into bi_charts(CHART_NAME,CHART_TYPE,BD_DATA_ID,CHART_CONFIG,GROUP_BY,ACCESS_AUTHORITY,UPDATE_AUTHORITY,CHART_DESCRIBES,is_legend,is_tooltip,is_datazoom,is_toolbox,create_by,create_date) " +
"VALUES (#{chartName},#{chartType}, #{dataId}, #{chartConfig}, #{groupBy}, #{accessAuthority}, #{updateAuthority}, #{describes},#{isLegend},#{isTooltip}, #{isDatazoom}, #{isToolbox}, #{createBy},to_date(#{createDate},'YYYY-MM-DD hh24:mi:ss'))")
void insertCharts(ChartConfig chartConfig);
@Delete("")
void deleteCharts(List idList);
@Select("select id as chartId, chart_name as chartName, chart_type as chartType, create_by as createBy, create_date as createDate" +
",bc_filters as filters, BD_DATA_ID as dataId, bc_table_name as tableName, CHART_CONFIG as chartConfig, GROUP_BY as groupBy," +
"ACCESS_AUTHORITY as accessAuthority, UPDATE_AUTHORITY as updateAuthority, CHART_DESCRIBES as describes, IS_LEGEND as isLegend," +
"IS_TOOLTIP as isTooltip, IS_DATAZOOM as isDatazoom, IS_TOOLBOX as isToolbox, BC_FILTERS as filters " +
" from bi_charts where id = #{id}")
ChartConfig getOneChart(int id);
@Select("select id as chartId, chart_name as chartName, chart_type as chartType, create_by as createBy, create_date as createDate" +
",bc_filters as filters from bi_charts")
List getListCharts();
/*
更新图表配置
*/
@Update("")
void updateChartConfig(ChartConfig chartConfig);
}