|
|
@@ -18,9 +18,9 @@ public interface DashboardsMapper {
|
|
|
插入
|
|
|
*/
|
|
|
@Insert("insert into " +
|
|
|
- "bi_dashboards(id, bd_name,bd_note,CONFIGURATION,create_by, filters, create_date, BD_THUMBNAIL,relation_columns, create_id)" +
|
|
|
+ "bi_dashboards(id, bd_name,bd_note,CONFIGURATION,create_by, filters, create_date, BD_THUMBNAIL,relation_columns, create_id, bd_code)" +
|
|
|
"values(#{id}, #{bdName},#{bdNote},#{bdConfiguration},#{createBy}, #{filters}, " +
|
|
|
- "to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'), #{thumbnail},#{relationColumns}, #{createId})")
|
|
|
+ "to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'), #{thumbnail},#{relationColumns}, #{createId}, #{bdCode)")
|
|
|
@SelectKey(before=true,keyProperty="id",resultType=Integer.class,statement="SELECT BI_DASHBOARDS_SEQUENCE.nextval from dual",keyColumn = "id")
|
|
|
void setDashboards(Dashboards dashboards);
|
|
|
|
|
|
@@ -30,9 +30,9 @@ public interface DashboardsMapper {
|
|
|
* @param array
|
|
|
*/
|
|
|
@Insert("<script>"
|
|
|
- + "INSERT INTO BI_DASHBOARDS_CHART(DASHBOARD_ID, CHART_ID) VALUES"
|
|
|
- + "<foreach collection=\"array\" item=\"chartId\" open=\"\" close=\"\" separator=\",\">"
|
|
|
- + "(#{id, jdbcType=INTEGER}, #{chartId, jdbcType=INTEGER})"
|
|
|
+ + "INSERT INTO BI_DASHBOARDS_CHART(DASHBOARD_ID, CHART_ID) "
|
|
|
+ + "<foreach collection=\"array\" item=\"chartId\" open=\"\" close=\"\" separator=\"UNION ALL\">"
|
|
|
+ + "SELECT #{id}, #{chartId} FROM DUAL"
|
|
|
+ "</foreach>"
|
|
|
+ "</script>")
|
|
|
void saveDashboardChartRelation(@Param("id") int id, @Param("array") String[] array);
|
|
|
@@ -55,11 +55,25 @@ public interface DashboardsMapper {
|
|
|
"<if test=\"thumbnail != null\"> , BD_THUMBNAIL = #{thumbnail} </if>" +
|
|
|
"<if test=\"relationColumns != null\">, relation_columns = #{relationColumns} </if>"+
|
|
|
"<if test=\"filters != null\">, filters = #{filters} </if>"+
|
|
|
+ "<if test=\"bdCode != null\">, BD_CODE = #{bdCode} </if>"+
|
|
|
" ,UPDATE_DATE = to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss') " +
|
|
|
"where id = #{id}" +
|
|
|
"</script>")
|
|
|
void updateDashboards(Dashboards dashboards);
|
|
|
|
|
|
+ @Select("<script>"
|
|
|
+ + "SELECT COUNT(*) FROM BI_DASHBOARDS "
|
|
|
+ + "<where>"
|
|
|
+ + "<if test=\"id != 0\">"
|
|
|
+ + "id != #{id}"
|
|
|
+ + "</if>"
|
|
|
+ + "<if test=\"code != null\">"
|
|
|
+ + " and bd_code = #{code}"
|
|
|
+ + "</if>"
|
|
|
+ + "</where>"
|
|
|
+ + "</script>")
|
|
|
+ int countBdCodeById(@Param("code") String code, @Param("id") int id);
|
|
|
+
|
|
|
/*
|
|
|
删除看板
|
|
|
*/
|
|
|
@@ -76,7 +90,7 @@ public interface DashboardsMapper {
|
|
|
/*
|
|
|
查询看板列表
|
|
|
*/
|
|
|
- @Select("select id, bd_note as bdNote, bd_name as bdName, CONFIGURATION as bdConfiguration, CREATE_BY as createBy, create_id as createId, CREATE_DATE as createDate, BD_THUMBNAIL as thumbnail, filters, demo " +
|
|
|
+ @Select("select id, bd_note as bdNote, bd_name as bdName, CONFIGURATION as bdConfiguration, CREATE_BY as createBy, create_id as createId, CREATE_DATE as createDate, BD_THUMBNAIL as thumbnail, filters, demo, bd_code " +
|
|
|
"from BI_DASHBOARDS where id in " +
|
|
|
" (select bo_da_id from bi_DASHBOARDS_object " +
|
|
|
"where (bo_type = '0' and bo_ob_id in (select br_user_group from bi_user_rel_groups where br_user_id= #{userId})) " +
|
|
|
@@ -87,7 +101,7 @@ public interface DashboardsMapper {
|
|
|
/*
|
|
|
查询看板
|
|
|
*/
|
|
|
- @Select("select id, bd_note as bdNote, bd_name as bdName, CONFIGURATION as bdConfiguration, CREATE_BY as createBy, create_id as createId, CREATE_DATE as createDate, BD_THUMBNAIL as thumbnail, relation_columns as relationColumns, filters, demo " +
|
|
|
+ @Select("select id, bd_note as bdNote, bd_name as bdName, CONFIGURATION as bdConfiguration, CREATE_BY as createBy, create_id as createId, CREATE_DATE as createDate, BD_THUMBNAIL as thumbnail, relation_columns as relationColumns, filters, demo, bd_code " +
|
|
|
" from BI_DASHBOARDS where (id in " +
|
|
|
" (select bo_da_id from bi_DASHBOARDS_object " +
|
|
|
" where (bo_type = '0' and bo_ob_id in (select br_user_group from bi_user_rel_groups where br_user_id= #{userId}))" +
|
|
|
@@ -104,10 +118,14 @@ public interface DashboardsMapper {
|
|
|
@Result(column = "relationColumns", property = "relationColumns", jdbcType = JdbcType.VARCHAR),
|
|
|
@Result(column = "filters", property = "filters", jdbcType = JdbcType.VARCHAR),
|
|
|
@Result(column = "demo", property = "demo", jdbcType = JdbcType.BOOLEAN),
|
|
|
- @Result(column = "id", property = "chartIds", one = @One(select = "getChartIdsById"))
|
|
|
+ @Result(column = "id", property = "chartIds", one = @One(select = "getChartIdsById")),
|
|
|
+ @Result(column = "bd_code", property = "bdCode", jdbcType = JdbcType.VARCHAR)
|
|
|
})
|
|
|
Dashboards getDashboards(@Param("userId") int userId, @Param("id") int id);
|
|
|
|
|
|
+ @Select("SELECT ID FROM BI_DASHBOARDS WHERE BD_CODE = #{code}")
|
|
|
+ int getIdByCode(String code);
|
|
|
+
|
|
|
/*
|
|
|
看板移交
|
|
|
*/
|