From 6d7b4c2e4c0a1dd15afb71b11c8f3c19ef7c946c Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期六, 19 八月 2023 16:06:52 +0800
Subject: [PATCH] 优化

---
 standard-server/src/main/resources/mapper/ProductModelMapper.xml |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/standard-server/src/main/resources/mapper/ProductModelMapper.xml b/standard-server/src/main/resources/mapper/ProductModelMapper.xml
index bc6f8cd..6af2685 100644
--- a/standard-server/src/main/resources/mapper/ProductModelMapper.xml
+++ b/standard-server/src/main/resources/mapper/ProductModelMapper.xml
@@ -1,8 +1,18 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="com.yuanchu.limslaboratory.mapper.ProductModelMapper">
+    <resultMap id="selectproductModelMap" type="map">
+        <id property="father" column="father"/>
+        <collection property="children" resultMap="selectproductModelTowMap" javaType="List"/>
+    </resultMap>
+
+    <resultMap id="selectproductModelTowMap" type="map">
+        <id property="id" column="id"/>
+        <result property="name" column="name"/>
+        <result property="unit" column="unit"/>
+    </resultMap>
     <!--鏌ヨ鏍囧噯妯$増鍒楄〃-->
-    <select id="selectproductModel" resultType="java.util.Map">
+    <select id="selectproductModel" resultMap="selectproductModelMap">
         select id,
         father,
         name,
@@ -16,7 +26,6 @@
         <if test="father!=null and father!=''">
             and father like concat('%',#{father},'%')
         </if>
-        order by father
     </select>
 
     <update id="delAllproductModel">

--
Gitblit v1.9.3