|
|
@@ -4,6 +4,7 @@ import com.usoftchina.bi.server.model.bo.DashOrder;
|
|
|
import com.usoftchina.bi.server.model.po.Dashboards;
|
|
|
import com.usoftchina.bi.core.base.TestPage;
|
|
|
import org.apache.ibatis.annotations.*;
|
|
|
+import org.apache.ibatis.type.JdbcType;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -23,6 +24,26 @@ public interface DashboardsMapper {
|
|
|
@SelectKey(before=true,keyProperty="id",resultType=Integer.class,statement="SELECT BI_DASHBOARDS_SEQUENCE.nextval from dual",keyColumn = "id")
|
|
|
void setDashboards(Dashboards dashboards);
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存报表-图表关系
|
|
|
+ * @param id
|
|
|
+ * @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})"
|
|
|
+ + "</foreach>"
|
|
|
+ + "</script>")
|
|
|
+ void saveDashboardChartRelation(@Param("id") int id, @Param("array") String[] array);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除报表图表关系
|
|
|
+ * @param id
|
|
|
+ */
|
|
|
+ @Delete("DELETE FROM BI_DASHBOARDS_CHART WHERE DASHBOARD_ID = #{id}")
|
|
|
+ void deleteDashboardChartRelation(int id);
|
|
|
+
|
|
|
/*
|
|
|
更新
|
|
|
*/
|
|
|
@@ -60,6 +81,7 @@ public interface DashboardsMapper {
|
|
|
" (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})) " +
|
|
|
" or (BO_TYPE='1' and bo_ob_id = #{userId} )) or create_id = #{userId}")
|
|
|
+ @ResultMap("DashBoardsResultMap")
|
|
|
List<Dashboards> getListDashboards(@Param("userId") int userId, TestPage testPage);
|
|
|
|
|
|
/*
|
|
|
@@ -70,6 +92,20 @@ public interface DashboardsMapper {
|
|
|
" (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}))" +
|
|
|
" or (BO_TYPE='1' and bo_ob_id = #{userId} )) or create_id = #{userId}) and id = #{id}")
|
|
|
+ @Results(id = "DashBoardsResultMap", value = {
|
|
|
+ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER),
|
|
|
+ @Result(column = "bdName", property = "bdName", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "bdNote", property = "bdNote", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "bdConfiguration", property = "bdConfiguration", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "createBy", property = "createBy", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "createId", property = "createId", jdbcType = JdbcType.INTEGER),
|
|
|
+ @Result(column = "createDate", property = "createDate", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "thumbnail", property = "thumbnail", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @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"))
|
|
|
+ })
|
|
|
Dashboards getDashboards(@Param("userId") int userId, @Param("id") int id);
|
|
|
|
|
|
/*
|
|
|
@@ -115,4 +151,12 @@ public interface DashboardsMapper {
|
|
|
*/
|
|
|
@Select("select create_id from bi_dashboards where id = #{id}")
|
|
|
int getCreateIdById(int id);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取看板下所有的图表ID
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Select("select wm_concat(chart_id) from bi_dashboards_chart where dashboard_id = #{id}")
|
|
|
+ String getChartIdsById(int id);
|
|
|
}
|