From f2596378e9bbb40d59a1be77da530d879ce84230 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期一, 02 十二月 2024 16:03:34 +0800
Subject: [PATCH] CumulateHandle

---
 iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmPredictItemDao.xml |  135 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 101 insertions(+), 34 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmPredictItemDao.xml b/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmPredictItemDao.xml
index ecf1ecb..363f3e6 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmPredictItemDao.xml
+++ b/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmPredictItemDao.xml
@@ -14,6 +14,7 @@
         <result property="isFuse" column="ISFUSE"/>
         <result property="predictPhase" column="PREDICTPHASE"/>
         <result property="workChecked" column="WORKCHECKED"/>
+        <result property="lastTime" column="last_time"/>
     </resultMap>
 
     <resultMap id="MergeItemVO" type="com.iailab.module.model.mdk.vo.MergeItemVO">
@@ -22,46 +23,109 @@
         <result property="expression" column="EXPRESSION"/>
     </resultMap>
 
-    <select id="queryList" resultType="com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO" parameterType="map">
+    <select id="getPageList" resultType="com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO"
+            parameterType="map">
         SELECT
         TMPI.ID,
         TMPI.ITEMNO,
         TMPI.ITEMNAME,
         TMPI.ITEMTYPEID,
         TMIT.ITEMTYPENAME,
+        TMPI.PREDICTLENGTH,
         TMPI.GRANULARITY,
         TMPI.ISFUSE,
         TMPI.WORKCHECKED,
         TDMI.MODULEID,
         TDMI.ITEMORDER,
-        TDMI.STATUS,
+        TMPI.STATUS,
         TDMI.CATEGORYID,
-        TMIO.POINTID,
-        TMIO.TAGNAME,
-        TMIO.RESULTTABLEID,
-        TMRT.TABLENAME
+        TMIS.last_time,
+        TMIS.status run_status,
+        TMIS.duration
         FROM T_MM_PREDICT_ITEM TMPI
         LEFT JOIN T_MM_ITEM_TYPE TMIT ON TMIT.ID = TMPI.ITEMTYPEID
         LEFT JOIN T_DM_MODULE_ITEM TDMI ON TDMI.ITEMID = TMPI.ID
-        LEFT JOIN T_MM_ITEM_OUTPUT TMIO ON TMIO.ITEMID = TMPI.ID
-        LEFT JOIN T_MM_RESULT_TABLE TMRT ON TMRT.ID = TMIO.RESULTTABLEID
-        WHERE 1 = 1
-        <if test="params.itemno != null and params.itemno != ''">
-            AND TMPI.ITEMNO LIKE CONCAT('%', #{params.itemno},'%')
-        </if>
-        <if test="params.itemname != null and params.itemname != ''">
-            AND TMPI.ITEMNAME LIKE CONCAT('%', #{params.itemname},'%')
-        </if>
-        <if test="params.itemtypeid != null and params.itemtypeid != ''">
-            AND TMPI.ITEMTYPEID = #{params.itemtypeid}
-        </if>
-        <if test="params.itemtypename != null and params.itemtypename != ''">
-            AND TMIT.ITEMTYPENAME = #{params.itemtypename}
-        </if>
-        <if test="params.status != null and params.status != ''">
-            AND TDMI.STATUS = #{params.status}
-        </if>
+        LEFT JOIN t_mm_item_status TMIS ON TMIS.item_id = TMPI.ID
+        <where>
+            <if test="params.itemno != null and params.itemno != ''">
+                AND TMPI.ITEMNO LIKE CONCAT('%', #{params.itemno},'%')
+            </if>
+            <if test="params.itemname != null and params.itemname != ''">
+                AND TMPI.ITEMNAME LIKE CONCAT('%', #{params.itemname},'%')
+            </if>
+            <if test="params.itemtypeid != null and params.itemtypeid != ''">
+                AND TMPI.ITEMTYPEID = #{params.itemtypeid}
+            </if>
+            <if test="params.itemtypename != null and params.itemtypename != ''">
+                AND TMIT.ITEMTYPENAME = #{params.itemtypename}
+            </if>
+            <if test="params.status != null and params.status != ''">
+                AND TMPI.STATUS = #{params.status}
+            </if>
+        </where>
         ORDER BY TMPI.CREATE_TIME DESC
+    </select>
+
+    <resultMap id="MmPredictItemRespVO" type="com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO">
+        <result property="id" column="ID"/>
+        <result property="itemno" column="ITEMNO"/>
+        <result property="itemname" column="ITEMNAME"/>
+        <result property="itemtypeid" column="ITEMTYPEID"/>
+        <result property="itemtypename" column="ITEMTYPENAME"/>
+        <result property="predictlength" column="predictlength"/>
+        <result property="granularity" column="GRANULARITY"/>
+        <result property="isfuse" column="ISFUSE"/>
+        <result property="workchecked" column="WORKCHECKED"/>
+        <result property="moduleid" column="MODULEID"/>
+        <result property="itemorder" column="ITEMORDER"/>
+        <result property="status" column="STATUS"/>
+        <result property="categoryid" column="CATEGORYID"/>
+        <collection property="outPuts" ofType="com.iailab.module.model.mcs.pre.vo.MmItemOutputRespVO">
+            <result property="id" column="out_put_id"/>
+            <result property="outputorder" column="out_put_order"/>
+            <result property="resultName" column="result_name"/>
+        </collection>
+    </resultMap>
+
+    <select id="queryList" resultMap="MmPredictItemRespVO" parameterType="map">
+        SELECT
+        TMPI.ID,
+        TMPI.ITEMNO,
+        TMPI.ITEMNAME,
+        TMPI.ITEMTYPEID,
+        TMIT.ITEMTYPENAME,
+        TMPI.predictlength,
+        TMPI.GRANULARITY,
+        TMPI.ISFUSE,
+        TMPI.WORKCHECKED,
+        TDMI.MODULEID,
+        TDMI.ITEMORDER,
+        TMPI.STATUS,
+        TDMI.CATEGORYID,
+        TMIO.id out_put_id,
+        TMIO.outputorder out_put_order,
+        TMIO.result_name
+        FROM T_MM_PREDICT_ITEM TMPI
+        LEFT JOIN T_MM_ITEM_TYPE TMIT ON TMIT.ID = TMPI.ITEMTYPEID
+        LEFT JOIN T_DM_MODULE_ITEM TDMI ON TDMI.ITEMID = TMPI.ID
+        LEFT JOIN t_mm_item_output TMIO ON TMIO.itemid = TMPI.ID
+        WHERE 1 = 1
+        <if test="itemno != null and itemno != ''">
+            AND TMPI.ITEMNO LIKE CONCAT('%', #{itemno},'%')
+        </if>
+        <if test="itemname != null and itemname != ''">
+            AND TMPI.ITEMNAME LIKE CONCAT('%', #{itemname},'%')
+        </if>
+        <if test="itemtypeid != null and itemtypeid != ''">
+            AND TMPI.ITEMTYPEID = #{itemtypeid}
+        </if>
+        <if test="itemtypename != null and itemtypename != ''">
+            AND TMIT.ITEMTYPENAME = #{itemtypename}
+        </if>
+        <if test="status != null and status != ''">
+            AND TMPI.STATUS = #{status}
+        </if>
+        ORDER BY TMPI.CREATE_TIME DESC,TMIO.outputorder
     </select>
 
     <select id="getByModuleId" parameterType="map" resultMap="ItemVO">
@@ -97,17 +161,20 @@
         t1.status,
         t1.isfuse,
         t1.predictphase,
-        t1.workchecked
+        t1.workchecked,
+        t3.last_time
         FROM
-        ${TABLESCHEMA}.t_mm_predict_item t1,
-        ${TABLESCHEMA}.t_mm_item_type t2
-        WHERE t1.itemtypeid=t2.id
-        <if test="ITEMID != null and ITEMID != ''">
-            AND t1.id=#{ITEMID}
-        </if>
-        <if test="ITEMNO != null and ITEMNO != ''">
-            t1.itemno=#{ITEMNO}
-        </if>
+        t_mm_predict_item t1
+        LEFT JOIN t_mm_item_type t2 on t2.id = t1.itemtypeid
+        LEFT JOIN t_mm_item_status t3 on t3.item_id = t1.id
+        <where>
+            <if test="ITEMID != null and ITEMID != ''">
+                AND t1.id=#{ITEMID}
+            </if>
+            <if test="ITEMNO != null and ITEMNO != ''">
+                t1.itemno=#{ITEMNO}
+            </if>
+        </where>
     </select>
     <select id="getMergeItemByItemId" parameterType="map" resultMap="MergeItemVO">
         SELECT t1.id,

--
Gitblit v1.9.3