转群,体尺测量,体况评分,乳况评分,修蹄,去势部分模糊查询+多耳号输入,排序优化

This commit is contained in:
zyh
2026-01-16 12:34:24 +08:00
parent 1b24e93ae9
commit 21cfba87ea
48 changed files with 310 additions and 176 deletions

View File

@@ -85,24 +85,26 @@
LEFT JOIN bas_sheep_variety bsv ON bs.variety_id = bsv.id
</sql>
<select id="selectScBodyMeasureList" parameterType="ScBodyMeasure" resultMap="ScBodyMeasureResult">
<select id="selectScBodyMeasureList" 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 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="manageTags != null and manageTags != ''">
and bs.manage_tags like concat('%', #{manageTags}, '%')
<if test="sc.sheepId != null">and sm.sheep_id = #{sc.sheepId}</if>
<if test="sc.sheepfoldId != null">and bs.sheepfold_id = #{sc.sheepfoldId}</if>
<if test="sc.varietyId != null">and bsv.id = #{sc.varietyId}</if>
<if test="sc.sheepTypeId != null">and bs.type_id = #{sc.sheepTypeId}</if>
<if test="sc.params != null and sc.params.beginMeasureDate != null and sc.params.beginMeasureDate != '' and sc.params.endMeasureDate != null and sc.params.endMeasureDate != ''">
and sm.measure_date between #{sc.params.beginMeasureDate} and #{sc.params.endMeasureDate}
</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 test="sc.params != null and sc.params.beginCreateTime != null and sc.params.beginCreateTime != '' and sc.params.endCreateTime != null and sc.params.endCreateTime != ''">
and sm.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
</if>
</where>
<if test="true">ORDER BY sm.create_time DESC</if>
ORDER BY sm.create_time DESC
</select>
<select id="selectScBodyMeasureById" parameterType="Long" resultMap="ScBodyMeasureResult">
@@ -188,4 +190,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
ORDER BY bs.manage_tags
LIMIT 50
</select>
</mapper>