改备注,改耳号,改品种,转场部分模糊查询+多耳号输入

This commit is contained in:
zyh
2026-01-13 11:17:19 +08:00
parent 2722fb985e
commit af262045bd
25 changed files with 224 additions and 113 deletions

View File

@@ -44,28 +44,26 @@
LEFT JOIN bas_sheep_variety bv ON bs.variety_id = bv.id
</sql>
<select id="selectScTransitionInfoList" parameterType="ScTransitionInfo" resultMap="ScTransitionInfoResult">
<select id="selectScTransitionInfoList" resultMap="ScTransitionInfoResult">
<include refid="selectScTransitionInfoVo"/>
<where>
<if test="sheepId != null ">and sheep_id = #{sheepId}</if>
<if test="manageTags != null and manageTags != ''">
and bs.manage_tags LIKE CONCAT('%', #{manageTags}, '%')
<!-- 多耳号 + 每只模糊 -->
<if test="manageTagsList != null and manageTagsList.size() > 0">
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
bs.manage_tags like concat('%', #{tag}, '%')
</foreach>
</if>
<!-- <if test="eventType != null and eventType != ''">-->
<!-- and t.event_type = #{eventType}-->
<!-- </if>-->
<if test="transType != null">and t.trans_type = #{transType}</if>
<if test="params.beginTransitionDate != null and params.beginTransitionDate != ''
and params.endTransitionDate != null and params.endTransitionDate != ''">
and t.transition_date between #{params.beginTransitionDate} and #{params.endTransitionDate}
<!-- 其余统一加 sc. 前缀 -->
<if test="sc.sheepId != null">and t.sheep_id = #{sc.sheepId}</if>
<if test="sc.transType != null">and t.trans_type = #{sc.transType}</if>
<if test="sc.varietyId != null">and bs.variety_id = #{sc.varietyId}</if>
<if test="sc.transTo != null and sc.transTo != ''">and t.trans_to = #{sc.transTo}</if>
<if test="sc.transFrom != null and sc.transFrom != ''">and t.trans_from = #{sc.transFrom}</if>
<if test="sc.status != null">and t.status = #{sc.status}</if>
<if test="sc.params != null and sc.params.beginTransitionDate != null and sc.params.beginTransitionDate != '' and sc.params.endTransitionDate != null and sc.params.endTransitionDate != ''">
and t.transition_date between #{sc.params.beginTransitionDate} and #{sc.params.endTransitionDate}
</if>
<if test="varietyId != null">and bs.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>
<!-- <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">-->
<!-- and t.create_time between #{params.beginCreateTime} and #{params.endCreateTime}-->
<!-- </if>-->
</where>
ORDER BY t.create_time DESC
</select>
@@ -154,4 +152,13 @@
#{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
ORDER BY bs.manage_tags
LIMIT 50
</select>
</mapper>