chenw 7 лет назад
Родитель
Сommit
70e2eab8c7

+ 1 - 1
bi-server/src/main/java/com/usoftchina/bi/server/dao/dashboard/DashBoardMenuMapper.java

@@ -67,7 +67,7 @@ public interface DashBoardMenuMapper {
      * @param id
      * @return
      */
-    @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 BD_MENUID = #{id,jdbcType=INTEGER}")
+    @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 as bdCode,BD_MENUID as menuId  FROM BI_DASHBOARDS WHERE BD_MENUID = #{id,jdbcType=INTEGER}")
     List<Dashboards> getDashBoardByMenuId(int id);
 
 }

+ 7 - 6
bi-server/src/main/java/com/usoftchina/bi/server/dao/dashboard/DashboardsMapper.java

@@ -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, bd_code)" +
+            "bi_dashboards(id, bd_name,bd_note,CONFIGURATION,create_by, filters, create_date, BD_THUMBNAIL,relation_columns, create_id, bd_code,bd_menuId)" +
             "values(#{id,jdbcType=INTEGER}, #{bdName,jdbcType=VARCHAR},#{bdNote,jdbcType=VARCHAR},#{bdConfiguration,jdbcType=VARCHAR},#{createBy,jdbcType=VARCHAR}, #{filters,jdbcType=VARCHAR}, " +
-            "to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'), #{thumbnail,jdbcType=VARCHAR},#{relationColumns,jdbcType=VARCHAR}, #{createId,jdbcType=INTEGER}, #{bdCode,jdbcType=VARCHAR})")
+            "to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'), #{thumbnail,jdbcType=VARCHAR},#{relationColumns,jdbcType=VARCHAR}, #{createId,jdbcType=INTEGER}, #{bdCode,jdbcType=VARCHAR}, #{menuId, jdbcType=INTEGER})")
     @SelectKey(before=true,keyProperty="id",resultType=Integer.class,statement="SELECT BI_DASHBOARDS_SEQUENCE.nextval from dual",keyColumn = "id")
     void setDashboards(Dashboards dashboards);
 
@@ -83,7 +83,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, bd_code  " +
+    @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,bd_menuId  " +
             "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})) " +
@@ -94,7 +94,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, bd_code " +
+    @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,bd_menuId " +
             " 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}))" +
@@ -112,11 +112,12 @@ public interface DashboardsMapper {
             @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 = "bd_code", property = "bdCode", jdbcType = JdbcType.VARCHAR)
+            @Result(column = "bd_code", property = "bdCode", jdbcType = JdbcType.VARCHAR),
+            @Result(column = "bd_menuId", property = "menuId", jdbcType = JdbcType.VARCHAR)
     })
     Dashboards getDashboards(@Param("userId") int userId, @Param("id") int id);
 
-    @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 BD_CODE = #{code}")
+    @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,bd_menuId FROM BI_DASHBOARDS WHERE BD_CODE = #{code}")
     @ResultMap("DashBoardsResultMap")
     Dashboards getDashboardByCode(String code);
 

+ 9 - 0
bi-server/src/main/java/com/usoftchina/bi/server/model/po/Dashboards.java

@@ -21,6 +21,15 @@ public class Dashboards {
     private String chartIds;
     private String bdCode;
     private boolean demo;
+    private int menuId;
+
+    public int getMenuId() {
+        return menuId;
+    }
+
+    public void setMenuId(int menuId) {
+        this.menuId = menuId;
+    }
 
     public String getBdCode() {
         return bdCode;

+ 9 - 0
bi-server/src/main/java/com/usoftchina/bi/server/model/vo/configVo/DashboardsInfo.java

@@ -12,6 +12,15 @@ public class DashboardsInfo {
     private String filters;
     private String chartIds;
     private String bdCode;
+    private int menu;
+
+    public int getMenu() {
+        return menu;
+    }
+
+    public void setMenu(int menu) {
+        this.menu = menu;
+    }
 
     public String getBdCode() {
         return bdCode;