From bd90850664bfe4b43df094321e811f3bb398f97f Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期四, 12 十二月 2024 18:01:01 +0800
Subject: [PATCH] resultIndex

---
 iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mpk/MpkFileDao.xml |   75 ++++++++++++++++++++++++++++++++++---
 1 files changed, 69 insertions(+), 6 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mpk/MpkFileDao.xml b/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mpk/MpkFileDao.xml
index 3451506..9a67ab3 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mpk/MpkFileDao.xml
+++ b/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mpk/MpkFileDao.xml
@@ -68,6 +68,7 @@
             LEFT JOIN t_mpk_method_setting c ON b.id = c.method_id
             LEFT JOIN t_mpk_setting_select d ON c.id = d.setting_id
         WHERE a.id = #{id}
+        ORDER BY b.sort,c.sort,d.sort
     </select>
     <select id="selectByIds" resultMap="mpkFile">
         SELECT
@@ -93,10 +94,46 @@
                 LEFT JOIN t_mpk_model_method b ON a.id = b.mpk_file_id
                 LEFT JOIN t_mpk_method_setting c ON b.id = c.method_id
                 LEFT JOIN t_mpk_setting_select d ON c.id = d.setting_id
+                LEFT JOIN t_mpk_file_menu e ON e.name = a.menu_name
+                LEFT JOIN t_mpk_file_group f ON f.menu_id = e.id and f.name = a.group_name
         WHERE a.id in
         <foreach collection="ids" item="item" open="(" close=")" separator=",">
             #{item}
         </foreach>
+        ORDER BY b.sort,c.sort,d.sort,e.sort,f.sort,a.create_date
+    </select>
+    <select id="list" resultMap="mpkFile" parameterType="java.util.Map">
+        SELECT
+        a.*,
+        b.id method_id,
+        b.method_name,
+        b.data_length,
+        b.model,
+        b.result_key,
+        c.id setting_id,
+        c.setting_key,
+        c.name setting_name,
+        c.value,
+        c.type,
+        c.value_type,
+        c.max,
+        c.min,
+        d.id select_id,
+        d.select_key,
+        d.name select_name
+        FROM
+        t_mpk_file a
+        LEFT JOIN t_mpk_model_method b ON a.id = b.mpk_file_id
+        LEFT JOIN t_mpk_method_setting c ON b.id = c.method_id
+        LEFT JOIN t_mpk_setting_select d ON c.id = d.setting_id
+        LEFT JOIN t_mpk_file_menu e ON e.name = a.menu_name
+        LEFT JOIN t_mpk_file_group f ON f.menu_id = e.id and f.name = a.group_name
+        <where>
+            <if test="params.pyType != null and params.pyType != ''">
+                AND a.py_type = #{params.pyType}
+            </if>
+        </where>
+        ORDER BY b.sort,c.sort,d.sort,e.sort,f.sort,a.create_date
     </select>
     <select id="getProjectModelCount" resultType="java.lang.Integer" parameterType="java.lang.String">
         SELECT
@@ -109,6 +146,7 @@
     <select id="getProjectModel" resultMap="mpkFile">
         SELECT
             t3.*,
+            t4.id method_id,
             t4.method_name,
             t4.data_length,
             t4.model,
@@ -127,12 +165,7 @@
         FROM
             (
                 SELECT
-                    t2.id,
-                    t2.py_name,
-                    t2.pkg_name,
-                    t2.py_module,
-                    t2.remark,
-                    t2.create_date
+                    t2.*
                 FROM
                     t_mpk_project_model t1
                         LEFT JOIN t_mpk_file t2 ON t1.model_id = t2.id
@@ -149,4 +182,34 @@
                 LEFT JOIN t_mpk_method_setting t5 ON t4.id = t5.method_id
                 LEFT JOIN t_mpk_setting_select t6 ON t5.id = t6.setting_id
     </select>
+    <select id="selectByProjectId" resultMap="mpkFile" parameterType="java.lang.String">
+        SELECT
+        a.*,
+        b.id method_id,
+        b.method_name,
+        b.data_length,
+        b.model,
+        b.result_key,
+        c.id setting_id,
+        c.setting_key,
+        c.name setting_name,
+        c.value,
+        c.type,
+        c.value_type,
+        c.max,
+        c.min,
+        d.id select_id,
+        d.select_key,
+        d.name select_name
+        FROM
+        t_mpk_file a
+        LEFT JOIN t_mpk_project_model p ON a.id = p.model_id
+        LEFT JOIN t_mpk_model_method b ON a.id = b.mpk_file_id
+        LEFT JOIN t_mpk_method_setting c ON b.id = c.method_id
+        LEFT JOIN t_mpk_setting_select d ON c.id = d.setting_id
+        LEFT JOIN t_mpk_file_menu e ON e.name = a.menu_name
+        LEFT JOIN t_mpk_file_group f ON f.menu_id = e.id and f.name = a.group_name
+        WHERE p.project_id = #{projectId}
+        ORDER BY b.sort,c.sort,d.sort,e.sort,f.sort,a.create_date
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3