From e7f7daae5d21ad2988cadd25b6987ca5e7ef8001 Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期六, 09 九月 2023 09:51:20 +0800
Subject: [PATCH] 修改bug

---
 standard-server/src/main/resources/mapper/ProductModelMapper.xml |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/standard-server/src/main/resources/mapper/ProductModelMapper.xml b/standard-server/src/main/resources/mapper/ProductModelMapper.xml
index 72ad32f..aaa8c13 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="name" 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">
@@ -28,8 +37,7 @@
     <select id="selectfather" resultType="java.lang.String">
         SELECT DISTINCT father
         FROM lims_laboratory.product_model
-        WHERE father IS NOT NULL
-          AND father != ''
+        WHERE state = 1
     </select>
 
     <!--鏌ヨ椤圭洰妯$増鏍规嵁鏍峰搧鍚�-->
@@ -39,6 +47,13 @@
                unit
         from lims_laboratory.product_model
         where state = 1
-          and material =#{name}
+          and material = #{name}
+    </select>
+
+    <!--娣诲姞鏍囧噯閫夋嫨鏍峰搧鍚嶇О-->
+    <select id="selectmater" resultType="java.lang.String">
+        select DISTINCT material
+        from lims_laboratory.product_model
+        where state = 1
     </select>
 </mapper>

--
Gitblit v1.9.3