修蹄,去势,转群的新增功能的完善

This commit is contained in:
zyh
2025-07-22 14:55:18 +08:00
parent 6d6ea86942
commit 4fde560c83
24 changed files with 638 additions and 87 deletions

View File

@@ -7,9 +7,12 @@
<resultMap type="ScCastrate" id="ScCastrateResult">
<result property="id" column="id"/>
<result property="sheepId" column="sheep_id"/>
<result property="manageTags" column="manageTags"/> <!-- 新增耳号映射 -->
<result property="sheepfold" column="sheepfold"/>
<result property="comment" column="comment"/>
<result property="sheepfoldName" column="sheepfoldName"/>
<result property="varietyId" column="variety_id"/>
<result property="varietyName" column="varietyName"/>
<result property="comment" column="comment"/>
<result property="technician" column="technician"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
@@ -18,15 +21,17 @@
<sql id="selectScCastrateVo">
select sc.id,
sc.sheep_id,
bs.manage_tags as manageTags, -- 关联羊只表的耳号
sc.sheepfold,
sf.sheepfold_name as sheepfoldName,
sc.variety_id,
bv.variety as varietyName,
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 sc.sheepfold = sf.id
left join bas_sheep_variety bv on sc.variety_id = bv.id
</sql>
@@ -34,16 +39,16 @@
<select id="selectScCastrateList" parameterType="ScCastrate" resultMap="ScCastrateResult">
<include refid="selectScCastrateVo"/>
<where>
<if test="sheepId != null and sheepId != ''">and sheep_id like concat('%', #{sheepId}, '%')</if>
<if test="sheepfold != null ">and sheepfold like concat('%', #{sheepfold}, '%')</if>
<if test="varietyId != null">
and sc.variety_id = #{varietyId}
<!-- 替换原sheepId条件为耳号条件 -->
<if test="manageTags != null and manageTags != ''">
and bs.manage_tags like concat('%', #{manageTags}, '%')
</if>
<if test="technician != null and technician != ''">and technician like concat('%', #{technician}, '%')</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
<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">
and sc.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
</where>
</select>