Quellcode durchsuchen

对接牦牛资产档案

wwh vor 1 Monat
Ursprung
Commit
47a7fb78d1

+ 0 - 18
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/BizYakBatchRel.java

@@ -1,18 +0,0 @@
1
-package com.ruoyi.web.modules.industryservice.domain;
2
-
3
-public class BizYakBatchRel
4
-{
5
-    private Long id;
6
-    private Long yakAssetId;
7
-    private String batchNo;
8
-    private String yakNo;
9
-
10
-    public Long getId() { return id; }
11
-    public void setId(Long id) { this.id = id; }
12
-    public Long getYakAssetId() { return yakAssetId; }
13
-    public void setYakAssetId(Long yakAssetId) { this.yakAssetId = yakAssetId; }
14
-    public String getBatchNo() { return batchNo; }
15
-    public void setBatchNo(String batchNo) { this.batchNo = batchNo; }
16
-    public String getYakNo() { return yakNo; }
17
-    public void setYakNo(String yakNo) { this.yakNo = yakNo; }
18
-}

+ 0 - 18
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/BizYakPenRel.java

@@ -1,18 +0,0 @@
1
-package com.ruoyi.web.modules.industryservice.domain;
2
-
3
-public class BizYakPenRel
4
-{
5
-    private Long id;
6
-    private Long yakAssetId;
7
-    private String penName;
8
-    private String yakNo;
9
-
10
-    public Long getId() { return id; }
11
-    public void setId(Long id) { this.id = id; }
12
-    public Long getYakAssetId() { return yakAssetId; }
13
-    public void setYakAssetId(Long yakAssetId) { this.yakAssetId = yakAssetId; }
14
-    public String getPenName() { return penName; }
15
-    public void setPenName(String penName) { this.penName = penName; }
16
-    public String getYakNo() { return yakNo; }
17
-    public void setYakNo(String yakNo) { this.yakNo = yakNo; }
18
-}

+ 0 - 26
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/dto/YakAssetBundleDto.java

@@ -2,9 +2,7 @@ package com.ruoyi.web.modules.industryservice.domain.dto;
2 2
 
3 3
 import java.util.List;
4 4
 import com.ruoyi.web.modules.industryservice.domain.BizYakAsset;
5
-import com.ruoyi.web.modules.industryservice.domain.BizYakBatchRel;
6 5
 import com.ruoyi.web.modules.industryservice.domain.BizYakFeedingRecord;
7
-import com.ruoyi.web.modules.industryservice.domain.BizYakPenRel;
8 6
 import com.ruoyi.web.modules.industryservice.domain.BizYakGrowthRecord;
9 7
 import com.ruoyi.web.modules.industryservice.domain.BizYakPhysioSeries;
10 8
 import com.ruoyi.web.modules.industryservice.domain.BizYakReproductionRecord;
@@ -27,10 +25,6 @@ public class YakAssetBundleDto
27 25
 
28 26
     private List<BizYakFeedingRecord> feedingRecords;
29 27
 
30
-    private List<BizYakPenRel> penRecords;
31
-
32
-    private List<BizYakBatchRel> batchRecords;
33
-
34 28
     public BizYakAsset getAsset()
35 29
     {
36 30
         return asset;
@@ -90,24 +84,4 @@ public class YakAssetBundleDto
90 84
     {
91 85
         this.feedingRecords = feedingRecords;
92 86
     }
93
-
94
-    public List<BizYakPenRel> getPenRecords()
95
-    {
96
-        return penRecords;
97
-    }
98
-
99
-    public void setPenRecords(List<BizYakPenRel> penRecords)
100
-    {
101
-        this.penRecords = penRecords;
102
-    }
103
-
104
-    public List<BizYakBatchRel> getBatchRecords()
105
-    {
106
-        return batchRecords;
107
-    }
108
-
109
-    public void setBatchRecords(List<BizYakBatchRel> batchRecords)
110
-    {
111
-        this.batchRecords = batchRecords;
112
-    }
113 87
 }

+ 0 - 8
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/vo/YakAssetDetailVo.java

@@ -2,10 +2,8 @@ package com.ruoyi.web.modules.industryservice.domain.vo;
2 2
 
3 3
 import java.util.List;
4 4
 import com.ruoyi.web.modules.industryservice.domain.BizYakAsset;
5
-import com.ruoyi.web.modules.industryservice.domain.BizYakBatchRel;
6 5
 import com.ruoyi.web.modules.industryservice.domain.BizYakFeedingRecord;
7 6
 import com.ruoyi.web.modules.industryservice.domain.BizYakGrowthRecord;
8
-import com.ruoyi.web.modules.industryservice.domain.BizYakPenRel;
9 7
 import com.ruoyi.web.modules.industryservice.domain.BizYakPhysioSeries;
10 8
 import com.ruoyi.web.modules.industryservice.domain.BizYakReproductionRecord;
11 9
 
@@ -16,8 +14,6 @@ public class YakAssetDetailVo
16 14
     private List<BizYakGrowthRecord> growthRecords;
17 15
     private List<BizYakReproductionRecord> reproductionRecords;
18 16
     private List<BizYakFeedingRecord> feedingRecords;
19
-    private List<BizYakPenRel> penRecords;
20
-    private List<BizYakBatchRel> batchRecords;
21 17
 
22 18
     public BizYakAsset getAsset() { return asset; }
23 19
     public void setAsset(BizYakAsset asset) { this.asset = asset; }
@@ -29,8 +25,4 @@ public class YakAssetDetailVo
29 25
     public void setReproductionRecords(List<BizYakReproductionRecord> reproductionRecords) { this.reproductionRecords = reproductionRecords; }
30 26
     public List<BizYakFeedingRecord> getFeedingRecords() { return feedingRecords; }
31 27
     public void setFeedingRecords(List<BizYakFeedingRecord> feedingRecords) { this.feedingRecords = feedingRecords; }
32
-    public List<BizYakPenRel> getPenRecords() { return penRecords; }
33
-    public void setPenRecords(List<BizYakPenRel> penRecords) { this.penRecords = penRecords; }
34
-    public List<BizYakBatchRel> getBatchRecords() { return batchRecords; }
35
-    public void setBatchRecords(List<BizYakBatchRel> batchRecords) { this.batchRecords = batchRecords; }
36 28
 }

+ 0 - 11
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/mapper/BizYakBatchRelMapper.java

@@ -1,11 +0,0 @@
1
-package com.ruoyi.web.modules.industryservice.mapper;
2
-
3
-import java.util.List;
4
-import com.ruoyi.web.modules.industryservice.domain.BizYakBatchRel;
5
-
6
-public interface BizYakBatchRelMapper
7
-{
8
-    List<BizYakBatchRel> selectByYakAssetId(Long yakAssetId);
9
-    int deleteByYakAssetId(Long yakAssetId);
10
-    int batchInsert(List<BizYakBatchRel> list);
11
-}

+ 0 - 11
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/mapper/BizYakPenRelMapper.java

@@ -1,11 +0,0 @@
1
-package com.ruoyi.web.modules.industryservice.mapper;
2
-
3
-import java.util.List;
4
-import com.ruoyi.web.modules.industryservice.domain.BizYakPenRel;
5
-
6
-public interface BizYakPenRelMapper
7
-{
8
-    List<BizYakPenRel> selectByYakAssetId(Long yakAssetId);
9
-    int deleteByYakAssetId(Long yakAssetId);
10
-    int batchInsert(List<BizYakPenRel> list);
11
-}

+ 0 - 49
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/service/YakAssetBundleSyncTxService.java

@@ -1,6 +1,5 @@
1 1
 package com.ruoyi.web.modules.industryservice.service;
2 2
 
3
-import java.util.Collections;
4 3
 import java.util.Date;
5 4
 import org.springframework.beans.factory.annotation.Autowired;
6 5
 import org.springframework.stereotype.Service;
@@ -11,18 +10,14 @@ import com.ruoyi.common.exception.ServiceException;
11 10
 import com.ruoyi.common.utils.StringUtils;
12 11
 import com.ruoyi.web.modules.industryservice.domain.BizPasture;
13 12
 import com.ruoyi.web.modules.industryservice.domain.BizYakAsset;
14
-import com.ruoyi.web.modules.industryservice.domain.BizYakBatchRel;
15 13
 import com.ruoyi.web.modules.industryservice.domain.BizYakFeedingRecord;
16
-import com.ruoyi.web.modules.industryservice.domain.BizYakPenRel;
17 14
 import com.ruoyi.web.modules.industryservice.domain.BizYakGrowthRecord;
18 15
 import com.ruoyi.web.modules.industryservice.domain.BizYakPhysioSeries;
19 16
 import com.ruoyi.web.modules.industryservice.domain.BizYakReproductionRecord;
20 17
 import com.ruoyi.web.modules.industryservice.domain.dto.YakAssetBundleDto;
21 18
 import com.ruoyi.web.modules.industryservice.mapper.BizPastureMapper;
22 19
 import com.ruoyi.web.modules.industryservice.mapper.BizYakAssetMapper;
23
-import com.ruoyi.web.modules.industryservice.mapper.BizYakBatchRelMapper;
24 20
 import com.ruoyi.web.modules.industryservice.mapper.BizYakFeedingRecordMapper;
25
-import com.ruoyi.web.modules.industryservice.mapper.BizYakPenRelMapper;
26 21
 import com.ruoyi.web.modules.industryservice.support.YakAssetStatusMapper;
27 22
 import com.ruoyi.web.modules.industryservice.mapper.BizYakGrowthRecordMapper;
28 23
 import com.ruoyi.web.modules.industryservice.mapper.BizYakPhysioSeriesMapper;
@@ -51,12 +46,6 @@ public class YakAssetBundleSyncTxService
51 46
     @Autowired
52 47
     private BizYakFeedingRecordMapper feedingRecordMapper;
53 48
 
54
-    @Autowired
55
-    private BizYakPenRelMapper penRelMapper;
56
-
57
-    @Autowired
58
-    private BizYakBatchRelMapper batchRelMapper;
59
-
60 49
     @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
61 50
     public boolean persistBundle(YakAssetBundleDto bundle, Date syncTime)
62 51
     {
@@ -166,14 +155,6 @@ public class YakAssetBundleSyncTxService
166 155
         {
167 156
             feedingRecordMapper.deleteByYakAssetId(yakAssetId);
168 157
         }
169
-        if (bundle.getPenRecords() != null || StringUtils.isNotEmpty(bundle.getAsset().getPenLocation()))
170
-        {
171
-            penRelMapper.deleteByYakAssetId(yakAssetId);
172
-        }
173
-        if (bundle.getBatchRecords() != null || StringUtils.isNotEmpty(bundle.getAsset().getBatchNo()))
174
-        {
175
-            batchRelMapper.deleteByYakAssetId(yakAssetId);
176
-        }
177 158
 
178 159
         if (!CollectionUtils.isEmpty(bundle.getPhysioSeries()))
179 160
         {
@@ -215,35 +196,5 @@ public class YakAssetBundleSyncTxService
215 196
             }
216 197
             feedingRecordMapper.batchInsert(bundle.getFeedingRecords());
217 198
         }
218
-        if (!CollectionUtils.isEmpty(bundle.getPenRecords()))
219
-        {
220
-            for (BizYakPenRel row : bundle.getPenRecords())
221
-            {
222
-                row.setYakAssetId(yakAssetId);
223
-            }
224
-            penRelMapper.batchInsert(bundle.getPenRecords());
225
-        }
226
-        else if (StringUtils.isNotEmpty(bundle.getAsset().getPenLocation()))
227
-        {
228
-            BizYakPenRel pen = new BizYakPenRel();
229
-            pen.setYakAssetId(yakAssetId);
230
-            pen.setPenName(bundle.getAsset().getPenLocation().trim());
231
-            penRelMapper.batchInsert(Collections.singletonList(pen));
232
-        }
233
-        if (!CollectionUtils.isEmpty(bundle.getBatchRecords()))
234
-        {
235
-            for (BizYakBatchRel row : bundle.getBatchRecords())
236
-            {
237
-                row.setYakAssetId(yakAssetId);
238
-            }
239
-            batchRelMapper.batchInsert(bundle.getBatchRecords());
240
-        }
241
-        else if (StringUtils.isNotEmpty(bundle.getAsset().getBatchNo()))
242
-        {
243
-            BizYakBatchRel batch = new BizYakBatchRel();
244
-            batch.setYakAssetId(yakAssetId);
245
-            batch.setBatchNo(bundle.getAsset().getBatchNo().trim());
246
-            batchRelMapper.batchInsert(Collections.singletonList(batch));
247
-        }
248 199
     }
249 200
 }

+ 0 - 19
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/service/impl/BizYakAssetServiceImpl.java

@@ -36,12 +36,6 @@ public class BizYakAssetServiceImpl implements IBizYakAssetService
36 36
     @Autowired
37 37
     private BizYakFeedingRecordMapper feedingRecordMapper;
38 38
 
39
-    @Autowired
40
-    private BizYakPenRelMapper penRelMapper;
41
-
42
-    @Autowired
43
-    private BizYakBatchRelMapper batchRelMapper;
44
-
45 39
     @Autowired
46 40
     private YakAssetSyncService yakAssetSyncService;
47 41
 
@@ -134,19 +128,6 @@ public class BizYakAssetServiceImpl implements IBizYakAssetService
134 128
         vo.setGrowthRecords(growthRecordMapper.selectByYakAssetId(yakAssetId));
135 129
         vo.setReproductionRecords(reproductionRecordMapper.selectByYakAssetId(yakAssetId));
136 130
         vo.setFeedingRecords(feedingRecordMapper.selectByYakAssetId(yakAssetId));
137
-        String yakNo = asset.getYakNo();
138
-        List<BizYakPenRel> pens = penRelMapper.selectByYakAssetId(yakAssetId);
139
-        for (BizYakPenRel pen : pens)
140
-        {
141
-            pen.setYakNo(yakNo);
142
-        }
143
-        vo.setPenRecords(pens);
144
-        List<BizYakBatchRel> batches = batchRelMapper.selectByYakAssetId(yakAssetId);
145
-        for (BizYakBatchRel batch : batches)
146
-        {
147
-            batch.setYakNo(yakNo);
148
-        }
149
-        vo.setBatchRecords(batches);
150 131
         return vo;
151 132
     }
152 133
 

+ 0 - 27
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/YakEntryOpenApiMapper.java

@@ -11,8 +11,6 @@ import java.util.TimeZone;
11 11
 import com.ruoyi.common.exception.ServiceException;
12 12
 import com.ruoyi.common.utils.StringUtils;
13 13
 import com.ruoyi.web.modules.industryservice.domain.BizYakAsset;
14
-import com.ruoyi.web.modules.industryservice.domain.BizYakBatchRel;
15
-import com.ruoyi.web.modules.industryservice.domain.BizYakPenRel;
16 14
 import com.ruoyi.web.modules.industryservice.domain.dto.OpenYakEntryDto;
17 15
 import com.ruoyi.web.modules.industryservice.domain.dto.YakAssetBundleDto;
18 16
 
@@ -69,8 +67,6 @@ public final class YakEntryOpenApiMapper
69 67
         {
70 68
             bundle.setThirdPartyPastureCode(String.valueOf(dto.getFarmId()));
71 69
         }
72
-        bundle.setPenRecords(buildPenRecords(dto));
73
-        bundle.setBatchRecords(buildBatchRecords(dto, asset.getBatchNo()));
74 70
         return bundle;
75 71
     }
76 72
 
@@ -118,29 +114,6 @@ public final class YakEntryOpenApiMapper
118 114
         return sex;
119 115
     }
120 116
 
121
-    private static List<BizYakPenRel> buildPenRecords(OpenYakEntryDto dto)
122
-    {
123
-        if (StringUtils.isEmpty(dto.getFarmEnclosureName()))
124
-        {
125
-            return null;
126
-        }
127
-        BizYakPenRel pen = new BizYakPenRel();
128
-        pen.setPenName(dto.getFarmEnclosureName().trim());
129
-        return Collections.singletonList(pen);
130
-    }
131
-
132
-    private static List<BizYakBatchRel> buildBatchRecords(OpenYakEntryDto dto, String batchNo)
133
-    {
134
-        String resolved = batchNo;
135
-        if (StringUtils.isEmpty(resolved))
136
-        {
137
-            return null;
138
-        }
139
-        BizYakBatchRel batch = new BizYakBatchRel();
140
-        batch.setBatchNo(resolved);
141
-        return Collections.singletonList(batch);
142
-    }
143
-
144 117
     public static List<YakAssetBundleDto> toBundles(List<OpenYakEntryDto> entries)
145 118
     {
146 119
         if (entries == null || entries.isEmpty())

+ 0 - 17
baqing-admin/src/main/resources/mapper/industryservice/BizYakBatchRelMapper.xml

@@ -1,17 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" ?>
2
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.ruoyi.web.modules.industryservice.mapper.BizYakBatchRelMapper">
4
-    <resultMap type="com.ruoyi.web.modules.industryservice.domain.BizYakBatchRel" id="BizYakBatchRelResult">
5
-        <id property="id" column="id"/>
6
-        <result property="yakAssetId" column="yak_asset_id"/>
7
-        <result property="batchNo" column="batch_no"/>
8
-    </resultMap>
9
-    <select id="selectByYakAssetId" resultMap="BizYakBatchRelResult">
10
-        select id, yak_asset_id, batch_no from biz_yak_batch_rel where yak_asset_id = #{yakAssetId} order by id desc
11
-    </select>
12
-    <delete id="deleteByYakAssetId">delete from biz_yak_batch_rel where yak_asset_id = #{yakAssetId}</delete>
13
-    <insert id="batchInsert">
14
-        insert into biz_yak_batch_rel (yak_asset_id, batch_no) values
15
-        <foreach collection="list" item="item" separator=",">(#{item.yakAssetId}, #{item.batchNo})</foreach>
16
-    </insert>
17
-</mapper>

+ 0 - 17
baqing-admin/src/main/resources/mapper/industryservice/BizYakPenRelMapper.xml

@@ -1,17 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" ?>
2
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.ruoyi.web.modules.industryservice.mapper.BizYakPenRelMapper">
4
-    <resultMap type="com.ruoyi.web.modules.industryservice.domain.BizYakPenRel" id="BizYakPenRelResult">
5
-        <id property="id" column="id"/>
6
-        <result property="yakAssetId" column="yak_asset_id"/>
7
-        <result property="penName" column="pen_name"/>
8
-    </resultMap>
9
-    <select id="selectByYakAssetId" resultMap="BizYakPenRelResult">
10
-        select id, yak_asset_id, pen_name from biz_yak_pen_rel where yak_asset_id = #{yakAssetId} order by id desc
11
-    </select>
12
-    <delete id="deleteByYakAssetId">delete from biz_yak_pen_rel where yak_asset_id = #{yakAssetId}</delete>
13
-    <insert id="batchInsert">
14
-        insert into biz_yak_pen_rel (yak_asset_id, pen_name) values
15
-        <foreach collection="list" item="item" separator=",">(#{item.yakAssetId}, #{item.penName})</foreach>
16
-    </insert>
17
-</mapper>

+ 0 - 12
baqing-admin/src/test/java/com/ruoyi/web/modules/industryservice/service/impl/BizYakAssetServiceImplTest.java

@@ -23,9 +23,7 @@ import com.ruoyi.web.modules.industryservice.domain.BizYakGrowthRecord;
23 23
 import com.ruoyi.web.modules.industryservice.domain.vo.YakAssetDetailVo;
24 24
 import com.ruoyi.web.modules.industryservice.domain.vo.YakAssetGrowthChartVo;
25 25
 import com.ruoyi.web.modules.industryservice.mapper.BizYakAssetMapper;
26
-import com.ruoyi.web.modules.industryservice.mapper.BizYakBatchRelMapper;
27 26
 import com.ruoyi.web.modules.industryservice.mapper.BizYakFeedingRecordMapper;
28
-import com.ruoyi.web.modules.industryservice.mapper.BizYakPenRelMapper;
29 27
 import com.ruoyi.web.modules.industryservice.mapper.BizYakGrowthRecordMapper;
30 28
 import com.ruoyi.web.modules.industryservice.mapper.BizYakPhysioSeriesMapper;
31 29
 import com.ruoyi.web.modules.industryservice.mapper.BizYakReproductionRecordMapper;
@@ -51,12 +49,6 @@ class BizYakAssetServiceImplTest
51 49
     @Mock
52 50
     private BizYakFeedingRecordMapper feedingRecordMapper;
53 51
 
54
-    @Mock
55
-    private BizYakPenRelMapper penRelMapper;
56
-
57
-    @Mock
58
-    private BizYakBatchRelMapper batchRelMapper;
59
-
60 52
     @Mock
61 53
     private YakAssetSyncService yakAssetSyncService;
62 54
 
@@ -73,8 +65,6 @@ class BizYakAssetServiceImplTest
73 65
         when(growthRecordMapper.selectByYakAssetId(1L)).thenReturn(Collections.emptyList());
74 66
         when(reproductionRecordMapper.selectByYakAssetId(1L)).thenReturn(Collections.emptyList());
75 67
         when(feedingRecordMapper.selectByYakAssetId(1L)).thenReturn(Collections.emptyList());
76
-        when(penRelMapper.selectByYakAssetId(1L)).thenReturn(Collections.emptyList());
77
-        when(batchRelMapper.selectByYakAssetId(1L)).thenReturn(Collections.emptyList());
78 68
         YakAssetDetailVo vo = service.selectDetailById(1L);
79 69
         assertEquals("YAK20250001", vo.getAsset().getYakNo());
80 70
         verify(physioSeriesMapper).selectByYakAssetId(1L);
@@ -118,8 +108,6 @@ class BizYakAssetServiceImplTest
118 108
         when(growthRecordMapper.selectByYakAssetId(3L)).thenReturn(Collections.emptyList());
119 109
         when(reproductionRecordMapper.selectByYakAssetId(3L)).thenReturn(Collections.emptyList());
120 110
         when(feedingRecordMapper.selectByYakAssetId(3L)).thenReturn(Collections.emptyList());
121
-        when(penRelMapper.selectByYakAssetId(3L)).thenReturn(Collections.emptyList());
122
-        when(batchRelMapper.selectByYakAssetId(3L)).thenReturn(Collections.emptyList());
123 111
         YakAssetDetailVo vo = service.selectDetailByYakNo("YAK20250001");
124 112
         assertEquals(3L, vo.getAsset().getId());
125 113
     }

+ 0 - 2
baqing-admin/src/test/java/com/ruoyi/web/modules/industryservice/support/YakEntryOpenApiMapperTest.java

@@ -51,7 +51,5 @@ class YakEntryOpenApiMapperTest
51 51
         assertEquals(new BigDecimal("220.5"), asset.getEntryWeightKg());
52 52
         assertEquals("测试备注", asset.getStatusChangeReason());
53 53
         assertEquals("1", bundle.getThirdPartyPastureCode());
54
-        assertEquals(1, bundle.getPenRecords().size());
55
-        assertEquals(1, bundle.getBatchRecords().size());
56 54
     }
57 55
 }

+ 0 - 16
sql/biz_yak_asset.sql

@@ -95,19 +95,3 @@ CREATE TABLE IF NOT EXISTS `biz_yak_feeding_record` (
95 95
   PRIMARY KEY (`id`),
96 96
   KEY `idx_yak_feeding` (`yak_asset_id`)
97 97
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='牦牛饲喂数据';
98
-
99
-CREATE TABLE IF NOT EXISTS `biz_yak_pen_rel` (
100
-  `id` bigint(20) NOT NULL AUTO_INCREMENT,
101
-  `yak_asset_id` bigint(20) NOT NULL,
102
-  `pen_name` varchar(128) NOT NULL COMMENT '圈舍名称',
103
-  PRIMARY KEY (`id`),
104
-  KEY `idx_yak_pen` (`yak_asset_id`)
105
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='牦牛圈舍关联';
106
-
107
-CREATE TABLE IF NOT EXISTS `biz_yak_batch_rel` (
108
-  `id` bigint(20) NOT NULL AUTO_INCREMENT,
109
-  `yak_asset_id` bigint(20) NOT NULL,
110
-  `batch_no` varchar(64) NOT NULL COMMENT '批次编号',
111
-  PRIMARY KEY (`id`),
112
-  KEY `idx_yak_batch` (`yak_asset_id`)
113
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='牦牛批次关联';