hanqingsong 1 год назад
Родитель
Сommit
3eb6727ca8

+ 2 - 2
src/main/java/com/chinaitop/depot/grainSituationCard/controller/StorageSealedConfirmationController.java

@@ -105,8 +105,8 @@ public class StorageSealedConfirmationController {
105 105
      * @param warehouseId 必传
106 106
      * @return 储备信息为空表示非储备粮
107 107
      */
108
-    @RequestMapping(value = "/checkGrainAttribute/{orgId}/{houseId}/{warehouseId}", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
109
-    public ResponseEntity checkGrainAttribute(@PathVariable("orgId") Integer orgId, @PathVariable("houseId") Integer houseId, @PathVariable("warehouseId") Integer warehouseId) {
108
+    @RequestMapping(value = "/checkGrainAttribute/{orgId}/{houseId}", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
109
+    public ResponseEntity checkGrainAttribute(@PathVariable("orgId") Integer orgId, @PathVariable("houseId") Integer houseId, Integer warehouseId) {
110 110
         return ResponseEntity.ok(confirmationService.checkGrainAttribute(orgId, houseId, warehouseId));
111 111
     }
112 112
 

+ 16 - 11
src/main/java/com/chinaitop/depot/grainSituationCard/mapper/StorageSealedConfirmationMapper.xml

@@ -417,18 +417,23 @@
417 417
         harvest_time harvestYear
418 418
     from
419 419
         storage_qualitycheck
420
-    where
421
-        org_id = #{orgId}
422
-        and house_id = #{houseId}
420
+    <where>
421
+      history_status = 0
422
+      and type_update = '0'
423
+      and org_id = #{orgId}
424
+      and house_id = #{houseId}
425
+      <if test="warehouseId != null and warehouseId != ''">
423 426
         and warehouse_id = #{warehouseId}
424
-        and quality in(
425
-            6864,
426
-            6865,
427
-            6877,
428
-            6878,
429
-            6879,
430
-            6866
431
-        )
427
+      </if>
428
+      and quality in(
429
+              6864,
430
+              6865,
431
+              6877,
432
+              6878,
433
+              6879,
434
+              6866
435
+            )
436
+    </where>
432 437
     order by id desc limit 0,1
433 438
   </select>
434 439
   <select id="checkNoticeReceive" parameterType="integer" resultType="integer">