From c206f8ad8fa16bdb27dc67cf9e9cc07f67fbb929 Mon Sep 17 00:00:00 2001 From: zyh <2066096076@qq.com> Date: Thu, 17 Jul 2025 09:58:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BE=8A=E5=8F=AA=EF=BC=8C?= =?UTF-8?q?=E8=BD=AC=E7=BE=A4=EF=BC=8C=E4=BF=AE=E8=B9=84=EF=BC=8C=E5=8E=BB?= =?UTF-8?q?=E5=8A=BF=E9=A1=B5=E9=9D=A2=E5=93=81=E7=A7=8D=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E7=9A=84=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ScAddSheepController.java | 15 ++- .../add_sheep/domain/ScAddSheep.java | 11 +- .../service/impl/ScAddSheepServiceImpl.java | 93 ++++++++------- .../trans_group/domain/ScTransGroup.java | 7 ++ .../service/impl/ScTransGroupServiceImpl.java | 2 - .../other/castrate/domain/ScCastrate.java | 71 +++-------- .../other/fixHoof/domain/ScFixHoof.java | 7 ++ .../add_sheep/ScAddSheepMapper.xml | 110 ++++++++++-------- .../trans_group/ScTransGroupMapper.xml | 28 +++-- .../other/castrate/ScCastrateMapper.xml | 11 ++ .../produce/other/fixHoof/ScFixHoofMapper.xml | 44 ++++--- 11 files changed, 218 insertions(+), 181 deletions(-) diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/controller/ScAddSheepController.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/controller/ScAddSheepController.java index 8602dce..7f9c07a 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/controller/ScAddSheepController.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/controller/ScAddSheepController.java @@ -5,10 +5,12 @@ import com.zhyc.common.core.domain.AjaxResult; import com.zhyc.common.enums.BusinessType; import com.zhyc.common.exception.ServiceException; import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.module.base.variety.domain.BasSheepVariety; +import com.zhyc.module.base.variety.service.IBasSheepVarietyService; +import com.zhyc.module.fileManagement.domain.DaSheepfold; +import com.zhyc.module.fileManagement.service.IDaSheepfoldService; import com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep; import com.zhyc.module.produce.manage_sheep.add_sheep.service.IScAddSheepService; -import com.zhyc.module.sheepfold_management.domain.DaSheepfold; -import com.zhyc.module.sheepfold_management.service.IDaSheepfoldService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.PostMapping; @@ -33,6 +35,8 @@ public class ScAddSheepController { @Autowired private IDaSheepfoldService daSheepfoldMapper; + @Autowired + private IBasSheepVarietyService basSheepVarietyService; //新增羊只验证 @PreAuthorize("@ss.hasPermi('produce:add_sheep:add')") @Log(title = "新增", businessType = BusinessType.INSERT) @@ -83,7 +87,12 @@ public class ScAddSheepController { scAddSheep.setSheepfoldNameExcel(fold.getSheepfoldName()); } } - + if (scAddSheep.getVarietyId() != null) { + BasSheepVariety variety = basSheepVarietyService.selectBasSheepVarietyById(scAddSheep.getVarietyId().longValue()); + if (variety != null) { + scAddSheep.setVarietyName(variety.getVariety()); + } + } list.add(scAddSheep); util.exportExcel(response, list, "羊只信息"); } diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/domain/ScAddSheep.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/domain/ScAddSheep.java index 9ac2465..625a90b 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/domain/ScAddSheep.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/domain/ScAddSheep.java @@ -52,18 +52,21 @@ public class ScAddSheep extends BaseEntity { @Excel(name = "出生日期", dateFormat = "yyyy-MM-dd") private Date birthday; - /** 性别 1公 0母 */ - @Excel(name = "性别", readConverterExp = "1=公,0=母") + /** 性别 1公 0母 2阉羊 3兼性 */ + @Excel(name = "性别", readConverterExp = "1=公,0=母,2=阉羊,3=兼性") private Integer gender; /** 胎次 */ @Excel(name = "胎次") private Integer parity; - /** 品种编号 */ - @Excel(name = "品种编号") + /** 品种id */ private Integer varietyId; + /** 品种名称(联表查询返回,非数据库字段) */ + @Excel(name = "品种") + private String varietyName; + /** 入群日期 */ @Excel(name = "入群日期", dateFormat = "yyyy-MM-dd") private Date joinDate; diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/impl/ScAddSheepServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/impl/ScAddSheepServiceImpl.java index bd6a247..7d6b1db 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/impl/ScAddSheepServiceImpl.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/add_sheep/service/impl/ScAddSheepServiceImpl.java @@ -2,20 +2,23 @@ package com.zhyc.module.produce.manage_sheep.add_sheep.service.impl; import com.zhyc.common.exception.ServiceException; import com.zhyc.common.utils.StringUtils; +import com.zhyc.module.base.variety.domain.BasSheepVariety; +import com.zhyc.module.base.variety.service.IBasSheepVarietyService; +import com.zhyc.module.fileManagement.domain.DaSheepfold; +import com.zhyc.module.fileManagement.mapper.DaSheepfoldMapper; import com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep; import com.zhyc.module.produce.manage_sheep.add_sheep.mapper.ScAddSheepMapper; import com.zhyc.module.produce.manage_sheep.add_sheep.service.IScAddSheepService; import com.zhyc.module.produce.sheep.domain.BasSheep; -import com.zhyc.module.produce.sheep.mapper.BasSheepMapper; import com.zhyc.module.produce.sheep.service.IBasSheepService; -import com.zhyc.module.produce.sheep.service.impl.BasSheepServiceImpl; -import com.zhyc.module.sheepfold_management.domain.DaSheepfold; -import com.zhyc.module.sheepfold_management.mapper.DaSheepfoldMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; @Service public class ScAddSheepServiceImpl implements IScAddSheepService { @@ -29,6 +32,9 @@ public class ScAddSheepServiceImpl implements IScAddSheepService { @Autowired private IBasSheepService basSheepService; + @Autowired + private IBasSheepVarietyService basSheepVarietyService; + @Override public boolean insertScAddSheep(ScAddSheep scAddSheep) { // 1. 重复校验 @@ -62,6 +68,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService { basSheepService.insertBasSheep(bs); return true; } + @Override public List selectScAddSheepList(ScAddSheep scAddSheep) { return scAddSheepMapper.selectScAddSheepList(scAddSheep); @@ -79,6 +86,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService { /* ------------------ 导入:羊舍名称 → ID ------------------ */ @Override + @Transactional(rollbackFor = Exception.class) public String importSheep(List list, boolean updateSupport, String operName) { if (list == null || list.isEmpty()) { throw new ServiceException("导入数据不能为空!"); @@ -87,50 +95,58 @@ public class ScAddSheepServiceImpl implements IScAddSheepService { int success = 0, failure = 0; StringBuilder failureMsg = new StringBuilder(); + // 1. 一次性加载全部品种和羊舍,避免循环查库 + Map varietyNameToIdMap = basSheepVarietyService + .selectBasSheepVarietyList(new BasSheepVariety()) + .stream() + .collect(Collectors.toMap( + BasSheepVariety::getVariety, + BasSheepVariety::getId, + (existing, replacement) -> existing // 保留第一个 + )); + + Map sheepfoldNameToIdMap = daSheepfoldMapper + .selectDaSheepfoldList(new DaSheepfold()) + .stream() + .collect(Collectors.toMap( + DaSheepfold::getSheepfoldName, + DaSheepfold::getId, + (existing, replacement) -> existing // 保留第一个 + )); + for (int i = 0; i < list.size(); i++) { ScAddSheep sheep = list.get(i); try { - /* 1. 羊舍名称 → ID */ + // 2. 羊舍名称 → ID if (StringUtils.isNotBlank(sheep.getSheepfoldNameExcel())) { - DaSheepfold param = new DaSheepfold(); - param.setSheepfoldName(sheep.getSheepfoldNameExcel()); - List foldList = daSheepfoldMapper.selectDaSheepfoldList(param); - - if (foldList == null || foldList.isEmpty()) { - failure++; - failureMsg.append("
第") - .append(i + 1) - .append("行:羊舍名称不存在【") - .append(sheep.getSheepfoldNameExcel()) - .append("】"); - continue; + Long sheepfoldId = sheepfoldNameToIdMap.get(sheep.getSheepfoldNameExcel()); + if (sheepfoldId == null) { + throw new ServiceException("羊舍名称不存在:" + sheep.getSheepfoldNameExcel()); } - sheep.setSheepfold(foldList.get(0).getId().intValue()); + sheep.setSheepfold(sheepfoldId.intValue()); } - /* 2. 耳号非空校验 */ + // 3. 品种名称 → ID + if (StringUtils.isNotBlank(sheep.getVarietyName())) { + Long varietyId = varietyNameToIdMap.get(sheep.getVarietyName()); + if (varietyId == null) { + throw new ServiceException("品种名称不存在:" + sheep.getVarietyName()); + } + sheep.setVarietyId(varietyId.intValue()); + } + + // 4. 耳号非空校验 if (StringUtils.isBlank(sheep.getEarNumber())) { - failure++; - failureMsg.append("
第") - .append(i + 1) - .append("行:耳号不能为空"); - continue; + throw new ServiceException("耳号不能为空"); } - /* 3. 耳号重复校验(增量导入核心) */ + // 5. 耳号重复校验 ScAddSheep exist = scAddSheepMapper.selectByEarNumber(sheep.getEarNumber()); if (exist != null) { - failure++; - failureMsg.append("
第") - .append(i + 1) - .append("行:耳号已存在【") - .append(sheep.getEarNumber()) - .append("】"); - continue; - } - - /* 4. 插入或更新 */ - if (updateSupport && sheep.getId() != null) { + if (!updateSupport) { + throw new ServiceException("耳号已存在:" + sheep.getEarNumber()); + } + sheep.setId(exist.getId()); sheep.setUpdateBy(operName); updateScAddSheep(sheep); } else { @@ -140,10 +156,7 @@ public class ScAddSheepServiceImpl implements IScAddSheepService { success++; } catch (Exception e) { failure++; - failureMsg.append("
第") - .append(i + 1) - .append("行:") - .append(e.getMessage()); + failureMsg.append("
第").append(i + 1).append("行:").append(e.getMessage()); } } diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/domain/ScTransGroup.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/domain/ScTransGroup.java index 13d5d35..8ae62eb 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/domain/ScTransGroup.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/domain/ScTransGroup.java @@ -44,6 +44,13 @@ public class ScTransGroup extends BaseEntity private String foldToName; /** 转群原因 */ + /** 品种id */ + private Long varietyId; + + /** 品种名称(联表查询返回,非数据库字段) */ + @Excel(name = "品种") + private String varietyName; + private Integer reason; /** 转群原因描述 用于导出*/ @Excel(name = "转群原因") diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/impl/ScTransGroupServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/impl/ScTransGroupServiceImpl.java index 4354dd7..2eeb360 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/impl/ScTransGroupServiceImpl.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/manage_sheep/trans_group/service/impl/ScTransGroupServiceImpl.java @@ -51,8 +51,6 @@ public class ScTransGroupServiceImpl implements IScTransGroupService { group.setStatusText(convertStatus(group.getStatus())); }); return list; -// return scTransGroupMapper.selectScTransGroupList(scTransGroup); - } /** diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/domain/ScCastrate.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/domain/ScCastrate.java index 280a1e3..c8d0b88 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/domain/ScCastrate.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/castrate/domain/ScCastrate.java @@ -1,5 +1,8 @@ package com.zhyc.module.produce.other.castrate.domain; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.zhyc.common.annotation.Excel; @@ -11,6 +14,9 @@ import com.zhyc.common.core.domain.BaseEntity; * @author ruoyi * @date 2025-07-09 */ +@Data +@AllArgsConstructor +@NoArgsConstructor public class ScCastrate extends BaseEntity { private static final long serialVersionUID = 1L; @@ -36,6 +42,13 @@ public class ScCastrate extends BaseEntity { @Excel(name = "羊舍名称") private String sheepfoldName; + /** 品种id */ + private Long varietyId; + + /** 品种名称(联表查询返回,非数据库字段) */ + @Excel(name = "品种") + private String varietyName; + /** * 备注 */ @@ -50,63 +63,5 @@ public class ScCastrate extends BaseEntity { - public void setId(Long id) { - this.id = id; - } - public Long getId() { - return id; - } - - public void setSheepId(String sheepId) { - this.sheepId = sheepId; - } - - public String getSheepId() { - return sheepId; - } - - public void setSheepfold(Long sheepfold) { - this.sheepfold = sheepfold; - } - - public Long getSheepfold() { - return sheepfold; - } - - public void setComment(String comment) { - this.comment = comment; - } - - public String getComment() { - return comment; - } - - public void setTechnician(String technician) { - this.technician = technician; - } - - public String getTechnician() { - return technician; - } - - public String getSheepfoldName() { - return sheepfoldName; - } - public void setSheepfoldName(String sheepfoldName) { - this.sheepfoldName = sheepfoldName; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("sheepId", getSheepId()) - .append("sheepfold", getSheepfold()) - .append("comment", getComment()) - .append("technician", getTechnician()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .toString(); - } } diff --git a/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/domain/ScFixHoof.java b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/domain/ScFixHoof.java index 7dabc59..57bd187 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/domain/ScFixHoof.java +++ b/zhyc-module/src/main/java/com/zhyc/module/produce/other/fixHoof/domain/ScFixHoof.java @@ -35,6 +35,13 @@ public class ScFixHoof extends BaseEntity @Excel(name = "羊舍名称") private String sheepfoldName; + /** 品种id */ + private Long varietyId; + + /** 品种名称(联表查询返回,非数据库字段) */ + @Excel(name = "品种") + private String varietyName; + /** 备注 */ @Excel(name = "备注") private String comment; diff --git a/zhyc-module/src/main/resources/mapper/produce/manage_sheep/add_sheep/ScAddSheepMapper.xml b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/add_sheep/ScAddSheepMapper.xml index 9f4de89..fa44bff 100644 --- a/zhyc-module/src/main/resources/mapper/produce/manage_sheep/add_sheep/ScAddSheepMapper.xml +++ b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/add_sheep/ScAddSheepMapper.xml @@ -4,78 +4,94 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - INSERT INTO sc_add_sheep - (ear_number, sheepfold, father, mother, born_weight, birthday, gender, parity, - variety_id, join_date, comment, technician, create_by, create_time) - VALUES (#{earNumber}, #{sheepfold}, #{father}, #{mother}, #{bornWeight}, #{birthday}, - #{gender}, #{parity}, #{varietyId}, #{joinDate}, #{comment}, #{technician}, - #{createBy}, #{createTime}) - - - + + + + + + + INSERT INTO sc_add_sheep + (ear_number, sheepfold, father, mother, born_weight, birthday, + gender, parity, variety_id, join_date, comment, technician, + create_by, create_time) + VALUES + (#{earNumber}, #{sheepfold}, #{father}, #{mother}, #{bornWeight}, + #{birthday}, #{gender}, #{parity}, #{varietyId}, #{joinDate}, + #{comment}, #{technician}, #{createBy}, #{createTime}) + + + UPDATE sc_add_sheep - ear_number = #{earNumber}, - sheepfold = #{sheepfold}, - father = #{father}, - mother = #{mother}, - born_weight = #{bornWeight}, - birthday = #{birthday}, - gender = #{gender}, - parity = #{parity}, - variety_id = #{varietyId}, - join_date = #{joinDate}, - comment = #{comment}, - technician = #{technician}, - update_by = #{updateBy}, - update_time = NOW() + ear_number = #{earNumber}, + sheepfold = #{sheepfold}, + father = #{father}, + mother = #{mother}, + born_weight = #{bornWeight}, + birthday = #{birthday}, + gender = #{gender}, + parity = #{parity}, + variety_id = #{varietyId}, + join_date = #{joinDate}, + comment = #{comment}, + technician = #{technician}, + update_by = #{updateBy}, + update_time = NOW() WHERE id = #{id} + DELETE FROM sc_add_sheep WHERE id IN #{id} - - \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/produce/manage_sheep/trans_group/ScTransGroupMapper.xml b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/trans_group/ScTransGroupMapper.xml index 665ec43..e0d4df0 100644 --- a/zhyc-module/src/main/resources/mapper/produce/manage_sheep/trans_group/ScTransGroupMapper.xml +++ b/zhyc-module/src/main/resources/mapper/produce/manage_sheep/trans_group/ScTransGroupMapper.xml @@ -10,6 +10,8 @@ + + @@ -23,6 +25,8 @@ tg.fold_to, tg.fold_from, tg.reason, + tg.variety_id, + bv.variety AS varietyName, tg.technician, tg.status, tg.comment, @@ -33,15 +37,17 @@ FROM sc_trans_group tg LEFT JOIN da_sheepfold sf_from ON tg.fold_from = sf_from.id LEFT JOIN da_sheepfold sf_to ON tg.fold_to = sf_to.id + LEFT JOIN bas_sheep_variety bv ON tg.variety_id = bv.id - + insert into sc_trans_group sheep_id, fold_to, fold_from, - reason, + variety_id, + reason, technician, status, comment, @@ -71,7 +79,8 @@ #{sheepId}, #{foldTo}, #{foldFrom}, - #{reason}, + #{varietyId}, + #{reason}, #{technician}, #{status}, #{comment}, @@ -86,14 +95,15 @@ sheep_id = #{sheepId}, fold_to = #{foldTo}, fold_from = #{foldFrom}, - reason = #{reason}, + variety_id = #{varietyId}, + reason = #{reason}, technician = #{technician}, status = #{status}, comment = #{comment}, create_by = #{createBy}, create_time = #{createTime}, - where sc_trans_group.id = #{id} + where id = #{id} diff --git a/zhyc-module/src/main/resources/mapper/produce/other/castrate/ScCastrateMapper.xml b/zhyc-module/src/main/resources/mapper/produce/other/castrate/ScCastrateMapper.xml index dcbaba7..1d067c0 100644 --- a/zhyc-module/src/main/resources/mapper/produce/other/castrate/ScCastrateMapper.xml +++ b/zhyc-module/src/main/resources/mapper/produce/other/castrate/ScCastrateMapper.xml @@ -9,6 +9,7 @@ + @@ -19,12 +20,15 @@ sc.sheep_id, sc.sheepfold, sf.sheepfold_name as sheepfoldName, + sc.variety_id, + bv.variety as varietyName, sc.comment, sc.technician, sc.create_by, sc.create_time from sc_castrate sc left join da_sheepfold sf on sc.sheepfold = sf.id + left join bas_sheep_variety bv on sc.variety_id = bv.id @@ -49,6 +57,7 @@ sheep_id, sheepfold, + variety_id, comment, technician, create_by, @@ -57,6 +66,7 @@ #{sheepId}, #{sheepfold}, + #{varietyId}, #{comment}, #{technician}, #{createBy}, @@ -69,6 +79,7 @@ sheep_id = #{sheepId}, sheepfold = #{sheepfold}, + variety_id = #{varietyId}, comment = #{comment}, technician = #{technician}, create_by = #{createBy}, diff --git a/zhyc-module/src/main/resources/mapper/produce/other/fixHoof/ScFixHoofMapper.xml b/zhyc-module/src/main/resources/mapper/produce/other/fixHoof/ScFixHoofMapper.xml index 3ec4178..d3e7661 100644 --- a/zhyc-module/src/main/resources/mapper/produce/other/fixHoof/ScFixHoofMapper.xml +++ b/zhyc-module/src/main/resources/mapper/produce/other/fixHoof/ScFixHoofMapper.xml @@ -8,6 +8,7 @@ + @@ -20,12 +21,15 @@ fh.sheep_id, fh.sheepfold, sf.sheepfold_name as sheepfoldName, + fh.variety_id, + bv.variety as varietyName, fh.comment, fh.technician, fh.create_by, fh.create_time from sc_fix_hoof fh left join da_sheepfold sf on fh.sheepfold = sf.id + left join bas_sheep_variety bv on fh.variety_id = bv.id - - insert into sc_fix_hoof - - and fh.sheep_id like concat('%', #{sheepId}, '%') - and fh.sheepfold = #{sheepfold} - comment, - technician, - create_by, - create_time, - - - #{sheepId}, - #{sheepfold}, - #{comment}, - #{technician}, - #{createBy}, - #{createTime}, - + + INSERT INTO sc_fix_hoof + (sheep_id, + sheepfold, + variety_id, + comment, + technician, + create_by, + create_time) + VALUES + (#{sheepId}, + #{sheepfold}, + #{varietyId}, + #{comment}, + #{technician}, + #{createBy}, + #{createTime}) @@ -69,6 +76,7 @@ sheep_id = #{sheepId}, sheepfold = #{sheepfold}, + variety_id=#{varietyId}, comment = #{comment}, technician = #{technician}, create_by = #{createBy},