种公羊档案修改

This commit is contained in:
zyk 2025-12-25 19:03:04 +08:00
parent 54f7df70ca
commit 8b4ddc5acd
3 changed files with 1131 additions and 0 deletions

View File

@ -0,0 +1,897 @@
package com.zhyc.module.base.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
/**
* 种公羊档案视图对象 view_breed_ram_file
*
* @author zhyc
* @date 2025-07-29
*/
public class ViewBreedRamFile extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 种公羊id */
private Long id;
/** 普通耳号 */
@Excel(name = "普通耳号")
private String ordinaryEarNumber;
/** 牧场id */
@Excel(name = "牧场id")
private Long ranchId;
/** 牧场名称 */
@Excel(name = "牧场名称")
private String ranchName;
/** 羊舍id */
@Excel(name = "羊舍id")
private Long sheepfoldId;
/** 羊舍名称 */
@Excel(name = "羊舍名称")
private String sheepfoldName;
/** 电子耳号 */
@Excel(name = "电子耳号")
private String electronicTags;
/** 品种id */
@Excel(name = "品种id")
private Long varietyId;
/** 品种 */
@Excel(name = "品种")
private String variety;
/** 羊只类别 */
@Excel(name = "羊只类别")
private String sheepCategory;
/** 性别 */
@Excel(name = "性别")
private Long gender;
/** 生日 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
private Date birthday;
/** 月龄 */
@Excel(name = "月龄")
private Long monthAge;
/** 出生体重 */
@Excel(name = "出生体重")
private BigDecimal birthWeight;
/** 断奶日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "断奶日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date weaningDate;
/** 断奶日龄 */
@Excel(name = "断奶日龄")
private Long weaningDayAge;
/** 断奶体重 */
@Excel(name = "断奶体重")
private BigDecimal weaningWeight;
/** 断奶日增重 */
@Excel(name = "断奶日增重")
private BigDecimal weaningDailyGain;
/** 当前体重 */
@Excel(name = "当前体重")
private BigDecimal currentWeight;
/** 配种状态id */
@Excel(name = "配种状态id")
private Long breedingStatusId;
/** 配种状态 */
@Excel(name = "配种状态")
private String breedingStatus;
/** 父号id */
@Excel(name = "父号id")
private Long fatherId;
/** 父号 */
@Excel(name = "父号")
private String fatherEarNumber;
/** 母号id */
@Excel(name = "母号id")
private Long motherId;
/** 母号 */
@Excel(name = "母号")
private String motherEarNumber;
/** 祖父id */
@Excel(name = "祖父id")
private Long grandfatherId;
/** 祖父 */
@Excel(name = "祖父")
private String grandfatherEarNumber;
/** 祖母id */
@Excel(name = "祖母id")
private Long grandmotherId;
/** 祖母 */
@Excel(name = "祖母")
private String grandmotherEarNumber;
/** 外祖父 */
@Excel(name = "外祖父")
private String maternalGrandfatherEarNumber;
/** 外祖母 */
@Excel(name = "外祖母")
private String maternalGrandmotherEarNumber;
/** 配种日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "配种日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date matingDate;
/** 配种类型 */
@Excel(name = "配种类型")
private Long matingTypeId;
/** 孕检日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "孕检日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date pregnancyCheckDate;
/** 产羔日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "产羔日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date lambingDate;
/** 产羔时怀孕天数 */
@Excel(name = "产羔时怀孕天数")
private Long lambingDay;
/** 配种天数 */
@Excel(name = "配种天数")
private Long matingDay;
/** 怀孕天数 */
@Excel(name = "怀孕天数")
private Long gestationDay;
/** 预产日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "预产日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date expectedDate;
/** 产后天数 */
@Excel(name = "产后天数")
private Long postLambingDay;
/** 泌乳天数 */
@Excel(name = "泌乳天数")
private Long lactationDay;
/** 空怀天数 */
@Excel(name = "空怀天数")
private Long anestrusDay;
/** 配种次数 */
@Excel(name = "配种次数")
private Long matingCounts;
/** 总配次数 */
@Excel(name = "总配次数")
private Long matingTotal;
/** 流产次数 */
@Excel(name = "流产次数")
private Long miscarriageCounts;
/** 备注 */
@Excel(name = "备注")
private String comment;
/** 是否性控 */
@Excel(name = "是否性控")
private Long controlled;
/** 体况评分 */
@Excel(name = "体况评分")
private BigDecimal bodyConditionScore;
/** 乳房评分 */
@Excel(name = "乳房评分")
private Long udderScore;
/** 入群来源 */
@Excel(name = "入群来源")
private String source;
/** 入群日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入群日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date sourceDate;
/** 来源牧场id */
@Excel(name = "来源牧场id")
private Long sourceRanchId;
/** 来源牧场 */
@Excel(name = "来源牧场")
private String sourceRanch;
/** 性欲情况 */
@Excel(name = "性欲情况")
private String sexualStatus;
/** 阴囊周长 */
@Excel(name = "阴囊周长")
private BigDecimal scrotumCircumference;
/** 采精时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "采精时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date spermCollectionTime;
/** 精液量 */
@Excel(name = "精液量")
private BigDecimal spermVolume;
/** 精液活力 */
@Excel(name = "精液活力")
private String spermVitality;
/** 精液密度 */
@Excel(name = "精液密度")
private String spermDensity;
/** 精液品质 */
@Excel(name = "精液品质")
private String semenQuality;
/** 总配母羊数 */
@Excel(name = "总配母羊数")
private Long totalMatedEwes;
/** 总孕检母羊数 */
@Excel(name = "总孕检母羊数")
private Long totalPregnantEwes;
/** 本交孕检母羊数 */
@Excel(name = "本交孕检母羊数")
private Long naturalPregnancyCheckEwes;
/** 本交受孕率% */
@Excel(name = "本交受孕率%")
private BigDecimal naturalConceptionRate;
/** 人工孕检母羊数 */
@Excel(name = "人工孕检母羊数")
private Long artificialPregnancyCheckEwes;
/** 人工受孕率% */
@Excel(name = "人工受孕率%")
private BigDecimal artificialConceptionRate;
/** 公羊后代数 */
@Excel(name = "公羊后代数")
private Long offspringCount;
/** 多胎性 */
@Excel(name = "多胎性")
private BigDecimal prolificacy;
/** 是否删除 */
private Long isDelete;
// Getters and Setters
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getOrdinaryEarNumber() {
return ordinaryEarNumber;
}
public void setOrdinaryEarNumber(String ordinaryEarNumber) {
this.ordinaryEarNumber = ordinaryEarNumber;
}
public Long getRanchId() {
return ranchId;
}
public void setRanchId(Long ranchId) {
this.ranchId = ranchId;
}
public String getRanchName() {
return ranchName;
}
public void setRanchName(String ranchName) {
this.ranchName = ranchName;
}
public Long getSheepfoldId() {
return sheepfoldId;
}
public void setSheepfoldId(Long sheepfoldId) {
this.sheepfoldId = sheepfoldId;
}
public String getSheepfoldName() {
return sheepfoldName;
}
public void setSheepfoldName(String sheepfoldName) {
this.sheepfoldName = sheepfoldName;
}
public String getElectronicTags() {
return electronicTags;
}
public void setElectronicTags(String electronicTags) {
this.electronicTags = electronicTags;
}
public Long getVarietyId() {
return varietyId;
}
public void setVarietyId(Long varietyId) {
this.varietyId = varietyId;
}
public String getVariety() {
return variety;
}
public void setVariety(String variety) {
this.variety = variety;
}
public String getSheepCategory() {
return sheepCategory;
}
public void setSheepCategory(String sheepCategory) {
this.sheepCategory = sheepCategory;
}
public Long getGender() {
return gender;
}
public void setGender(Long gender) {
this.gender = gender;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public Long getMonthAge() {
return monthAge;
}
public void setMonthAge(Long monthAge) {
this.monthAge = monthAge;
}
public BigDecimal getBirthWeight() {
return birthWeight;
}
public void setBirthWeight(BigDecimal birthWeight) {
this.birthWeight = birthWeight;
}
public Date getWeaningDate() {
return weaningDate;
}
public void setWeaningDate(Date weaningDate) {
this.weaningDate = weaningDate;
}
public Long getWeaningDayAge() {
return weaningDayAge;
}
public void setWeaningDayAge(Long weaningDayAge) {
this.weaningDayAge = weaningDayAge;
}
public BigDecimal getWeaningWeight() {
return weaningWeight;
}
public void setWeaningWeight(BigDecimal weaningWeight) {
this.weaningWeight = weaningWeight;
}
public BigDecimal getWeaningDailyGain() {
return weaningDailyGain;
}
public void setWeaningDailyGain(BigDecimal weaningDailyGain) {
this.weaningDailyGain = weaningDailyGain;
}
public BigDecimal getCurrentWeight() {
return currentWeight;
}
public void setCurrentWeight(BigDecimal currentWeight) {
this.currentWeight = currentWeight;
}
public Long getBreedingStatusId() {
return breedingStatusId;
}
public void setBreedingStatusId(Long breedingStatusId) {
this.breedingStatusId = breedingStatusId;
}
public String getBreedingStatus() {
return breedingStatus;
}
public void setBreedingStatus(String breedingStatus) {
this.breedingStatus = breedingStatus;
}
public Long getFatherId() {
return fatherId;
}
public void setFatherId(Long fatherId) {
this.fatherId = fatherId;
}
public String getFatherEarNumber() {
return fatherEarNumber;
}
public void setFatherEarNumber(String fatherEarNumber) {
this.fatherEarNumber = fatherEarNumber;
}
public Long getMotherId() {
return motherId;
}
public void setMotherId(Long motherId) {
this.motherId = motherId;
}
public String getMotherEarNumber() {
return motherEarNumber;
}
public void setMotherEarNumber(String motherEarNumber) {
this.motherEarNumber = motherEarNumber;
}
public Long getGrandfatherId() {
return grandfatherId;
}
public void setGrandfatherId(Long grandfatherId) {
this.grandfatherId = grandfatherId;
}
public String getGrandfatherEarNumber() {
return grandfatherEarNumber;
}
public void setGrandfatherEarNumber(String grandfatherEarNumber) {
this.grandfatherEarNumber = grandfatherEarNumber;
}
public Long getGrandmotherId() {
return grandmotherId;
}
public void setGrandmotherId(Long grandmotherId) {
this.grandmotherId = grandmotherId;
}
public String getGrandmotherEarNumber() {
return grandmotherEarNumber;
}
public void setGrandmotherEarNumber(String grandmotherEarNumber) {
this.grandmotherEarNumber = grandmotherEarNumber;
}
public String getMaternalGrandfatherEarNumber() {
return maternalGrandfatherEarNumber;
}
public void setMaternalGrandfatherEarNumber(String maternalGrandfatherEarNumber) {
this.maternalGrandfatherEarNumber = maternalGrandfatherEarNumber;
}
public String getMaternalGrandmotherEarNumber() {
return maternalGrandmotherEarNumber;
}
public void setMaternalGrandmotherEarNumber(String maternalGrandmotherEarNumber) {
this.maternalGrandmotherEarNumber = maternalGrandmotherEarNumber;
}
public Date getMatingDate() {
return matingDate;
}
public void setMatingDate(Date matingDate) {
this.matingDate = matingDate;
}
public Long getMatingTypeId() {
return matingTypeId;
}
public void setMatingTypeId(Long matingTypeId) {
this.matingTypeId = matingTypeId;
}
public Date getPregnancyCheckDate() {
return pregnancyCheckDate;
}
public void setPregnancyCheckDate(Date pregnancyCheckDate) {
this.pregnancyCheckDate = pregnancyCheckDate;
}
public Date getLambingDate() {
return lambingDate;
}
public void setLambingDate(Date lambingDate) {
this.lambingDate = lambingDate;
}
public Long getLambingDay() {
return lambingDay;
}
public void setLambingDay(Long lambingDay) {
this.lambingDay = lambingDay;
}
public Long getMatingDay() {
return matingDay;
}
public void setMatingDay(Long matingDay) {
this.matingDay = matingDay;
}
public Long getGestationDay() {
return gestationDay;
}
public void setGestationDay(Long gestationDay) {
this.gestationDay = gestationDay;
}
public Date getExpectedDate() {
return expectedDate;
}
public void setExpectedDate(Date expectedDate) {
this.expectedDate = expectedDate;
}
public Long getPostLambingDay() {
return postLambingDay;
}
public void setPostLambingDay(Long postLambingDay) {
this.postLambingDay = postLambingDay;
}
public Long getLactationDay() {
return lactationDay;
}
public void setLactationDay(Long lactationDay) {
this.lactationDay = lactationDay;
}
public Long getAnestrusDay() {
return anestrusDay;
}
public void setAnestrusDay(Long anestrusDay) {
this.anestrusDay = anestrusDay;
}
public Long getMatingCounts() {
return matingCounts;
}
public void setMatingCounts(Long matingCounts) {
this.matingCounts = matingCounts;
}
public Long getMatingTotal() {
return matingTotal;
}
public void setMatingTotal(Long matingTotal) {
this.matingTotal = matingTotal;
}
public Long getMiscarriageCounts() {
return miscarriageCounts;
}
public void setMiscarriageCounts(Long miscarriageCounts) {
this.miscarriageCounts = miscarriageCounts;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public Long getControlled() {
return controlled;
}
public void setControlled(Long controlled) {
this.controlled = controlled;
}
public BigDecimal getBodyConditionScore() {
return bodyConditionScore;
}
public void setBodyConditionScore(BigDecimal bodyConditionScore) {
this.bodyConditionScore = bodyConditionScore;
}
public Long getUdderScore() {
return udderScore;
}
public void setUdderScore(Long udderScore) {
this.udderScore = udderScore;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public Date getSourceDate() {
return sourceDate;
}
public void setSourceDate(Date sourceDate) {
this.sourceDate = sourceDate;
}
public Long getSourceRanchId() {
return sourceRanchId;
}
public void setSourceRanchId(Long sourceRanchId) {
this.sourceRanchId = sourceRanchId;
}
public String getSourceRanch() {
return sourceRanch;
}
public void setSourceRanch(String sourceRanch) {
this.sourceRanch = sourceRanch;
}
public String getSexualStatus() {
return sexualStatus;
}
public void setSexualStatus(String sexualStatus) {
this.sexualStatus = sexualStatus;
}
public BigDecimal getScrotumCircumference() {
return scrotumCircumference;
}
public void setScrotumCircumference(BigDecimal scrotumCircumference) {
this.scrotumCircumference = scrotumCircumference;
}
public Date getSpermCollectionTime() {
return spermCollectionTime;
}
public void setSpermCollectionTime(Date spermCollectionTime) {
this.spermCollectionTime = spermCollectionTime;
}
public BigDecimal getSpermVolume() {
return spermVolume;
}
public void setSpermVolume(BigDecimal spermVolume) {
this.spermVolume = spermVolume;
}
public String getSpermVitality() {
return spermVitality;
}
public void setSpermVitality(String spermVitality) {
this.spermVitality = spermVitality;
}
public String getSpermDensity() {
return spermDensity;
}
public void setSpermDensity(String spermDensity) {
this.spermDensity = spermDensity;
}
public String getSemenQuality() {
return semenQuality;
}
public void setSemenQuality(String semenQuality) {
this.semenQuality = semenQuality;
}
public Long getTotalMatedEwes() {
return totalMatedEwes;
}
public void setTotalMatedEwes(Long totalMatedEwes) {
this.totalMatedEwes = totalMatedEwes;
}
public Long getTotalPregnantEwes() {
return totalPregnantEwes;
}
public void setTotalPregnantEwes(Long totalPregnantEwes) {
this.totalPregnantEwes = totalPregnantEwes;
}
public Long getNaturalPregnancyCheckEwes() {
return naturalPregnancyCheckEwes;
}
public void setNaturalPregnancyCheckEwes(Long naturalPregnancyCheckEwes) {
this.naturalPregnancyCheckEwes = naturalPregnancyCheckEwes;
}
public BigDecimal getNaturalConceptionRate() {
return naturalConceptionRate;
}
public void setNaturalConceptionRate(BigDecimal naturalConceptionRate) {
this.naturalConceptionRate = naturalConceptionRate;
}
public Long getArtificialPregnancyCheckEwes() {
return artificialPregnancyCheckEwes;
}
public void setArtificialPregnancyCheckEwes(Long artificialPregnancyCheckEwes) {
this.artificialPregnancyCheckEwes = artificialPregnancyCheckEwes;
}
public BigDecimal getArtificialConceptionRate() {
return artificialConceptionRate;
}
public void setArtificialConceptionRate(BigDecimal artificialConceptionRate) {
this.artificialConceptionRate = artificialConceptionRate;
}
public Long getOffspringCount() {
return offspringCount;
}
public void setOffspringCount(Long offspringCount) {
this.offspringCount = offspringCount;
}
public BigDecimal getProlificacy() {
return prolificacy;
}
public void setProlificacy(BigDecimal prolificacy) {
this.prolificacy = prolificacy;
}
public Long getIsDelete() {
return isDelete;
}
public void setIsDelete(Long isDelete) {
this.isDelete = isDelete;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("ordinaryEarNumber", getOrdinaryEarNumber())
.append("ranchId", getRanchId())
.append("ranchName", getRanchName())
.append("sheepfoldId", getSheepfoldId())
.append("sheepfoldName", getSheepfoldName())
.append("electronicTags", getElectronicTags())
.append("varietyId", getVarietyId())
.append("variety", getVariety())
.append("sheepCategory", getSheepCategory())
.append("gender", getGender())
.append("birthday", getBirthday())
.append("monthAge", getMonthAge())
.append("birthWeight", getBirthWeight())
.append("weaningDate", getWeaningDate())
.append("weaningDayAge", getWeaningDayAge())
.append("weaningWeight", getWeaningWeight())
.append("weaningDailyGain", getWeaningDailyGain())
.append("currentWeight", getCurrentWeight())
.append("breedingStatusId", getBreedingStatusId())
.append("breedingStatus", getBreedingStatus())
.append("sexualStatus", getSexualStatus())
.append("scrotumCircumference", getScrotumCircumference())
.append("spermCollectionTime", getSpermCollectionTime())
.append("spermVolume", getSpermVolume())
.append("spermVitality", getSpermVitality())
.append("spermDensity", getSpermDensity())
.append("semenQuality", getSemenQuality())
.append("totalMatedEwes", getTotalMatedEwes())
.append("totalPregnantEwes", getTotalPregnantEwes())
.append("naturalPregnancyCheckEwes", getNaturalPregnancyCheckEwes())
.append("naturalConceptionRate", getNaturalConceptionRate())
.append("artificialPregnancyCheckEwes", getArtificialPregnancyCheckEwes())
.append("artificialConceptionRate", getArtificialConceptionRate())
.append("offspringCount", getOffspringCount())
.append("prolificacy", getProlificacy())
.toString();
}
}

View File

@ -0,0 +1,69 @@
package com.zhyc.module.base.mapper;
import java.util.List;
import com.zhyc.module.base.domain.ViewBreedRamFile;
/**
* 种公羊档案视图Mapper接口
*
* @author zhyc
* @date 2025-07-29
*/
public interface ViewBreedRamFileMapper
{
/**
* 查询种公羊档案视图
*
* @param id 种公羊档案主键
* @return 种公羊档案视图
*/
public ViewBreedRamFile selectViewBreedRamFileById(Long id);
/**
* 查询种公羊档案视图列表
*
* @param viewBreedRamFile 种公羊档案视图
* @return 种公羊档案视图集合
*/
public List<ViewBreedRamFile> selectViewBreedRamFileList(ViewBreedRamFile viewBreedRamFile);
/**
* 根据普通耳号查询种公羊档案视图
*
* @param ordinaryEarNumber 普通耳号
* @return 种公羊档案视图
*/
public ViewBreedRamFile selectViewBreedRamFileByOrdinaryEarNumber(String ordinaryEarNumber);
/**
* 根据牧场ID查询种公羊档案视图列表
*
* @param ranchId 牧场ID
* @return 种公羊档案视图集合
*/
public List<ViewBreedRamFile> selectViewBreedRamFileListByRanchId(Long ranchId);
/**
* 根据羊舍ID查询种公羊档案视图列表
*
* @param sheepfoldId 羊舍ID
* @return 种公羊档案视图集合
*/
public List<ViewBreedRamFile> selectViewBreedRamFileListBySheepfoldId(Long sheepfoldId);
/**
* 查询核心羊群种公羊档案视图列表
*
* @param viewBreedRamFile 种公羊档案视图
* @return 种公羊档案视图集合
*/
public List<ViewBreedRamFile> selectCoreFlockViewBreedRamFileList(ViewBreedRamFile viewBreedRamFile);
/**
* 查询种用种公羊档案视图列表
*
* @param viewBreedRamFile 种公羊档案视图
* @return 种公羊档案视图集合
*/
public List<ViewBreedRamFile> selectBreedingUseViewBreedRamFileList(ViewBreedRamFile viewBreedRamFile);
}

View File

@ -0,0 +1,165 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.base.mapper.ViewBreedRamFileMapper">
<resultMap type="ViewBreedRamFile" id="ViewBreedRamFileResult">
<result property="id" column="id" />
<result property="ordinaryEarNumber" column="ordinary_ear_number" />
<result property="ranchId" column="ranch_id" />
<result property="ranchName" column="ranch_name" />
<result property="sheepfoldId" column="sheepfold_id" />
<result property="sheepfoldName" column="sheepfold_name" />
<result property="electronicTags" column="electronic_tags" />
<result property="varietyId" column="variety_id" />
<result property="variety" column="variety" />
<result property="sheepCategory" column="sheep_category" />
<result property="gender" column="gender" />
<result property="birthday" column="birthday" />
<result property="monthAge" column="month_age" />
<result property="birthWeight" column="birth_weight" />
<result property="weaningDate" column="weaning_date" />
<result property="weaningDayAge" column="weaning_day_age" />
<result property="weaningWeight" column="weaning_weight" />
<result property="weaningDailyGain" column="weaning_daily_gain" />
<result property="currentWeight" column="current_weight" />
<result property="breedingStatusId" column="breeding_status_id" />
<result property="breedingStatus" column="breeding_status" />
<result property="fatherId" column="father_id" />
<result property="fatherEarNumber" column="father_ear_number" />
<result property="motherId" column="mother_id" />
<result property="motherEarNumber" column="mother_ear_number" />
<result property="grandfatherId" column="grandfather_id" />
<result property="grandfatherEarNumber" column="grandfather_ear_number" />
<result property="grandmotherId" column="grandmother_id" />
<result property="grandmotherEarNumber" column="grandmother_ear_number" />
<result property="maternalGrandfatherEarNumber" column="maternal_grandfather_ear_number" />
<result property="maternalGrandmotherEarNumber" column="maternal_grandmother_ear_number" />
<result property="matingDate" column="mating_date" />
<result property="matingTypeId" column="mating_type_id" />
<result property="pregnancyCheckDate" column="pregnancy_check_date" />
<result property="lambingDate" column="lambing_date" />
<result property="lambingDay" column="lambing_day" />
<result property="matingDay" column="mating_day" />
<result property="gestationDay" column="gestation_day" />
<result property="expectedDate" column="expected_date" />
<result property="postLambingDay" column="post_lambing_day" />
<result property="lactationDay" column="lactation_day" />
<result property="anestrusDay" column="anestrous_day" />
<result property="matingCounts" column="mating_counts" />
<result property="matingTotal" column="mating_total" />
<result property="miscarriageCounts" column="miscarriage_counts" />
<result property="comment" column="comment" />
<result property="controlled" column="controlled" />
<result property="bodyConditionScore" column="body_condition_score" />
<result property="udderScore" column="udder_score" />
<result property="source" column="source" />
<result property="sourceDate" column="source_date" />
<result property="sourceRanchId" column="source_ranch_id" />
<result property="sourceRanch" column="source_ranch" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="isDelete" column="is_delete" />
<result property="sexualStatus" column="sexual_status" />
<result property="scrotumCircumference" column="scrotum_circumference" />
<result property="spermCollectionTime" column="sperm_collection_time" />
<result property="spermVolume" column="sperm_volume" />
<result property="spermVitality" column="sperm_vitality" />
<result property="spermDensity" column="sperm_density" />
<result property="semenQuality" column="semen_quality" />
<result property="totalMatedEwes" column="total_mated_ewes" />
<result property="totalPregnantEwes" column="total_pregnant_ewes" />
<result property="naturalPregnancyCheckEwes" column="natural_pregnancy_check_ewes" />
<result property="naturalConceptionRate" column="natural_conception_rate" />
<result property="artificialPregnancyCheckEwes" column="artificial_pregnancy_check_ewes" />
<result property="artificialConceptionRate" column="artificial_conception_rate" />
<result property="offspringCount" column="offspring_count" />
<result property="prolificacy" column="prolificacy" />
</resultMap>
<sql id="selectViewBreedRamFileVo">
select * from view_breed_ram_file
</sql>
<select id="selectViewBreedRamFileList" parameterType="ViewBreedRamFile" resultMap="ViewBreedRamFileResult">
<include refid="selectViewBreedRamFileVo"/>
<where>
is_delete = 0
<if test="ordinaryEarNumber != null and ordinaryEarNumber != ''">
and ordinary_ear_number like concat('%', #{ordinaryEarNumber}, '%')
</if>
<if test="ranchId != null">
and ranch_id = #{ranchId}
</if>
<if test="ranchName != null and ranchName != ''">
and ranch_name like concat('%', #{ranchName}, '%')
</if>
<if test="sheepfoldId != null">
and sheepfold_id = #{sheepfoldId}
</if>
<if test="electronicTags != null and electronicTags != ''">
and electronic_tags like concat('%', #{electronicTags}, '%')
</if>
<if test="variety != null and variety != ''">
and variety like concat('%', #{variety}, '%')
</if>
<if test="breedingStatusId != null">
and breeding_status_id = #{breedingStatusId}
</if>
</where>
order by id desc
</select>
<select id="selectViewBreedRamFileById" parameterType="Long" resultMap="ViewBreedRamFileResult">
<include refid="selectViewBreedRamFileVo"/>
where id = #{id} and is_delete = 0
</select>
<select id="selectViewBreedRamFileByOrdinaryEarNumber" parameterType="String" resultMap="ViewBreedRamFileResult">
<include refid="selectViewBreedRamFileVo"/>
where ordinary_ear_number = #{ordinaryEarNumber} and is_delete = 0
limit 1
</select>
<select id="selectViewBreedRamFileListByRanchId" parameterType="Long" resultMap="ViewBreedRamFileResult">
<include refid="selectViewBreedRamFileVo"/>
where ranch_id = #{ranchId} and is_delete = 0
order by id desc
</select>
<select id="selectViewBreedRamFileListBySheepfoldId" parameterType="Long" resultMap="ViewBreedRamFileResult">
<include refid="selectViewBreedRamFileVo"/>
where sheepfold_id = #{sheepfoldId} and is_delete = 0
order by id desc
</select>
<select id="selectCoreFlockViewBreedRamFileList" parameterType="ViewBreedRamFile" resultMap="ViewBreedRamFileResult">
select vbrf.* from view_breed_ram_file vbrf
inner join breed_ram_file brf on vbrf.id = brf.id
where brf.is_core_flock = 1 and vbrf.is_delete = 0
<if test="ranchId != null">
and vbrf.ranch_id = #{ranchId}
</if>
<if test="varietyId != null">
and vbrf.variety_id = #{varietyId}
</if>
order by vbrf.id desc
</select>
<select id="selectBreedingUseViewBreedRamFileList" parameterType="ViewBreedRamFile" resultMap="ViewBreedRamFileResult">
select vbrf.* from view_breed_ram_file vbrf
inner join breed_ram_file brf on vbrf.id = brf.id
where brf.is_breeding_use = 1 and vbrf.is_delete = 0
<if test="ranchId != null">
and vbrf.ranch_id = #{ranchId}
</if>
<if test="varietyId != null">
and vbrf.variety_id = #{varietyId}
</if>
order by vbrf.id desc
</select>
</mapper>