完善了死亡部分代码,优化了孕检模块,新建了流产模块

This commit is contained in:
zyk
2025-08-24 00:37:33 +08:00
parent c11faeeace
commit fdd18ba1d3
17 changed files with 1563 additions and 124 deletions

View File

@@ -44,6 +44,7 @@
<if test="comment != null and comment != ''"> and comment = #{comment}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
</where>
order by create_time desc
</select>
<select id="selectScSheepDeathById" parameterType="Long" resultMap="ScSheepDeathResult">
@@ -51,11 +52,23 @@
where id = #{id}
</select>
<!-- 根据管理耳号查询sheep_file视图信息 -->
<!-- 根据管理耳号查询sheep_file视图信息 - 修复删除不存在的status字段 -->
<select id="selectSheepFileByManageTags" parameterType="String" resultType="java.util.Map">
select id as sheepId, variety, name as sheepType, gender, day_age as dayAge, parity, sheepfold_name as sheepfoldName, breed as breedStatus, post_lambing_day as postLambingDay, lactation_day as lactationDay, gestation_day as gestationDay
select
id as sheepId,
variety,
name as sheepType,
gender,
day_age as dayAge,
parity,
sheepfold_name as sheepfoldName,
breed as breedStatus,
post_lambing_day as postLambingDay,
lactation_day as lactationDay,
gestation_day as gestationDay
from sheep_file
where bs_manage_tags = #{manageTags} and is_delete = 0
limit 1
</select>
<insert id="insertScSheepDeath" parameterType="ScSheepDeath" useGeneratedKeys="true" keyProperty="id">
@@ -131,4 +144,14 @@
#{id}
</foreach>
</delete>
<!-- 更新羊只状态 - 根据实际的sheep_file表结构调整字段名 -->
<update id="updateSheepFileStatus">
UPDATE sheep_file
SET breed = #{status},
update_time = NOW()
WHERE id = #{sheepId}
AND is_delete = 0
</update>
</mapper>