瀏覽代碼

修改首页统计图接口

zhoupeng 1 年之前
父節點
當前提交
b5d50dbc77

+ 0 - 1
chaunyi_opc/opc_common/src/main/java/com/example/opc_common/entity/Chart.java

@@ -64,5 +64,4 @@ public class Chart implements Serializable {
      * 用户组id集合
      */
     private List<UserGroup> userGroupList = new ArrayList<>();
-    ;
 }

+ 2 - 0
chaunyi_opc/opc_common/src/main/java/com/example/opc_common/entity/ChartItem.java

@@ -18,6 +18,8 @@ public class ChartItem implements Serializable {
      * 统计图id
      */
     private Integer chartId;
+    //虚拟字段
+    private Integer itemGroupId;
     /**
      * 数据项id
      */

+ 7 - 4
chaunyi_opc/opc_da/src/main/resources/mapper/ChartDao.xml

@@ -91,10 +91,13 @@
     </select>
 
     <select id="getChartItemList" resultType="com.example.opc_common.entity.ChartItem">
-        select
-        <include refid="chartItem"/>
-        from t_chart_item
-        where chart_id = #{chartId}
+        select tci.id
+             , tci.chart_id
+             , tci.item_id
+             , ti.item_group_id
+        from t_chart_item tci
+                 left join t_item ti on tci.item_id = ti.id
+        where tci.chart_id = #{chartId}
     </select>
 
     <select id="getChartByUserGroupId" resultType="com.example.opc_common.entity.Chart">