Pārlūkot izejas kodu

Merge branch 'master' of http://101.36.160.140:21044/csc/csc-szls-business

shengyang000 5 gadi atpakaļ
vecāks
revīzija
ec519b21e3

+ 14 - 14
src/main/java/com/unissoft/mapper/GrainConditionRecordMapper.xml

@@ -22,29 +22,29 @@
22
         id, check_time, check_list, choose, check_describe, check_person, record_status, anomalous_status, uid, houseId, depotId
22
         id, check_time, check_list, choose, check_describe, check_person, record_status, anomalous_status, uid, houseId, depotId
23
     </sql>
23
     </sql>
24
 
24
 
25
-
26
     <select id="getByCheckPersonAndCheckTime"  resultType="com.unissoft.model.GrainConditionRecord">
25
     <select id="getByCheckPersonAndCheckTime"  resultType="com.unissoft.model.GrainConditionRecord">
27
-      SELECT
28
-			gcr.id id,
26
+        SELECT
27
+            gcr.id id,
29
             gcr.check_person checkPerson,
28
             gcr.check_person checkPerson,
30
             gcr.check_time checkTime,
29
             gcr.check_time checkTime,
31
             gcr.check_describe checkDescribe,
30
             gcr.check_describe checkDescribe,
32
             gcr.house_id houseId,
31
             gcr.house_id houseId,
33
             gcr.depot_id depotId,
32
             gcr.depot_id depotId,
34
             gcr.record_status recordStatus,
33
             gcr.record_status recordStatus,
35
-			gad.pest_density pestDensity,
36
-			gad.occur_position occurPosition,
37
-			gad.occur_area occurArea,
38
-			gad.pest_type pestType,
39
-			gad.abnormal_Water abnormalWater,
40
-			gad.abnormal_grain abnormalGrain
34
+            gad.pest_density pestDensity,
35
+            gad.occur_position occurPosition,
36
+            gad.occur_area occurArea,
37
+            gad.pest_type pestType,
38
+            gad.abnormal_Water abnormalWater,
39
+            gad.abnormal_grain abnormalGrain
41
         FROM
40
         FROM
42
-            grain_condition_record gcr   left join grain_abnormal_describe gad on gcr.id = gad.grain_record_id
43
-        WHERE
44
-            gcr.id = ( SELECT max( id ) FROM grain_condition_record WHERE check_person = gcr.check_person )
45
-            and house_id = #{houseId} and depot_id = #{depotId}
41
+            grain_condition_record gcr
42
+        LEFT JOIN grain_abnormal_describe gad ON gcr.id = gad.grain_record_id
43
+        WHERE gcr.house_id = #{houseId}
44
+        AND gcr.depot_id = #{depotId}
45
+        GROUP BY gcr.check_person
46
         ORDER BY
46
         ORDER BY
47
-            gcr.check_person
47
+            gcr.id
48
     </select>
48
     </select>
49
 
49
 
50
   <!--  <select id="getByPersonAndTime"  resultType="com.unissoft.model.GrainConditionRecord">
50
   <!--  <select id="getByPersonAndTime"  resultType="com.unissoft.model.GrainConditionRecord">