转场,转群,改耳号,改备注,改品种部分bug修复,字段顺序调整

This commit is contained in:
zyh
2026-02-03 14:41:28 +08:00
parent 4ab62cd1f2
commit 2f6a1a9600
30 changed files with 516 additions and 271 deletions

View File

@@ -103,6 +103,24 @@
<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>
<if test="sc.gender != null and sc.gender != ''">
and bs.gender = #{sc.gender}
</if>
<if test="sc.technician != null and sc.technician != ''">
and sm.technician like concat('%', #{sc.technician}, '%')
</if>
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
<if test="sc.monthAgeStart != null">
and <![CDATA[ TIMESTAMPDIFF(MONTH, bs.birthday, CURDATE()) >= #{sc.monthAgeStart} ]]>
</if>
<if test="sc.monthAgeEnd != null">
and <![CDATA[ TIMESTAMPDIFF(MONTH, bs.birthday, CURDATE()) <= #{sc.monthAgeEnd} ]]>
</if>
<if test="sc.breedStatusName != null and sc.breedStatusName != ''">
and bbs.breed = #{sc.breedStatusName}
</if>
</where>
ORDER BY sm.create_time DESC
</select>
@@ -196,6 +214,11 @@
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
</select>
<select id="selectBreedStatusList" resultType="java.util.HashMap">
SELECT id, breed as label, breed as value
FROM bas_breed_status
ORDER BY id
</select>
</mapper>

View File

@@ -59,6 +59,9 @@
<if test="sc.params != null and sc.params.beginCreateTime != null and sc.params.beginCreateTime != '' and sc.params.endCreateTime != null and sc.params.endCreateTime != ''">
and sbs.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
</if>
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
</where>
ORDER BY sbs.create_time DESC
</select>

View File

@@ -57,6 +57,9 @@
<if test="sc.params != null and sc.params.beginCreateTime != null and sc.params.endCreateTime != null">
and sbr.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
</if>
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
</where>
ORDER BY sbr.create_time DESC
</select>
@@ -134,7 +137,6 @@
FROM bas_sheep bs
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
ORDER BY bs.manage_tags LIMIT 50
</select>
</mapper>

View File

@@ -43,8 +43,11 @@
bs.manage_tags like concat('%', #{tag}, '%')
</foreach>
</if>
<if test="sc.sheepfoldId != null">
and bs.sheepfold_id = #{sc.sheepfoldId}
<!-- <if test="sc.sheepfoldId != null">-->
<!-- and bs.sheepfold_id = #{sc.sheepfoldId}-->
<!-- </if>-->
<if test="sc.technician != null and sc.technician != ''">
and scc.technician like concat('%', #{sc.technician}, '%')
</if>
<if test="sc.newComment != null and sc.newComment != ''">
and scc.new_comment like concat('%', #{sc.newComment}, '%')
@@ -60,6 +63,9 @@
and sc.params.endEventDate != null and sc.params.endEventDate != ''">
and scc.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
</if>
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
</where>
ORDER BY scc.create_time DESC
</select>

View File

@@ -25,6 +25,7 @@
sce.sheep_id,
bs.manage_tags as manage_tags,
sf.sheepfold_name as sheepfold_name,
bv.variety as varietyName,
case
when sce.ear_type = 0 then '改电子耳号'
when sce.ear_type = 1 then '改管理耳号'
@@ -41,6 +42,7 @@
from sc_change_ear sce
LEFT JOIN bas_sheep bs ON sce.sheep_id = bs.id
LEFT JOIN da_sheepfold sf ON bs.sheepfold_id = sf.id
LEFT JOIN bas_sheep_variety bv on bs.variety_id = bv.id
</sql>
<select id="selectScChangeEarList" resultMap="ScChangeEarResult">
@@ -53,7 +55,7 @@
or bs.electronic_tags like concat('%', #{tag}, '%'))
</foreach>
</if>
<if test="sc.sheepfoldId != null">and bs.sheepfold_id = #{sc.sheepfoldId}</if>
<if test="sc.technician != null and sc.technician != ''">and sce.technician like concat('%', #{sc.technician}, '%')</if>
<if test="sc.earType != null">and sce.ear_type = #{sc.earType}</if>
<if test="sc.newTag != null and sc.newTag != ''">and sce.newTag like concat('%', #{sc.newTag}, '%')</if>
<if test="sc.oldTag != null and sc.oldTag != ''">and sce.oldTag like concat('%', #{sc.oldTag}, '%')</if>
@@ -65,6 +67,12 @@
and sc.params.endEventDate != null and sc.params.endEventDate != ''">
and sce.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
</if>
<if test="sc.inGroup != null">
<choose>
<when test="sc.inGroup == 1">and bs.is_delete = 0</when>
<when test="sc.inGroup == 2">and bs.is_delete = 1</when>
</choose>
</if>
</where>
ORDER BY sce.create_time DESC
</select>

View File

@@ -46,15 +46,25 @@
</foreach>
</if>
<if test="sc.sheepId != null">and scv.sheep_id = #{sc.sheepId}</if>
<if test="sc.sheepfoldId != null">and bs.sheepfold_id = #{sc.sheepfoldId}</if>
<if test="sc.varietyOld != null and sc.varietyOld != ''">and scv.variety_old like concat('%', #{sc.varietyOld}, '%')</if>
<if test="sc.varietyNew != null and sc.varietyNew != ''">and scv.variety_new like concat('%', #{sc.varietyNew}, '%')</if>
<!-- <if test="sc.sheepfoldId != null">and bs.sheepfold_id = #{sc.sheepfoldId}</if>-->
<if test="sc.technician != null and sc.technician != ''">and scv.technician like concat('%',
#{sc.technician}, '%')
</if>
<if test="sc.varietyOld != null and sc.varietyOld != ''">and scv.variety_old like concat('%',
#{sc.varietyOld}, '%')
</if>
<if test="sc.varietyNew != null and sc.varietyNew != ''">and scv.variety_new like concat('%',
#{sc.varietyNew}, '%')
</if>
<if test="sc.params != null and sc.params.beginCreateTime != null and sc.params.beginCreateTime != '' and sc.params.endCreateTime != null and sc.params.endCreateTime != ''">
and scv.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
</if>
<if test="sc.params != null and sc.params.beginEventDate != null and sc.params.beginEventDate != '' and sc.params.endEventDate != null and sc.params.endEventDate != ''">
and scv.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
</if>
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
</where>
ORDER BY scv.create_time DESC
</select>
@@ -119,7 +129,6 @@
FROM bas_sheep bs
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
ORDER BY bs.manage_tags LIMIT 50
</select>
</mapper>

View File

@@ -15,7 +15,6 @@
<result property="varietyId" column="variety_id"/>
<result property="varietyName" column="varietyName"/>
<result property="technician" column="technician"/>
<result property="status" column="status"/>
<result property="comment" column="comment"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
@@ -25,8 +24,8 @@
SELECT tg.id,
tg.sheep_id,
s.manage_tags AS manageTags,
tg.event_type AS eventType,
tg.trans_date AS transDate,
tg.event_type AS eventType,
tg.trans_date AS transDate,
tg.fold_to,
tg.fold_from,
tg.reason,
@@ -34,7 +33,6 @@
bv.variety AS varietyName,
st.id AS sheepTypeId,
st.name AS sheepTypeName,
tg.status,
tg.comment,
tg.create_by,
tg.create_time,
@@ -54,20 +52,28 @@
<select id="selectScTransGroupList" resultMap="ScTransGroupResult">
<include refid="selectScTransGroupVo"/>
<where>
<if test="manageTagsList != null and manageTagsList.size() > 0">
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
s.manage_tags like concat('%', #{tag}, '%')
<if test="sc.manageTagsList != null and sc.manageTagsList.size() > 0">
<foreach collection="sc.manageTagsList" item="tag" separator="or" open="and (" close=")">
s.manage_tags LIKE CONCAT('%', #{tag}, '%')
</foreach>
</if>
<if test="sc.sheepId != null">and tg.sheep_id = #{sc.sheepId}</if>
<if test="sc.foldTo != null and sc.foldTo != ''">and tg.fold_to = #{sc.foldTo}</if>
<if test="sc.foldFrom != null and sc.foldFrom != ''">and tg.fold_from = #{sc.foldFrom}</if>
<if test="sc.status != null">and tg.status = #{sc.status}</if>
<if test="sc.varietyId != null">and tg.variety_id = #{sc.varietyId}</if>
<if test="sc.sheepTypeId != null">and st.id = #{sc.sheepTypeId}</if>
<if test="sc.params != null and sc.params.beginTransDate != null and sc.params.beginTransDate != '' and sc.params.endTransDate != null and sc.params.endTransDate != ''">
and tg.trans_date between #{sc.params.beginTransDate} and #{sc.params.endTransDate}
</if>
<if test="sc.eventType != null and sc.eventType != ''">
and tg.event_type like concat('%', #{sc.eventType}, '%')
</if>
<if test="sc.technician != null and sc.technician != ''">
and tg.technician like concat('%', #{sc.technician}, '%')
</if>
<if test="sc.isDelete != null">
and s.is_delete = #{sc.isDelete}
</if>
</where>
ORDER BY tg.create_time DESC
</select>
@@ -90,7 +96,6 @@
<if test="varietyId != null">variety_id,</if>
<if test="reason != null">reason,</if>
<if test="technician != null and technician != ''">technician,</if>
<if test="status != null">status,</if>
<if test="comment != null">comment,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
@@ -104,7 +109,6 @@
<if test="varietyId != null">#{varietyId},</if>
<if test="reason != null">#{reason},</if>
<if test="technician != null and technician != ''">#{technician},</if>
<if test="status != null">#{status},</if>
<if test="comment != null">#{comment},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@@ -122,7 +126,6 @@
<if test="varietyId != null">variety_id = #{varietyId},</if>
<if test="reason != null">reason = #{reason},</if>
<if test="technician != null and technician != ''">technician = #{technician},</if>
<if test="status != null">status = #{status},</if>
<if test="comment != null">comment = #{comment},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
@@ -149,6 +152,5 @@
WHERE s.manage_tags LIKE CONCAT('%', #{query}, '%')
AND s.is_delete = 0
ORDER BY s.manage_tags
LIMIT 50
</select>
</mapper>

View File

@@ -25,8 +25,10 @@
SELECT t.*,
bv.variety AS varietyName,
bs.manage_tags AS manageTags,
sf.sheepfold_name AS sheepfoldName,
t.event_type AS eventType,
t.transition_date AS transitionDate,
dr.ranch AS currentRanchName,
CASE t.trans_type
WHEN 0 THEN '内部调拨'
WHEN 1 THEN '内部销售'
@@ -42,6 +44,8 @@
FROM sc_transition_info t
LEFT JOIN bas_sheep bs ON t.sheep_id = bs.id
LEFT JOIN bas_sheep_variety bv ON bs.variety_id = bv.id
LEFT JOIN da_sheepfold sf ON t.sheepfold_id = sf.id
LEFT JOIN da_ranch dr ON bs.ranch_id = dr.id
</sql>
<select id="selectScTransitionInfoList" resultMap="ScTransitionInfoResult">
@@ -61,6 +65,18 @@
<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="sc.technician != null and sc.technician != ''">
and t.technician like concat('%', #{sc.technician}, '%')
</if>
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
<if test="sc.sheepTypeId != null">
and bs.type_id = #{sc.sheepTypeId}
</if>
<if test="sc.currentRanchId != null">
and bs.ranch_id = #{sc.currentRanchId}
</if>
</where>
ORDER BY t.create_time DESC
</select>
@@ -155,7 +171,6 @@
FROM bas_sheep bs
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
ORDER BY bs.manage_tags LIMIT 50
</select>
</mapper>

View File

@@ -57,6 +57,9 @@
<if test="sc.params != null and sc.params.beginEventDate != null and sc.params.beginEventDate != '' and sc.params.endEventDate != null and sc.params.endEventDate != ''">
and sc.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
</if>
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
</where>
ORDER BY sc.create_time DESC
</select>

View File

@@ -21,7 +21,7 @@
<sql id="selectScFixHoofVo">
select fh.id,
bs.manage_tags as manageTags,
'修蹄' as event_type,
'修蹄' as event_type,
bs.sheepfold_id as sheepfold,
sf.sheepfold_name as sheepfoldName,
bs.variety_id as varietyId,
@@ -47,13 +47,18 @@
</if>
<if test="sc.sheepfold != null">and bs.sheepfold_id = #{sc.sheepfold}</if>
<if test="sc.varietyId != null">and bs.variety_id = #{sc.varietyId}</if>
<if test="sc.technician != null and sc.technician != ''">and fh.technician like concat('%', #{sc.technician}, '%')</if>
<if test="sc.technician != null and sc.technician != ''">and fh.technician like concat('%',
#{sc.technician}, '%')
</if>
<if test="sc.params != null and sc.params.beginCreateTime != null and sc.params.beginCreateTime != '' and sc.params.endCreateTime != null and sc.params.endCreateTime != ''">
and fh.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
</if>
<if test="sc.params != null and sc.params.beginEventDate != null and sc.params.beginEventDate != '' and sc.params.endEventDate != null and sc.params.endEventDate != ''">
and fh.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
</if>
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
</where>
ORDER BY fh.create_time DESC
</select>
@@ -118,6 +123,5 @@
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
</select>
</mapper>