|
|
@@ -22,29 +22,29 @@
|
|
22
|
22
|
id, check_time, check_list, choose, check_describe, check_person, record_status, anomalous_status, uid, houseId, depotId
|
|
23
|
23
|
</sql>
|
|
24
|
24
|
|
|
25
|
|
-
|
|
26
|
25
|
<select id="getByCheckPersonAndCheckTime" resultType="com.unissoft.model.GrainConditionRecord">
|
|
27
|
|
- SELECT
|
|
28
|
|
- gcr.id id,
|
|
|
26
|
+ SELECT
|
|
|
27
|
+ gcr.id id,
|
|
29
|
28
|
gcr.check_person checkPerson,
|
|
30
|
29
|
gcr.check_time checkTime,
|
|
31
|
30
|
gcr.check_describe checkDescribe,
|
|
32
|
31
|
gcr.house_id houseId,
|
|
33
|
32
|
gcr.depot_id depotId,
|
|
34
|
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
|
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
|
46
|
ORDER BY
|
|
47
|
|
- gcr.check_person
|
|
|
47
|
+ gcr.id
|
|
48
|
48
|
</select>
|
|
49
|
49
|
|
|
50
|
50
|
<!-- <select id="getByPersonAndTime" resultType="com.unissoft.model.GrainConditionRecord">
|