bug修复以及数据分离操作

This commit is contained in:
zyh
2026-02-09 20:22:51 +08:00
parent 7dbe337a93
commit fb80399602
50 changed files with 876 additions and 253 deletions

View File

@@ -30,10 +30,18 @@
<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="monthAge" column="month_age"/>
<result property="breastDepth" column="breast_depth"/>
<result property="breastPosition" column="breast_position"/>
<result property="breastLength" column="breast_length"/>
<result property="breastAdbere" column="breast_adbere"/>
<result property="breastSpacing" column="breast_spacing"/>
<result property="breastScore" column="breast_score"/>
<result property="bodyScore" column="body_score"/>
<result property="lactationDay" column="lactation_day"/>
<result property="gestationDay" column="gestation_day"/>
<result property="postMatingDay" column="post_mating_day"/>
<result property="breedStatusName" column="breed_status_name"/>
<result property="comment" column="comment"/>
<result property="technician" column="technician"/>
<result property="createBy" column="create_by"/>
@@ -42,47 +50,54 @@
<sql id="selectScBodyMeasureVo">
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,
sm.current_weight as current_weight,
sm.height,
sm.bust,
sm.body_length,
sm.pipe_length,
sm.chest_depth,
sm.hip_height,
sm.rump_width,
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
sm.sheep_id,
sm.user_id,
sm.dept_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,
sm.current_weight as current_weight,
sm.height,
sm.bust,
sm.body_length,
sm.pipe_length,
sm.chest_depth,
sm.hip_height,
sm.rump_width,
sm.rump_heignt,
sm.hip_width,
sm.hip_cross_height,
sm.month_age,
sm.breast_depth,
sm.breast_position,
sm.breast_length,
sm.breast_adbere,
sm.breast_spacing,
sm.breast_score,
sm.body_score,
sm.lactation_day,
sm.gestation_day,
sm.post_mating_day,
bbs.breed as breed_status_name,
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
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
</sql>
<select id="selectScBodyMeasureList" resultMap="ScBodyMeasureResult">
@@ -113,14 +128,21 @@
and bs.is_delete = #{sc.isDelete}
</if>
<if test="sc.monthAgeStart != null">
and <![CDATA[ TIMESTAMPDIFF(MONTH, bs.birthday, CURDATE()) >= #{sc.monthAgeStart} ]]>
and <![CDATA[ sm.month_age >= #{sc.monthAgeStart} ]]>
</if>
<if test="sc.monthAgeEnd != null">
and <![CDATA[ TIMESTAMPDIFF(MONTH, bs.birthday, CURDATE()) <= #{sc.monthAgeEnd} ]]>
and <![CDATA[ sm.month_age <= #{sc.monthAgeEnd} ]]>
</if>
<if test="sc.breedStatusName != null and sc.breedStatusName != ''">
and bbs.breed = #{sc.breedStatusName}
</if>
<if test="sc.deptId != null">
and sm.dept_id = #{sc.deptId}
</if>
<if test="sc.userId != null">
and sm.user_id = #{sc.userId}
</if>
${sc.params.dataScope}
</where>
ORDER BY sm.create_time DESC
</select>
@@ -146,10 +168,23 @@
<if test="currentWeight != null">current_weight,</if>
<if test="hipWidth != null">hip_width,</if>
<if test="hipCrossHeight != null">hip_cross_height,</if>
<if test="monthAge != null">month_age,</if>
<if test="breastDepth != null">breast_depth,</if>
<if test="breastPosition != null">breast_position,</if>
<if test="breastLength != null">breast_length,</if>
<if test="breastAdbere != null">breast_adbere,</if>
<if test="breastSpacing != null">breast_spacing,</if>
<if test="breastScore != null">breast_score,</if>
<if test="bodyScore != null">body_score,</if>
<if test="lactationDay != null">lactation_day,</if>
<if test="gestationDay != null">gestation_day,</if>
<if test="postMatingDay != null">post_mating_day,</if>
<if test="comment != null">comment,</if>
<if test="technician != null">technician,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
@@ -165,10 +200,23 @@
<if test="currentWeight != null">#{currentWeight},</if>
<if test="hipWidth != null">#{hipWidth},</if>
<if test="hipCrossHeight != null">#{hipCrossHeight},</if>
<if test="monthAge != null">#{monthAge},</if>
<if test="breastDepth != null">#{breastDepth},</if>
<if test="breastPosition != null">#{breastPosition},</if>
<if test="breastLength != null">#{breastLength},</if>
<if test="breastAdbere != null">#{breastAdbere},</if>
<if test="breastSpacing != null">#{breastSpacing},</if>
<if test="breastScore != null">#{breastScore},</if>
<if test="bodyScore != null">#{bodyScore},</if>
<if test="lactationDay != null">#{lactationDay},</if>
<if test="gestationDay != null">#{gestationDay},</if>
<if test="postMatingDay != null">#{postMatingDay},</if>
<if test="comment != null">#{comment},</if>
<if test="technician != null">#{technician},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
@@ -188,6 +236,17 @@
<if test="currentWeight != null">current_weight = #{currentWeight},</if>
<if test="hipWidth != null">hip_width = #{hipWidth},</if>
<if test="hipCrossHeight != null">hip_cross_height = #{hipCrossHeight},</if>
<if test="monthAge != null">month_age = #{monthAge},</if>
<if test="breastDepth != null">breast_depth = #{breastDepth},</if>
<if test="breastPosition != null">breast_position = #{breastPosition},</if>
<if test="breastLength != null">breast_length = #{breastLength},</if>
<if test="breastAdbere != null">breast_adbere = #{breastAdbere},</if>
<if test="breastSpacing != null">breast_spacing = #{breastSpacing},</if>
<if test="breastScore != null">breast_score = #{breastScore},</if>
<if test="bodyScore != null">body_score = #{bodyScore},</if>
<if test="lactationDay != null">lactation_day = #{lactationDay},</if>
<if test="gestationDay != null">gestation_day = #{gestationDay},</if>
<if test="postMatingDay != null">post_mating_day = #{postMatingDay},</if>
<if test="comment != null">comment = #{comment},</if>
<if test="technician != null">technician = #{technician},</if>
<if test="createBy != null">create_by = #{createBy},</if>
@@ -208,11 +267,12 @@
#{id}
</foreach>
</delete>
<select id="searchEarNumbers" resultType="java.lang.String">
SELECT DISTINCT bs.manage_tags
FROM bas_sheep bs
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
AND bs.is_delete = 0
ORDER BY bs.manage_tags
</select>