lvzhikai 4 vuotta sitten
vanhempi
commit
742ac6d2d6

+ 18 - 4
src/main/java/com/chinaitop/depot/storage/mapper/StorageQualitycheckMapper.xml

@@ -2323,7 +2323,24 @@
2323 2323
     LEFT JOIN basic_enum xz ON xz.enumId = sqk.quality
2324 2324
     LEFT JOIN basic_enum cd ON cd.enumId = sqk.location
2325 2325
     <where>
2326
-      sqk.history_status != '2' AND sqk.type = '3'
2326
+      sqk.history_status != '2' AND sqk.type = '3' and sqk.id = (
2327
+      select max(id) from storage_qualitycheck where 1=1
2328
+        <if test="orgId != null" >
2329
+          and org_id = #{orgId,jdbcType=INTEGER}
2330
+        </if>
2331
+        <if test="houseId !=null">
2332
+          and house_id = #{houseId}
2333
+        </if>
2334
+        <if test="warehouseId !=null">
2335
+          and warehouse_id = #{warehouseId}
2336
+        </if>
2337
+        <if test="tankId != null" >
2338
+          and tank_id = #{tankId,jdbcType=VARCHAR}
2339
+        </if>
2340
+        <if test="subType != null" >
2341
+          and sub_type = #{subType,jdbcType=INTEGER}
2342
+        </if>
2343
+      )
2327 2344
       <if test="orgId != null" >
2328 2345
         and sqk.org_id = #{orgId,jdbcType=INTEGER}
2329 2346
       </if>
@@ -2339,9 +2356,6 @@
2339 2356
       <if test="subType != null" >
2340 2357
         and sqk.sub_type = #{subType,jdbcType=INTEGER}
2341 2358
       </if>
2342
-      <if test="type !=null">
2343
-        and sqk.type = #{type}
2344
-      </if>
2345 2359
     </where>
2346 2360
   </select>
2347 2361
 </mapper>