Compare commits

..

No commits in common. "11ede5a585c17204a26a9e4087823bb6344921c8" and "3841321ee7463c67f6eec2614978507b98c8831d" have entirely different histories.

9 changed files with 44 additions and 274 deletions

View File

@ -9,180 +9,72 @@ import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import org.springframework.data.annotation.AccessType;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 体尺测量对象 sc_body_measure
*
*
* @author ruoyi
* @date 2025-07-27
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ScBodyMeasure extends BaseEntity {
public class ScBodyMeasure extends BaseEntity
{
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
/** $column.columnComment */
private Long id;
/**
* 耳号
*/
/** 耳号 */
private Long sheepId;
@Excel(name = "耳号")
private String manageTags;
/**
* 羊舍ID
*/
private Long sheepfoldId;
@Excel(name = "羊舍")
/** 羊舍名称(用于展示) */
private String sheepfoldName;
/**
* 品种ID关联羊只表
*/
private Long varietyId;
/**
* 品种名称用于展示
*/
@Excel(name = "羊只品种")
private String varietyName;
/**
* 事件类型
*/
@Excel(name = "事件类型")
private String eventType;
/**
* 测量日期
*/
@Excel(name = "测量日期")
private LocalDate measureDate;
/**
* 羊只类别
*/
private Long sheepTypeId;
@Excel(name = "羊只类别")
private String sheepTypeName;
/**
* 性别
*/
@Excel(name = "性别", readConverterExp = "1=母,2=公,3=阉羊")
private String gender;
/**
* 胎次
*/
private Integer parity;
/**
* 出生体重
*/
private BigDecimal birthWeight;
/**
* 断奶体重
*/
private BigDecimal weaningWeight;
/**
* 当前体重
*/
private BigDecimal currentWeight;
/**
* 体高
*/
/** 体高 */
@Excel(name = "体高")
private Long height;
/**
* 胸围
*/
/** 胸围 */
@Excel(name = "胸围")
private Long bust;
/**
* 体斜长
*/
/** 体斜长 */
@Excel(name = "体斜长")
private Long bodyLength;
/**
* 管围
*/
/** 管围 */
@Excel(name = "管围")
private Long pipeLength;
/**
* 胸深
*/
/** 胸深 */
@Excel(name = "胸深")
private Long chestDepth;
/**
* 臀高
*/
/** 臀高 */
@Excel(name = "臀高")
private Long hipHeight;
/**
* 尻宽
*/
/** 尻宽 */
@Excel(name = "尻宽")
private Long rumpWidth;
/**
* 尻高
*/
/** 尻高 */
@Excel(name = "尻高")
private Long rumpHeignt;
/**
* 腰角宽
*/
/** 腰角宽 */
@Excel(name = "腰角宽")
private Long hipWidth;
/**
* 十字部高
*/
/** 十字部高 */
@Excel(name = "十字部高")
private Long hipCrossHeight;
/**
* 繁育状态
*/
@Excel(name = "繁育状态")
private String breedStatusName;
/**
* 泌乳天数
*/
@Excel(name = "泌乳天数")
private Integer lactationDay;
/**
* 怀孕天数
*/
@Excel(name = "怀孕天数")
private Integer gestationDay;
/**
* 配后天数
*/
@Excel(name = "配后天数")
private Integer postMatingDay;
/**
* 备注
*/
/** 备注 */
@Excel(name = "备注")
private String comment;
/**
* 技术员
*/
/** 技术员 */
@Excel(name = "技术员")
private String technician;

View File

@ -34,20 +34,6 @@ public class ScBodyScore extends BaseEntity {
private String sheepId;
@Excel(name = "管理耳号")
private String manageTags;
/**
* 品种
*/
private Long varietyId;
@Excel(name = "品种")
private String varietyName;
/**
* 事件类型
*/
@Excel(name = "事件类型")
private String eventType;
/**
* 事件日期
*/
@ -65,7 +51,7 @@ public class ScBodyScore extends BaseEntity {
* 羊舍id
*/
private Long sheepfold;
@Excel(name = "羊舍")
@Excel(name = "羊舍名称")
private String sheepfoldName;
/**
* 备注

View File

@ -1,6 +1,5 @@
package com.zhyc.module.produce.bodyManage.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -9,8 +8,6 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.time.LocalDate;
/**
* 乳房评分对象 sc_breast_rating
*
@ -35,35 +32,6 @@ public class ScBreastRating extends BaseEntity {
private String sheepId;
@Excel(name = "羊只id")
private String manageTags;
/**
* 品种
*/
private Long varietyId;
@Excel(name = "品种")
private String varietyName;
/**
* 事件类型
*/
@Excel(name = "事件类型")
private String eventType;
/**
* 事件日期
*/
@Excel(name = "事件日期")
private LocalDate eventDate;
/**
* 羊舍ID
*/
private Long sheepfoldId;
@Excel(name = "羊舍")
/** 羊舍名称(用于展示) */
private String sheepfoldName;
/**
* 乳房深度
*/

View File

@ -8,18 +8,6 @@
<result property="id" column="id"/>
<result property="sheepId" column="sheep_id"/>
<result property="manageTags" column="manage_tags"/>
<result property="sheepfoldId" column="sheepfold_id"/>
<result property="sheepfoldName" column="sheepfold_name"/>
<result property="varietyId" column="variety_id"/>
<result property="varietyName" column="variety_name"/>
<result property="eventType" column="event_type"/>
<result property="sheepTypeName" column="sheep_type_name"/>
<result property="measureDate" column="measure_date"/>
<result property="gender" column="gender"/>
<result property="parity" column="parity"/>
<result property="birthWeight" column="birth_weight"/>
<result property="weaningWeight" column="weaning_weight"/>
<result property="currentWeight" column="current_weight"/>
<result property="height" column="height"/>
<result property="bust" column="bust"/>
<result property="bodyLength" column="body_length"/>
@ -30,10 +18,6 @@
<result property="rumpHeignt" column="rump_heignt"/>
<result property="hipWidth" column="hip_width"/>
<result property="hipCrossHeight" column="hip_cross_height"/>
<result property="breedStatusName" column="breed_status_name"/>
<result property="lactationDay" column="lactation_day"/>
<result property="gestationDay" column="gestation_day"/>
<result property="postMatingDay" column="post_mating_day"/>
<result property="comment" column="comment"/>
<result property="technician" column="technician"/>
<result property="createBy" column="create_by"/>
@ -44,18 +28,6 @@
select sm.id,
sm.sheep_id,
bs.manage_tags,
ds.id as sheepfold_id,
ds.sheepfold_name,
bsv.id as variety_id,
bsv.variety as variety_name,
'体尺测量' as event_type,
bst.name as sheep_type_name,
sm.measure_date,
bs.gender,
bs.parity,
bs.birth_weight as birth_weight,
bs.weaning_weight as weaning_weight,
bs.current_weight as current_weight,
sm.height,
sm.bust,
sm.body_length,
@ -66,38 +38,21 @@
sm.rump_heignt,
sm.hip_width,
sm.hip_cross_height,
bbs.breed as breed_status_name,
bs.lactation_day as lactation_day,
bs.gestation_day as gestation_day,
case when bs.mating_date is not null
then DATEDIFF(NOW(), bs.mating_date)
else null
end as post_mating_day,
sm.comment,
sm.technician,
sm.create_by,
sm.create_time
from sc_body_measure sm
LEFT JOIN bas_sheep bs ON sm.sheep_id = bs.id
LEFT JOIN bas_breed_status bbs ON bs.breed_status_id = bbs.id
LEFT JOIN da_sheepfold ds ON bs.sheepfold_id = ds.id
LEFT JOIN bas_sheep_type bst ON bs.type_id = bst.id
LEFT JOIN bas_sheep_variety bsv ON bs.variety_id = bsv.id
left join bas_sheep bs on sm.sheep_id = bs.id
</sql>
<select id="selectScBodyMeasureList" parameterType="ScBodyMeasure" resultMap="ScBodyMeasureResult">
<include refid="selectScBodyMeasureVo"/>
<where>
<if test="sheepId != null ">and sm.sheep_id = #{sheepId}</if>
<if test="params.beginMeasureDate != null and params.endMeasureDate != null">
and sm.measure_date between #{params.beginMeasureDate} and #{params.endMeasureDate}
</if>
<if test="manageTags != null and manageTags != ''">
and bs.manage_tags like concat('%', #{manageTags}, '%')
</if>
<if test="sheepfoldId != null">AND bs.sheepfold_id = #{sheepfoldId}</if>
<if test="varietyId != null">AND bsv.id = #{varietyId}</if>
<if test="sheepTypeId != null">and bs.type_id = #{sheepTypeId}</if>
<if test="params.beginCreateTime != null and params.endCreateTime != null">
and sm.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
@ -113,7 +68,6 @@
insert into sc_body_measure
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sheepId != null">sheep_id,</if>
<if test="measureDate != null">measure_date,</if>
<if test="height != null">height,</if>
<if test="bust != null">bust,</if>
<if test="bodyLength != null">body_length,</if>
@ -131,7 +85,6 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
<if test="measureDate != null">#{measureDate},</if>
<if test="height != null">#{height},</if>
<if test="bust != null">#{bust},</if>
<if test="bodyLength != null">#{bodyLength},</if>
@ -153,7 +106,6 @@
update sc_body_measure
<trim prefix="SET" suffixOverrides=",">
<if test="sheepId != null">sheep_id = #{sheepId},</if>
<if test="measureDate != null">measure_date = #{measureDate},</if>
<if test="height != null">height = #{height},</if>
<if test="bust != null">bust = #{bust},</if>
<if test="bodyLength != null">body_length = #{bodyLength},</if>

View File

@ -8,13 +8,9 @@
<result property="id" column="id"/>
<result property="sheepId" column="sheep_id"/>
<result property="manageTags" column="manage_tags"/>
<result property="varietyId" column="varietyId"/>
<result property="varietyName" column="varietyName"/>
<result property="eventType" column="event_type"/>
<result property="datetime" column="datetime"/>
<result property="score" column="score"/>
<result property="sheepfold" column="sheepfold"/>
<result property="sheepfoldName" column="sheepfoldName"/>
<result property="comment" column="comment"/>
<result property="technician" column="technician"/>
<result property="createBy" column="create_by"/>
@ -25,11 +21,9 @@
select sbs.id,
sbs.sheep_id,
bs.manage_tags,
bsv.id as varietyId,
bsv.variety as varietyName,
'体况评分' as event_type,
sbs.datetime,
sbs.score,
sbs.sheepfold,
ds.sheepfold_name as sheepfoldName,
sbs.comment,
sbs.technician,
@ -37,20 +31,18 @@
sbs.create_time
from sc_body_score sbs
left join bas_sheep bs on sbs.sheep_id = bs.id
left join da_sheepfold ds on bs.sheepfold_id = ds.id
left join bas_sheep_variety bsv on bs.variety_id = bsv.id
left join da_sheepfold ds on sbs.sheepfold = ds.id
</sql>
<select id="selectScBodyScoreList" parameterType="ScBodyScore" resultMap="ScBodyScoreResult">
<include refid="selectScBodyScoreVo"/>
<where>
<if test="sheepId != null and sheepId != ''">and sbs.sheep_id = #{sheepId}</if>
<if test="varietyId != null">and bsv.id = #{varietyId}</if>
<if test="sheepfold != null">and bs.sheepfold_id = #{sheepfold}</if>
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''">
and sbs.datetime between #{params.beginDatetime} and #{params.endDatetime}
</if>
<if test="score != null ">and score = #{score}</if>
<if test="sheepfold != null ">and sheepfold = #{sheepfold}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and sbs.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>

View File

@ -8,12 +8,6 @@
<result property="id" column="id"/>
<result property="sheepId" column="sheep_id"/>
<result property="manageTags" column="manageTags"/>
<result property="varietyId" column="varietyId"/>
<result property="varietyName" column="varietyName"/>
<result property="eventType" column="event_type"/>
<result property="eventDate" column="event_date"/>
<result property="sheepfoldId" column="sheepfoldId"/>
<result property="sheepfoldName" column="sheepfoldName"/>
<result property="depth" column="depth"/>
<result property="length" column="length"/>
<result property="position" column="position"/>
@ -28,17 +22,9 @@
<sql id="selectScBreastRatingVo">
select sbr.*,
bs.manage_tags as manageTags,
bsv.id as varietyId,
bsv.variety as varietyName,
'乳房评分' as event_type,
sf.id as sheepfoldId,
sf.sheepfold_name as sheepfoldName,
sbr.event_date
bs.manage_tags as manageTags
from sc_breast_rating sbr
left join bas_sheep bs on sbr.sheep_id = bs.id
left join bas_sheep_variety bsv on bs.variety_id = bsv.id
left join da_sheepfold sf on bs.sheepfold_id = sf.id
</sql>
<select id="selectScBreastRatingList" parameterType="ScBreastRating" resultMap="ScBreastRatingResult">
@ -47,11 +33,6 @@
<if test="manageTags != null and manageTags != ''">
and bs.manage_tags like concat('%', #{manageTags}, '%')
</if>
<if test="varietyId != null">and bsv.id = #{varietyId}</if>
<if test="sheepfoldId != null">and sf.id = #{sheepfoldId}</if>
<if test="params.beginEventDate != null and params.endEventDate != null">
and sbr.event_date between #{params.beginEventDate} and #{params.endEventDate}
</if>
<if test="params.beginCreateTime != null and params.endCreateTime != null">
and sbr.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
@ -67,7 +48,6 @@
insert into sc_breast_rating
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sheepId != null">sheep_id,</if>
<if test="eventDate != null">event_date,</if>
<if test="depth != null">depth,</if>
<if test="length != null">length,</if>
<if test="position != null">position,</if>
@ -81,7 +61,6 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
<if test="eventDate != null">#{eventDate},</if>
<if test="depth != null">#{depth},</if>
<if test="length != null">#{length},</if>
<if test="position != null">#{position},</if>
@ -99,7 +78,6 @@
update sc_breast_rating
<trim prefix="SET" suffixOverrides=",">
<if test="sheepId != null">sheep_id = #{sheepId},</if>
<if test="eventDate != null">event_date = #{eventDate},</if>
<if test="depth != null">depth = #{depth},</if>
<if test="length != null">length = #{length},</if>
<if test="position != null">position = #{position},</if>

View File

@ -36,8 +36,8 @@
ELSE '未知状态'
END AS statusText
FROM sc_transition_info t
LEFT JOIN bas_sheep_variety bv ON t.variety_id = bv.id
LEFT JOIN bas_sheep bs ON t.sheep_id = bs.id
LEFT JOIN bas_sheep_variety bv ON bs.variety_id = bv.id
</sql>
<select id="selectScTransitionInfoList" parameterType="ScTransitionInfo" resultMap="ScTransitionInfoResult">
@ -47,7 +47,7 @@
<if test="manageTags != null and manageTags != ''">
and bs.manage_tags LIKE CONCAT('%', #{manageTags}, '%')
</if>
<if test="varietyId != null">and bs.variety_id = #{varietyId}</if>
<if test="varietyId != null">and t.variety_id = #{varietyId}</if>
<if test="transTo != null and transTo != ''">and trans_to = #{transTo}</if>
<if test="transFrom != null and transFrom != ''">and trans_from = #{transFrom}</if>
<if test="status != null ">and status = #{status}</if>

View File

@ -21,19 +21,19 @@
<sql id="selectScCastrateVo">
select sc.id,
sc.sheep_id,
bs.manage_tags as manageTags,
bs.sheepfold_id as sheepfold,
bs.manage_tags as manageTags,
sc.sheepfold,
sf.sheepfold_name as sheepfoldName,
bs.variety_id as varietyId,
bv.variety as varietyName,
sc.variety_id,
bv.variety as varietyName,
sc.comment,
sc.technician,
sc.create_by,
sc.create_time
from sc_castrate sc
left join bas_sheep bs on sc.sheep_id = bs.id
left join da_sheepfold sf on bs.sheepfold_id = sf.id
left join bas_sheep_variety bv on bs.variety_id = bv.id
left join da_sheepfold sf on sc.sheepfold = sf.id
left join bas_sheep_variety bv on sc.variety_id = bv.id
</sql>
<select id="selectScCastrateList" parameterType="ScCastrate" resultMap="ScCastrateResult">
@ -42,8 +42,8 @@
<if test="manageTags != null and manageTags != ''">
and bs.manage_tags like concat('%', #{manageTags}, '%')
</if>
<if test="sheepfold != null ">and bs.sheepfold_id = #{sheepfold}</if>
<if test="varietyId != null">and bs.variety_id = #{varietyId}</if>
<if test="sheepfold != null ">and sc.sheepfold = #{sheepfold}</if>
<if test="varietyId != null">and sc.variety_id = #{varietyId}</if>
<if test="technician != null and technician != ''">and sc.technician like concat('%', #{technician}, '%')
</if>
<if test="params.beginCreateTime != null and params.endCreateTime != null">

View File

@ -18,27 +18,29 @@
<sql id="selectScFixHoofVo">
select fh.id,
bs.manage_tags as manageTags,
bs.sheepfold_id as sheepfold,
sf.sheepfold_name as sheepfoldName,
bs.variety_id as varietyId,
bv.variety as varietyName,
bs.manage_tags AS manageTags,
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 bas_sheep bs on fh.sheep_id = bs.id
left join da_sheepfold sf on bs.sheepfold_id = sf.id
left join bas_sheep_variety bv on bs.variety_id = bv.id
left join da_sheepfold sf on fh.sheepfold = sf.id
left join bas_sheep_variety bv on fh.variety_id = bv.id
</sql>
<select id="selectScFixHoofList" parameterType="ScFixHoof" resultMap="ScFixHoofResult">
<include refid="selectScFixHoofVo"/>
<where>
<if test="sheepId != null ">and sheep_id = #{sheepId}</if>
<if test="sheepfold != null ">and bs.sheepfold_id = #{sheepfold}</if>
<if test="varietyId != null">and bs.variety_id = #{varietyId}</if>
<if test="sheepfold != null ">and sheepfold = #{sheepfold}</if>
<if test="varietyId != null">
and fh.variety_id = #{varietyId}
</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and fh.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>