|
|
@@ -1,8 +1,10 @@
|
|
|
package com.dao;
|
|
|
|
|
|
+import com.model.bo.ChartsColumnConfig;
|
|
|
import com.model.bo.ColumnConfigAndSql;
|
|
|
import com.model.po.ChartConfig;
|
|
|
import com.model.po.ChartConfigList;
|
|
|
+import com.model.po.ChartsConfigToDash;
|
|
|
import com.model.vo.configVo.GroupInfo;
|
|
|
import org.apache.ibatis.annotations.*;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
@@ -15,9 +17,9 @@ import java.util.Map;
|
|
|
public interface ChartsConfigMapper {
|
|
|
|
|
|
@Insert("insert into bi_charts(id,CHART_NAME,CHART_TYPE,BD_DATA_ID,CHART_CONFIG,GROUP_BY,ACCESS_AUTHORITY,UPDATE_AUTHORITY,BC_CHARTS_GROUP,CHART_DESCRIBES,BC_CHART_STYLE," +
|
|
|
- "create_by,create_date, bc_charts_option, create_Id) " +
|
|
|
+ "create_by,create_date, bc_charts_option, create_Id, BC_FETCHCONFIG) " +
|
|
|
"VALUES (#{chartId},#{chartName},#{chartType}, #{dataId}, #{chartConfig}, #{groupBy}, #{accessAuthority}, #{updateAuthority}, #{chartsGroup}," +
|
|
|
- "#{describes},#{style}, #{createBy},to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'), #{chartOption}, #{createId})" )
|
|
|
+ "#{describes},#{style}, #{createBy},to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'), #{chartOption}, #{createId}, #{fetchConfig})" )
|
|
|
// @Options(useGeneratedKeys=false, keyProperty = "chartId",keyColumn = "id")
|
|
|
@SelectKey(before=true,keyProperty="chartId",resultType=Integer.class,statement="SELECT charts_squence.nextval from dual",keyColumn = "id")
|
|
|
void insertCharts(ChartConfig chartConfig);
|
|
|
@@ -32,10 +34,11 @@ public interface ChartsConfigMapper {
|
|
|
"</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_charts_group as chartsGroup" +
|
|
|
- ",bc_filters as filters, BD_DATA_ID as dataId, bc_table_name as tableName, CHART_CONFIG as chartConfig, GROUP_BY as groupBy, bc_charts_option as chartOption, " +
|
|
|
- "ACCESS_AUTHORITY as accessAuthority, UPDATE_AUTHORITY as updateAuthority, CHART_DESCRIBES as describes, BC_CHART_STYLE as style, BC_FILTERS as filters " +
|
|
|
- ",create_id as createId from bi_charts where id = #{id}")
|
|
|
+ @Select("select bc.id as chartId, chart_name as chartName, chart_type as chartType, bc.create_by as createBy, bc.create_date as createDate, bc_charts_group as chartsGroup" +
|
|
|
+ " ,bc.bc_filters as filters, bc.BD_DATA_ID as dataId, bc_table_name as tableName, CHART_CONFIG as chartConfig, bc.GROUP_BY as groupBy, bc_charts_option as chartOption, " +
|
|
|
+ " bc.ACCESS_AUTHORITY as accessAuthority, UPDATE_AUTHORITY as updateAuthority, CHART_DESCRIBES as describes, BC_CHART_STYLE as style, BC_FILTERS as filters " +
|
|
|
+ " ,bc.create_id as createId, bd.DATA_NAME as dataName from bi_charts bc left join BI_DATA_CONNECTORS bd on bc.BD_DATA_ID = bd.id" +
|
|
|
+ " where bc.id = #{id}")
|
|
|
ChartConfig getOneChart(int id);
|
|
|
|
|
|
/*
|
|
|
@@ -88,8 +91,9 @@ public interface ChartsConfigMapper {
|
|
|
" or bo2.bo_type = '1' and bo2.bo_ob_id = bc.CREATE_ID" +
|
|
|
" )" +
|
|
|
" ) = 0 then '0'" +
|
|
|
- " else null end authority, id as chartId, chart_name as chartName, chart_type as chartType, bc.create_by as createBy, bc.create_date as createDate" +
|
|
|
- " ,bc_filters as filters, CHART_DESCRIBES as describes, bc_charts_group as chartsGroup, bc_charts_option as chartOption, create_id as createId from bi_charts bc where create_id = #{id} or ( create_id !=#{id} and id in (" +
|
|
|
+ " else null end authority, bc.id as chartId, bc.chart_name as chartName, bc.chart_type as chartType, bc.create_by as createBy, bc.create_date as createDate, BC_FILTERS as filters" +
|
|
|
+ " ,bc.bc_filters as filters, bc.CHART_DESCRIBES as describes, bc.bc_charts_group as chartsGroup, bc.bc_charts_option as chartOption ,bc.bd_data_id as dataId,bd.data_name as dataName, bc.create_id as createId " +
|
|
|
+ " from bi_charts bc left join bi_data_connectors bd on bc.bd_data_id=bd.id where (bc.create_id = #{id} or bc.id in (" +
|
|
|
" select bc_chart_id from bi_chart_strategys where BC_ID in (" +
|
|
|
" select BO_ST_ID from BI_CHART_OBJECT where (BO_TYPE='1' and BO_OB_ID = #{id})" +
|
|
|
" or (" +
|
|
|
@@ -141,6 +145,7 @@ public interface ChartsConfigMapper {
|
|
|
"<if test=\"style != null\"> , BC_CHART_STYLE = #{style} </if>" +
|
|
|
"<if test=\"chartsGroup !=null\">, BC_CHARTS_GROUP = #{chartsGroup}</if>"+
|
|
|
"<if test=\"chartOption !=null\">, bc_charts_option = #{chartOption}</if>"+
|
|
|
+ "<if test=\"fetchConfig !=null\">, BC_FETCHCONFIG = #{fetchConfig}</if>"+
|
|
|
"<if test=\"updateDate != null\"> , UPDATE_DATE = to_date(#{updateDate},'YYYY-MM-DD hh24:mi:ss') </if>" +
|
|
|
"where id = #{chartId}" +
|
|
|
"</script>")
|
|
|
@@ -270,4 +275,16 @@ public interface ChartsConfigMapper {
|
|
|
@Select("${sql}")
|
|
|
List<Map<String, Object>> getChartsData(@Param("sql") String sql);
|
|
|
|
|
|
+ /*
|
|
|
+ 通过图表ID获取图表配置
|
|
|
+ */
|
|
|
+ @Select("select id, chart_type as chartType, BC_FETCHCONFIG as fetchConfig from bi_charts where id = #{id}")
|
|
|
+ ChartsConfigToDash getChartConfigToDash(int id);
|
|
|
+
|
|
|
+ /*
|
|
|
+ 通过图表ID查询图表列配置和style
|
|
|
+ */
|
|
|
+ @Select("select chart_config as chartConfig, BC_CHART_STYLE as chartStyle from bi_charts where id = #{id}")
|
|
|
+ ChartsColumnConfig getChartsColumn(int id);
|
|
|
+
|
|
|
}
|