| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- 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("<script>" +
- "delete from bi_charts where id in " +
- "("+
- "<foreach collection=\"list\" index=\"index\" item=\"item\" separator=\",\">" +
- "#{item, jdbcType = NUMERIC}"+
- "</foreach>" +
- ")"+
- "</script>")
- void deleteCharts(List<Integer> 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<ChartConfigList> getListCharts();
- /*
- 更新图表配置
- */
- @Update("<script>" +
- "UPDATE bi_charts set " +
- "CHART_NAME = #{chartName}" +
- "<if test=\"chartType != null\"> , CHART_TYPE = #{chartType} </if>" +
- "<if test=\"createBy != null\"> , CREATE_BY = #{createBy} </if>" +
- "<if test=\"groupBy != null\"> , GROUP_BY = #{groupBy} </if>" +
- "<if test=\"chartConfig != null\"> , CHART_CONFIG = #{chartConfig} </if>" +
- // "<if test=\"chartDescribes != null\"> , CHART_DESCRIBES = #{chartDescribes} </if>" +
- "<if test=\"filters != null\"> , BC_FILTERS = #{filters} </if>" +
- "<if test=\"accessAuthority != null\"> , ACCESS_AUTHORITY = #{accessAuthority} </if>" +
- "<if test=\"updateAuthority != null\"> , UPDATE_AUTHORITY = #{updateAuthority} </if>" +
- "<if test=\"isDatazoom != null\"> , IS_DATAZOOM = #{isDatazoom} </if>" +
- "<if test=\"isLegend != null\"> , IS_LEGEND = #{isLegend} </if>" +
- "<if test=\"isToolbox != null\"> , IS_TOOLBOX = #{isToolbox} </if>" +
- "<if test=\"isTooltip != null\"> , IS_TOOLTIP = #{isTooltip} </if>" +
- "<if test=\"updateDate != null\"> , UPDATE_DATE = to_date(#{updateDate},'YYYY-MM-DD hh24:mi:ss') </if>" +
- "where id = #{chartId}" +
- "</script>")
- void updateChartConfig(ChartConfig chartConfig);
- }
|