|
|
@@ -3,44 +3,60 @@
|
|
3
|
3
|
<mapper namespace="com.ruoyi.web.modules.industryservice.mapper.BizYakAssetMapper">
|
|
4
|
4
|
|
|
5
|
5
|
<resultMap type="com.ruoyi.web.modules.industryservice.domain.BizYakAsset" id="BizYakAssetResult">
|
|
6
|
|
- <id property="id" column="id"/>
|
|
7
|
|
- <result property="externalId" column="external_id"/>
|
|
8
|
|
- <result property="yakNo" column="yak_no"/>
|
|
9
|
|
- <result property="pastureId" column="pasture_id"/>
|
|
10
|
|
- <result property="pastureName" column="pasture_name"/>
|
|
11
|
|
- <result property="batchNo" column="batch_no"/>
|
|
12
|
|
- <result property="gender" column="gender"/>
|
|
13
|
|
- <result property="birthDate" column="birth_date"/>
|
|
14
|
|
- <result property="ageMonths" column="age_months"/>
|
|
15
|
|
- <result property="entryDate" column="entry_date"/>
|
|
16
|
|
- <result property="entryWeightKg" column="entry_weight_kg"/>
|
|
17
|
|
- <result property="source" column="source"/>
|
|
18
|
|
- <result property="breedingMethod" column="breeding_method"/>
|
|
19
|
|
- <result property="assetStatus" column="asset_status"/>
|
|
20
|
|
- <result property="statusChangeDate" column="status_change_date"/>
|
|
21
|
|
- <result property="statusChangeReason" column="status_change_reason"/>
|
|
22
|
|
- <result property="penLocation" column="pen_location"/>
|
|
23
|
|
- <result property="expectedOutDate" column="expected_out_date"/>
|
|
24
|
|
- <result property="supplementPlan" column="supplement_plan"/>
|
|
25
|
|
- <result property="realtimeTemp" column="realtime_temp"/>
|
|
26
|
|
- <result property="realtimeSteps" column="realtime_steps"/>
|
|
27
|
|
- <result property="envTemp" column="env_temp"/>
|
|
28
|
|
- <result property="location" column="location"/>
|
|
29
|
|
- <result property="physioCollectTime" column="physio_collect_time"/>
|
|
30
|
|
- <result property="fatherYakNo" column="father_yak_no"/>
|
|
31
|
|
- <result property="motherYakNo" column="mother_yak_no"/>
|
|
32
|
|
- <result property="lastSyncTime" column="last_sync_time"/>
|
|
33
|
|
- <result property="delFlag" column="del_flag"/>
|
|
34
|
|
- <result property="createTime" column="create_time"/>
|
|
35
|
|
- <result property="updateTime" column="update_time"/>
|
|
|
6
|
+ <id property="id" column="id"/>
|
|
|
7
|
+ <result property="externalId" column="external_id"/>
|
|
|
8
|
+ <result property="yakNo" column="yak_no"/>
|
|
|
9
|
+ <result property="earTagNumber" column="ear_tag_number"/>
|
|
|
10
|
+ <result property="pastureId" column="pasture_id"/>
|
|
|
11
|
+ <result property="pastureName" column="pasture_name"/>
|
|
|
12
|
+ <result property="farmExternalId" column="farm_external_id"/>
|
|
|
13
|
+ <result property="enclosureExternalId" column="enclosure_external_id"/>
|
|
|
14
|
+ <result property="enclosureId" column="enclosure_id"/>
|
|
|
15
|
+ <result property="enclosureName" column="enclosure_name"/>
|
|
|
16
|
+ <result property="batchNo" column="batch_no"/>
|
|
|
17
|
+ <result property="batchExternalId" column="batch_external_id"/>
|
|
|
18
|
+ <result property="batchId" column="batch_id"/>
|
|
|
19
|
+ <result property="entryCycle" column="entry_cycle"/>
|
|
|
20
|
+ <result property="gender" column="gender"/>
|
|
|
21
|
+ <result property="cattleVariety" column="cattle_variety"/>
|
|
|
22
|
+ <result property="cattlePicture" column="cattle_picture"/>
|
|
|
23
|
+ <result property="registrant" column="registrant"/>
|
|
|
24
|
+ <result property="remark" column="remark"/>
|
|
|
25
|
+ <result property="birthDate" column="birth_date"/>
|
|
|
26
|
+ <result property="ageMonths" column="age_months"/>
|
|
|
27
|
+ <result property="entryDate" column="entry_date"/>
|
|
|
28
|
+ <result property="entryWeightKg" column="entry_weight_kg"/>
|
|
|
29
|
+ <result property="source" column="source"/>
|
|
|
30
|
+ <result property="breedingMethod" column="breeding_method"/>
|
|
|
31
|
+ <result property="assetStatus" column="asset_status"/>
|
|
|
32
|
+ <result property="statusChangeDate" column="status_change_date"/>
|
|
|
33
|
+ <result property="statusChangeReason" column="status_change_reason"/>
|
|
|
34
|
+ <result property="penLocation" column="pen_location"/>
|
|
|
35
|
+ <result property="expectedOutDate" column="expected_out_date"/>
|
|
|
36
|
+ <result property="supplementPlan" column="supplement_plan"/>
|
|
|
37
|
+ <result property="realtimeTemp" column="realtime_temp"/>
|
|
|
38
|
+ <result property="realtimeSteps" column="realtime_steps"/>
|
|
|
39
|
+ <result property="envTemp" column="env_temp"/>
|
|
|
40
|
+ <result property="location" column="location"/>
|
|
|
41
|
+ <result property="physioCollectTime" column="physio_collect_time"/>
|
|
|
42
|
+ <result property="fatherYakNo" column="father_yak_no"/>
|
|
|
43
|
+ <result property="motherYakNo" column="mother_yak_no"/>
|
|
|
44
|
+ <result property="lastSyncTime" column="last_sync_time"/>
|
|
|
45
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
46
|
+ <result property="createTime" column="create_time"/>
|
|
|
47
|
+ <result property="updateTime" column="update_time"/>
|
|
36
|
48
|
</resultMap>
|
|
37
|
49
|
|
|
38
|
50
|
<sql id="selectVo">
|
|
39
|
|
- select id, external_id, yak_no, pasture_id, pasture_name, batch_no, gender, birth_date, age_months,
|
|
40
|
|
- entry_date, entry_weight_kg, source, breeding_method, asset_status, status_change_date,
|
|
41
|
|
- status_change_reason, pen_location, expected_out_date, supplement_plan,
|
|
42
|
|
- realtime_temp, realtime_steps, env_temp, location, physio_collect_time,
|
|
43
|
|
- father_yak_no, mother_yak_no, last_sync_time, del_flag, create_time, update_time
|
|
|
51
|
+ select id, external_id, yak_no, ear_tag_number, pasture_id, pasture_name,
|
|
|
52
|
+ farm_external_id, enclosure_external_id, enclosure_id, enclosure_name,
|
|
|
53
|
+ batch_no, batch_external_id, batch_id, entry_cycle,
|
|
|
54
|
+ gender, cattle_variety, cattle_picture, registrant, remark,
|
|
|
55
|
+ birth_date, age_months, entry_date, entry_weight_kg, source, breeding_method,
|
|
|
56
|
+ asset_status, status_change_date, status_change_reason, pen_location,
|
|
|
57
|
+ expected_out_date, supplement_plan, realtime_temp, realtime_steps, env_temp,
|
|
|
58
|
+ location, physio_collect_time, father_yak_no, mother_yak_no,
|
|
|
59
|
+ last_sync_time, del_flag, create_time, update_time
|
|
44
|
60
|
from biz_yak_asset
|
|
45
|
61
|
</sql>
|
|
46
|
62
|
|
|
|
@@ -54,6 +70,11 @@
|
|
54
|
70
|
where yak_no = #{yakNo} and del_flag = '0'
|
|
55
|
71
|
</select>
|
|
56
|
72
|
|
|
|
73
|
+ <select id="selectBizYakAssetByEarTagNumber" parameterType="string" resultMap="BizYakAssetResult">
|
|
|
74
|
+ <include refid="selectVo"/>
|
|
|
75
|
+ where ear_tag_number = #{earTagNumber} and del_flag = '0'
|
|
|
76
|
+ </select>
|
|
|
77
|
+
|
|
57
|
78
|
<select id="selectBizYakAssetByExternalId" parameterType="long" resultMap="BizYakAssetResult">
|
|
58
|
79
|
<include refid="selectVo"/>
|
|
59
|
80
|
where external_id = #{externalId} and del_flag = '0'
|
|
|
@@ -64,7 +85,8 @@
|
|
64
|
85
|
<where>
|
|
65
|
86
|
del_flag = '0'
|
|
66
|
87
|
<if test="keyword != null and keyword != ''">
|
|
67
|
|
- and yak_no like concat('%', #{keyword}, '%')
|
|
|
88
|
+ and (yak_no like concat('%', #{keyword}, '%')
|
|
|
89
|
+ or ear_tag_number like concat('%', #{keyword}, '%'))
|
|
68
|
90
|
</if>
|
|
69
|
91
|
<if test="assetStatus != null">
|
|
70
|
92
|
and asset_status = #{assetStatus}
|
|
|
@@ -75,17 +97,25 @@
|
|
75
|
97
|
|
|
76
|
98
|
<insert id="insertBizYakAsset" parameterType="com.ruoyi.web.modules.industryservice.domain.BizYakAsset" useGeneratedKeys="true" keyProperty="id">
|
|
77
|
99
|
insert into biz_yak_asset (
|
|
78
|
|
- external_id, yak_no, pasture_id, pasture_name, batch_no, gender, birth_date, age_months,
|
|
79
|
|
- entry_date, entry_weight_kg, source, breeding_method, asset_status, status_change_date,
|
|
80
|
|
- status_change_reason, pen_location, expected_out_date, supplement_plan,
|
|
81
|
|
- realtime_temp, realtime_steps, env_temp, location, physio_collect_time,
|
|
82
|
|
- father_yak_no, mother_yak_no, last_sync_time, del_flag, create_time
|
|
|
100
|
+ external_id, yak_no, ear_tag_number, pasture_id, pasture_name,
|
|
|
101
|
+ farm_external_id, enclosure_external_id, enclosure_id, enclosure_name,
|
|
|
102
|
+ batch_no, batch_external_id, batch_id, entry_cycle,
|
|
|
103
|
+ gender, cattle_variety, cattle_picture, registrant, remark,
|
|
|
104
|
+ birth_date, age_months, entry_date, entry_weight_kg, source, breeding_method,
|
|
|
105
|
+ asset_status, status_change_date, status_change_reason, pen_location,
|
|
|
106
|
+ expected_out_date, supplement_plan, realtime_temp, realtime_steps, env_temp,
|
|
|
107
|
+ location, physio_collect_time, father_yak_no, mother_yak_no,
|
|
|
108
|
+ last_sync_time, del_flag, create_time
|
|
83
|
109
|
) values (
|
|
84
|
|
- #{externalId}, #{yakNo}, #{pastureId}, #{pastureName}, #{batchNo}, #{gender}, #{birthDate}, #{ageMonths},
|
|
85
|
|
- #{entryDate}, #{entryWeightKg}, #{source}, #{breedingMethod}, #{assetStatus}, #{statusChangeDate},
|
|
86
|
|
- #{statusChangeReason}, #{penLocation}, #{expectedOutDate}, #{supplementPlan},
|
|
87
|
|
- #{realtimeTemp}, #{realtimeSteps}, #{envTemp}, #{location}, #{physioCollectTime},
|
|
88
|
|
- #{fatherYakNo}, #{motherYakNo}, #{lastSyncTime}, #{delFlag}, sysdate()
|
|
|
110
|
+ #{externalId}, #{yakNo}, #{earTagNumber}, #{pastureId}, #{pastureName},
|
|
|
111
|
+ #{farmExternalId}, #{enclosureExternalId}, #{enclosureId}, #{enclosureName},
|
|
|
112
|
+ #{batchNo}, #{batchExternalId}, #{batchId}, #{entryCycle},
|
|
|
113
|
+ #{gender}, #{cattleVariety}, #{cattlePicture}, #{registrant}, #{remark},
|
|
|
114
|
+ #{birthDate}, #{ageMonths}, #{entryDate}, #{entryWeightKg}, #{source}, #{breedingMethod},
|
|
|
115
|
+ #{assetStatus}, #{statusChangeDate}, #{statusChangeReason}, #{penLocation},
|
|
|
116
|
+ #{expectedOutDate}, #{supplementPlan}, #{realtimeTemp}, #{realtimeSteps}, #{envTemp},
|
|
|
117
|
+ #{location}, #{physioCollectTime}, #{fatherYakNo}, #{motherYakNo},
|
|
|
118
|
+ #{lastSyncTime}, #{delFlag}, sysdate()
|
|
89
|
119
|
)
|
|
90
|
120
|
</insert>
|
|
91
|
121
|
|
|
|
@@ -93,10 +123,22 @@
|
|
93
|
123
|
update biz_yak_asset set
|
|
94
|
124
|
external_id = #{externalId},
|
|
95
|
125
|
yak_no = #{yakNo},
|
|
|
126
|
+ ear_tag_number = #{earTagNumber},
|
|
96
|
127
|
pasture_id = #{pastureId},
|
|
97
|
128
|
pasture_name = #{pastureName},
|
|
|
129
|
+ farm_external_id = #{farmExternalId},
|
|
|
130
|
+ enclosure_external_id = #{enclosureExternalId},
|
|
|
131
|
+ enclosure_id = #{enclosureId},
|
|
|
132
|
+ enclosure_name = #{enclosureName},
|
|
98
|
133
|
batch_no = #{batchNo},
|
|
|
134
|
+ batch_external_id = #{batchExternalId},
|
|
|
135
|
+ batch_id = #{batchId},
|
|
|
136
|
+ entry_cycle = #{entryCycle},
|
|
99
|
137
|
gender = #{gender},
|
|
|
138
|
+ cattle_variety = #{cattleVariety},
|
|
|
139
|
+ cattle_picture = #{cattlePicture},
|
|
|
140
|
+ registrant = #{registrant},
|
|
|
141
|
+ remark = #{remark},
|
|
100
|
142
|
birth_date = #{birthDate},
|
|
101
|
143
|
age_months = #{ageMonths},
|
|
102
|
144
|
entry_date = #{entryDate},
|