From 20956b0f05f81ca47cf6c3e8f9b3b426e9cfd035 Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期日, 24 九月 2023 21:54:01 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 inspect-server/src/main/resources/mapper/RawInspectMapper.xml |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/inspect-server/src/main/resources/mapper/RawInspectMapper.xml b/inspect-server/src/main/resources/mapper/RawInspectMapper.xml
index eae9690..62f7235 100644
--- a/inspect-server/src/main/resources/mapper/RawInspectMapper.xml
+++ b/inspect-server/src/main/resources/mapper/RawInspectMapper.xml
@@ -56,14 +56,15 @@
         <if test="name!=null and name!=''">
             and name like concat('%',#{name},'%')
         </if>
+        ORDER BY id DESC
     </select>
 
     <!--鏍规嵁鍘熸潗鏂欐楠屽崟id鏌ョ湅璇︽儏-->
     <resultMap id="oneMap" type="map">
-        <id property="rcode" column="rcode"/>
+        <id property="code" column="rcode"/>
         <result property="formTime" column="formTime"/>
         <result property="creatTime" column="creatTime"/>
-        <result property="rname" column="rname"/>
+        <result property="name" column="rname"/>
         <result property="specifications" column="specifications"/>
         <result property="runit" column="runit"/>
         <result property="number" column="number"/>
@@ -72,7 +73,7 @@
         <result property="userName" column="user_name"/>
         <collection property="children" resultMap="twoMap" javaType="List"/>
     </resultMap>
-    <resultMap id="twoMap" type="map">
+    <resultMap id="twoMap" type="Map">
         <id property="rpId" column="rpId"/>
         <result property="rpName" column="rpName"/>
         <result property="rpUnit" column="rpUnit"/>
@@ -80,7 +81,8 @@
         <result property="internal" column="internal"/>
         <result property="testValue" column="test_value"/>
         <result property="testState" column="test_state"/>
-        <result property="devName" column="devName"/>
+        <result property="deviceName" column="devName"/>
+        <result property="deviceId" column="deviceId"/>
         <result property="uName" column="uName"/>
     </resultMap>
 
@@ -103,6 +105,7 @@
                test_value,
                test_state,
                device.name                            devName,
+               device.`id`                            deviceId,
                user.name                              uName
         from mom_ocean.raw_ins_product rp
                  left join mom_ocean.raw_inspect r on rp.raw_inspect_id = r.id
@@ -113,4 +116,14 @@
           and rp.state = 1
           and r.id = #{id}
     </select>
+
+    <!--鏍规嵁鍘熸潗鏂欑紪鐮佹煡璇㈡渶杩戜竴鏉℃暟鎹�-->
+    <select id="selOneByCode" resultType="com.yuanchu.mom.pojo.RawInspect">
+        select *
+        from mom_ocean.raw_inspect
+        where state = 1
+          and code = #{code}
+        order by id desc
+        limit 1
+    </select>
 </mapper>

--
Gitblit v1.9.3