bug修复以及数据分离操作

This commit is contained in:
zyh
2026-02-09 20:22:51 +08:00
parent 7dbe337a93
commit fb80399602
50 changed files with 876 additions and 253 deletions

View File

@@ -30,10 +30,18 @@
<result property="rumpHeignt" column="rump_heignt"/>
<result property="hipWidth" column="hip_width"/>
<result property="hipCrossHeight" column="hip_cross_height"/>
<result property="breedStatusName" column="breed_status_name"/>
<result property="monthAge" column="month_age"/>
<result property="breastDepth" column="breast_depth"/>
<result property="breastPosition" column="breast_position"/>
<result property="breastLength" column="breast_length"/>
<result property="breastAdbere" column="breast_adbere"/>
<result property="breastSpacing" column="breast_spacing"/>
<result property="breastScore" column="breast_score"/>
<result property="bodyScore" column="body_score"/>
<result property="lactationDay" column="lactation_day"/>
<result property="gestationDay" column="gestation_day"/>
<result property="postMatingDay" column="post_mating_day"/>
<result property="breedStatusName" column="breed_status_name"/>
<result property="comment" column="comment"/>
<result property="technician" column="technician"/>
<result property="createBy" column="create_by"/>
@@ -42,47 +50,54 @@
<sql id="selectScBodyMeasureVo">
select sm.id,
sm.sheep_id,
bs.manage_tags,
ds.id as sheepfold_id,
ds.sheepfold_name,
bsv.id as variety_id,
bsv.variety as variety_name,
'体尺测量' as event_type,
bst.name as sheep_type_name,
sm.measure_date,
bs.gender,
bs.parity,
bs.birth_weight as birth_weight,
bs.weaning_weight as weaning_weight,
sm.current_weight as current_weight,
sm.height,
sm.bust,
sm.body_length,
sm.pipe_length,
sm.chest_depth,
sm.hip_height,
sm.rump_width,
sm.rump_heignt,
sm.hip_width,
sm.hip_cross_height,
bbs.breed as breed_status_name,
bs.lactation_day as lactation_day,
bs.gestation_day as gestation_day,
case when bs.mating_date is not null
then DATEDIFF(NOW(), bs.mating_date)
else null
end as post_mating_day,
sm.comment,
sm.technician,
sm.create_by,
sm.create_time
sm.sheep_id,
sm.user_id,
sm.dept_id,
bs.manage_tags,
ds.id as sheepfold_id,
ds.sheepfold_name,
bsv.id as variety_id,
bsv.variety as variety_name,
'体尺测量' as event_type,
bst.name as sheep_type_name,
sm.measure_date,
bs.gender,
bs.parity,
bs.birth_weight as birth_weight,
bs.weaning_weight as weaning_weight,
sm.current_weight as current_weight,
sm.height,
sm.bust,
sm.body_length,
sm.pipe_length,
sm.chest_depth,
sm.hip_height,
sm.rump_width,
sm.rump_heignt,
sm.hip_width,
sm.hip_cross_height,
sm.month_age,
sm.breast_depth,
sm.breast_position,
sm.breast_length,
sm.breast_adbere,
sm.breast_spacing,
sm.breast_score,
sm.body_score,
sm.lactation_day,
sm.gestation_day,
sm.post_mating_day,
bbs.breed as breed_status_name,
sm.comment,
sm.technician,
sm.create_by,
sm.create_time
from sc_body_measure sm
LEFT JOIN bas_sheep bs ON sm.sheep_id = bs.id
LEFT JOIN bas_breed_status bbs ON bs.breed_status_id = bbs.id
LEFT JOIN da_sheepfold ds ON bs.sheepfold_id = ds.id
LEFT JOIN bas_sheep_type bst ON bs.type_id = bst.id
LEFT JOIN bas_sheep_variety bsv ON bs.variety_id = bsv.id
LEFT JOIN bas_sheep bs ON sm.sheep_id = bs.id
LEFT JOIN bas_breed_status bbs ON bs.breed_status_id = bbs.id
LEFT JOIN da_sheepfold ds ON bs.sheepfold_id = ds.id
LEFT JOIN bas_sheep_type bst ON bs.type_id = bst.id
LEFT JOIN bas_sheep_variety bsv ON bs.variety_id = bsv.id
</sql>
<select id="selectScBodyMeasureList" resultMap="ScBodyMeasureResult">
@@ -113,14 +128,21 @@
and bs.is_delete = #{sc.isDelete}
</if>
<if test="sc.monthAgeStart != null">
and <![CDATA[ TIMESTAMPDIFF(MONTH, bs.birthday, CURDATE()) >= #{sc.monthAgeStart} ]]>
and <![CDATA[ sm.month_age >= #{sc.monthAgeStart} ]]>
</if>
<if test="sc.monthAgeEnd != null">
and <![CDATA[ TIMESTAMPDIFF(MONTH, bs.birthday, CURDATE()) <= #{sc.monthAgeEnd} ]]>
and <![CDATA[ sm.month_age <= #{sc.monthAgeEnd} ]]>
</if>
<if test="sc.breedStatusName != null and sc.breedStatusName != ''">
and bbs.breed = #{sc.breedStatusName}
</if>
<if test="sc.deptId != null">
and sm.dept_id = #{sc.deptId}
</if>
<if test="sc.userId != null">
and sm.user_id = #{sc.userId}
</if>
${sc.params.dataScope}
</where>
ORDER BY sm.create_time DESC
</select>
@@ -146,10 +168,23 @@
<if test="currentWeight != null">current_weight,</if>
<if test="hipWidth != null">hip_width,</if>
<if test="hipCrossHeight != null">hip_cross_height,</if>
<if test="monthAge != null">month_age,</if>
<if test="breastDepth != null">breast_depth,</if>
<if test="breastPosition != null">breast_position,</if>
<if test="breastLength != null">breast_length,</if>
<if test="breastAdbere != null">breast_adbere,</if>
<if test="breastSpacing != null">breast_spacing,</if>
<if test="breastScore != null">breast_score,</if>
<if test="bodyScore != null">body_score,</if>
<if test="lactationDay != null">lactation_day,</if>
<if test="gestationDay != null">gestation_day,</if>
<if test="postMatingDay != null">post_mating_day,</if>
<if test="comment != null">comment,</if>
<if test="technician != null">technician,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
@@ -165,10 +200,23 @@
<if test="currentWeight != null">#{currentWeight},</if>
<if test="hipWidth != null">#{hipWidth},</if>
<if test="hipCrossHeight != null">#{hipCrossHeight},</if>
<if test="monthAge != null">#{monthAge},</if>
<if test="breastDepth != null">#{breastDepth},</if>
<if test="breastPosition != null">#{breastPosition},</if>
<if test="breastLength != null">#{breastLength},</if>
<if test="breastAdbere != null">#{breastAdbere},</if>
<if test="breastSpacing != null">#{breastSpacing},</if>
<if test="breastScore != null">#{breastScore},</if>
<if test="bodyScore != null">#{bodyScore},</if>
<if test="lactationDay != null">#{lactationDay},</if>
<if test="gestationDay != null">#{gestationDay},</if>
<if test="postMatingDay != null">#{postMatingDay},</if>
<if test="comment != null">#{comment},</if>
<if test="technician != null">#{technician},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
@@ -188,6 +236,17 @@
<if test="currentWeight != null">current_weight = #{currentWeight},</if>
<if test="hipWidth != null">hip_width = #{hipWidth},</if>
<if test="hipCrossHeight != null">hip_cross_height = #{hipCrossHeight},</if>
<if test="monthAge != null">month_age = #{monthAge},</if>
<if test="breastDepth != null">breast_depth = #{breastDepth},</if>
<if test="breastPosition != null">breast_position = #{breastPosition},</if>
<if test="breastLength != null">breast_length = #{breastLength},</if>
<if test="breastAdbere != null">breast_adbere = #{breastAdbere},</if>
<if test="breastSpacing != null">breast_spacing = #{breastSpacing},</if>
<if test="breastScore != null">breast_score = #{breastScore},</if>
<if test="bodyScore != null">body_score = #{bodyScore},</if>
<if test="lactationDay != null">lactation_day = #{lactationDay},</if>
<if test="gestationDay != null">gestation_day = #{gestationDay},</if>
<if test="postMatingDay != null">post_mating_day = #{postMatingDay},</if>
<if test="comment != null">comment = #{comment},</if>
<if test="technician != null">technician = #{technician},</if>
<if test="createBy != null">create_by = #{createBy},</if>
@@ -208,11 +267,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
AND bs.is_delete = 0
ORDER BY bs.manage_tags
</select>

View File

@@ -24,10 +24,12 @@
<sql id="selectScBodyScoreVo">
select sbs.id,
sbs.sheep_id,
sbs.user_id,
sbs.dept_id,
bs.manage_tags,
bsv.id as varietyId,
bsv.variety as varietyName,
'体况评分' as event_type,
bsv.id as varietyId,
bsv.variety as varietyName,
'体况评分' as event_type,
sbs.datetime,
sbs.score,
ds.sheepfold_name as sheepfoldName,
@@ -62,6 +64,10 @@
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
<if test="sc.technician != null and sc.technician != ''">
and sbs.technician like concat('%', #{sc.technician}, '%')
</if>
${sc.params.dataScope}
</where>
ORDER BY sbs.create_time DESC
</select>
@@ -82,6 +88,8 @@
<if test="technician != null">technician,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
@@ -92,6 +100,8 @@
<if test="technician != null">#{technician},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
@@ -129,6 +139,5 @@
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
</select>
</mapper>

View File

@@ -24,11 +24,15 @@
<result property="technician" column="technician"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="userId" column="user_id"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<sql id="selectScBreastRatingVo">
select sbr.*,
bs.manage_tags as manageTags,
sbr.user_id,
sbr.dept_id,
bsv.id as varietyId,
bsv.variety as varietyName,
'乳房评分' as event_type,
@@ -60,6 +64,13 @@
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
<if test="sc.technician != null and sc.technician != ''">
and sbr.technician = #{sc.technician}
</if>
<if test="sc.score != null">
and sbr.score = #{sc.score}
</if>
${sc.params.dataScope}
</where>
ORDER BY sbr.create_time DESC
</select>
@@ -84,6 +95,8 @@
<if test="technician != null">technician,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
@@ -98,6 +111,8 @@
<if test="technician != null">#{technician},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
@@ -137,6 +152,15 @@
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
</select>
<select id="selectLatestBySheepIdBeforeDate" resultMap="ScBreastRatingResult">
SELECT *
FROM sc_breast_rating
WHERE sheep_id = #{sheepId}
AND event_date &lt;= #{measureDate}
ORDER BY event_date DESC, create_time DESC LIMIT 1
</select>
</mapper>

View File

@@ -25,18 +25,40 @@
<result property="technician" column="technician"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="userId" column="user_id"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<select id="selectScAddSheepList" parameterType="ScAddSheep" resultMap="ScAddSheepResult">
<sql id="selectScAddSheepVo">
SELECT
sas.*,
sf.sheepfold_name AS sheepfoldName,
bv.variety AS varietyName,
st.type_name AS typeName
sas.id,
sas.ear_number,
sas.sheepfold,
sas.ranch_id,
sas.father,
sas.mother,
sas.born_weight,
sas.birthday,
sas.gender,
sas.parity,
sas.variety_id,
sas.type_id,
sas.join_date,
sas.comment,
sas.technician,
sas.create_by,
sas.create_time,
sas.user_id,
sas.dept_id,
sf.sheepfold_name AS sheepfoldName,
bv.variety AS varietyName,
st.type_name AS typeName
FROM sc_add_sheep sas
LEFT JOIN da_sheepfold sf ON sas.sheepfold = sf.id
LEFT JOIN bas_sheep_variety bv ON sas.variety_id = bv.id
LEFT JOIN bas_sheep_type st ON sas.type_id = st.id
LEFT JOIN da_sheepfold sf ON sas.sheepfold = sf.id
LEFT JOIN bas_sheep_variety bv ON sas.variety_id = bv.id
LEFT JOIN bas_sheep_type st ON sas.type_id = st.id
</sql>
<select id="selectScAddSheepList" parameterType="ScAddSheep" resultMap="ScAddSheepResult">
<include refid="selectScAddSheepVo"/>
<where>
<if test="earNumber != null and earNumber != ''">
AND sas.ear_number LIKE CONCAT('%', #{earNumber}, '%')
@@ -50,6 +72,7 @@
<if test="typeId != null">
AND sas.type_id = #{typeId}
</if>
${params.dataScope}
</where>
</select>
@@ -61,12 +84,46 @@
<insert id="insert" parameterType="ScAddSheep" useGeneratedKeys="true" keyProperty="id">
INSERT INTO sc_add_sheep
(ear_number, sheepfold, ranch_id, father, mother, born_weight, birthday,
gender, parity, variety_id, type_id, join_date, comment, technician,
create_by, create_time)
VALUES (#{earNumber}, #{sheepfold}, #{ranchId}, #{father}, #{mother}, #{bornWeight},
#{birthday}, #{gender}, #{parity}, #{varietyId}, #{typeId}, #{joinDate},
#{comment}, #{technician}, #{createBy}, #{createTime})
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="earNumber != null">ear_number,</if>
<if test="sheepfold != null">sheepfold,</if>
<if test="ranchId != null">ranch_id,</if>
<if test="father != null">father,</if>
<if test="mother != null">mother,</if>
<if test="bornWeight != null">born_weight,</if>
<if test="birthday != null">birthday,</if>
<if test="gender != null">gender,</if>
<if test="parity != null">parity,</if>
<if test="varietyId != null">variety_id,</if>
<if test="typeId != null">type_id,</if>
<if test="joinDate != null">join_date,</if>
<if test="comment != null">comment,</if>
<if test="technician != null">technician,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="earNumber != null">#{earNumber},</if>
<if test="sheepfold != null">#{sheepfold},</if>
<if test="ranchId != null">#{ranchId},</if>
<if test="father != null">#{father},</if>
<if test="mother != null">#{mother},</if>
<if test="bornWeight != null">#{bornWeight},</if>
<if test="birthday != null">#{birthday},</if>
<if test="gender != null">#{gender},</if>
<if test="parity != null">#{parity},</if>
<if test="varietyId != null">#{varietyId},</if>
<if test="typeId != null">#{typeId},</if>
<if test="joinDate != null">#{joinDate},</if>
<if test="comment != null">#{comment},</if>
<if test="technician != null">#{technician},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
<update id="updateScAddSheep" parameterType="ScAddSheep">

View File

@@ -21,6 +21,8 @@
<sql id="selectScChangeCommentVo">
select scc.id,
scc.sheep_id,
scc.user_id,
scc.dept_id,
bs.manage_tags as manage_tags,
sf.sheepfold_name as sheepfold_name,
'改备注' as event_type,
@@ -43,9 +45,9 @@
bs.manage_tags like concat('%', #{tag}, '%')
</foreach>
</if>
<!-- <if test="sc.sheepfoldId != null">-->
<!-- and bs.sheepfold_id = #{sc.sheepfoldId}-->
<!-- </if>-->
<!-- <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>
@@ -66,6 +68,7 @@
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
${sc.params.dataScope}
</where>
ORDER BY scc.create_time DESC
</select>
@@ -85,6 +88,8 @@
<if test="createTime != null">create_time,</if>
<if test="eventDate != null">event_date,</if>
<if test="technician != null and technician != ''">technician,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null and sheepId != ''">#{sheepId},</if>
@@ -94,6 +99,8 @@
<if test="createTime != null">#{createTime},</if>
<if test="eventDate != null">#{eventDate},</if>
<if test="technician != null and technician != ''">#{technician},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
@@ -128,6 +135,5 @@
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
</select>
</mapper>

View File

@@ -73,6 +73,7 @@
<when test="sc.inGroup == 2">and bs.is_delete = 1</when>
</choose>
</if>
${sc.params.dataScope}
</where>
ORDER BY sce.create_time DESC
</select>
@@ -94,6 +95,8 @@
<if test="createTime != null">create_time,</if>
<if test="eventDate != null">event_date,</if>
<if test="technician != null and technician != ''">technician,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
@@ -105,6 +108,8 @@
<if test="createTime != null">#{createTime},</if>
<if test="eventDate != null">#{eventDate},</if>
<if test="technician != null and technician != ''">#{technician},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
@@ -141,6 +146,5 @@
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
</select>
</mapper>

View File

@@ -65,6 +65,7 @@
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
${sc.params.dataScope}
</where>
ORDER BY scv.create_time DESC
</select>
@@ -83,8 +84,10 @@
<if test="comment != null">comment,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="technician != null and technician != ''">technician,</if> <!-- 新增 -->
<if test="eventDate != null">event_date,</if> <!-- 新增 -->
<if test="technician != null and technician != ''">technician,</if>
<if test="eventDate != null">event_date,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
@@ -93,8 +96,10 @@
<if test="comment != null">#{comment},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="technician != null and technician != ''">#{technician},</if> <!-- 新增 -->
<if test="eventDate != null">#{eventDate},</if> <!-- 新增 -->
<if test="technician != null and technician != ''">#{technician},</if>
<if test="eventDate != null">#{eventDate},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
@@ -129,6 +134,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
</select>
</mapper>

View File

@@ -18,11 +18,15 @@
<result property="comment" column="comment"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="userId" column="user_id"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<sql id="selectScTransGroupVo">
SELECT tg.id,
tg.sheep_id,
tg.user_id,
tg.dept_id,
s.manage_tags AS manageTags,
tg.event_type AS eventType,
tg.trans_date AS transDate,
@@ -38,9 +42,7 @@
tg.create_time,
sf_from.sheepfold_name AS foldFromName,
sf_to.sheepfold_name AS foldToName,
tg.technician,
st.id AS sheepTypeId,
st.name AS sheepTypeName
tg.technician
FROM sc_trans_group tg
LEFT JOIN bas_sheep s ON tg.sheep_id = s.id
LEFT JOIN bas_sheep_type st ON s.type_id = st.id
@@ -74,6 +76,7 @@
<if test="sc.isDelete != null">
and s.is_delete = #{sc.isDelete}
</if>
${sc.params.dataScope}
</where>
ORDER BY tg.create_time DESC
</select>
@@ -99,6 +102,8 @@
<if test="comment != null">comment,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
@@ -112,6 +117,8 @@
<if test="comment != null">#{comment},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>

View File

@@ -19,12 +19,16 @@
<result property="comment" column="comment"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="userId" column="user_id"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<sql id="selectScTransitionInfoVo">
SELECT t.*,
bv.variety AS varietyName,
bs.manage_tags AS manageTags,
t.user_id,
t.dept_id,
sf.sheepfold_name AS sheepfoldName,
t.event_type AS eventType,
t.transition_date AS transitionDate,
@@ -77,6 +81,7 @@
<if test="sc.currentRanchId != null">
and bs.ranch_id = #{sc.currentRanchId}
</if>
${sc.params.dataScope}
</where>
ORDER BY t.create_time DESC
</select>
@@ -101,6 +106,8 @@
<if test="comment != null">comment,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
@@ -115,6 +122,8 @@
<if test="comment != null">#{comment},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
@@ -171,6 +180,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
</select>
</mapper>

View File

@@ -50,7 +50,9 @@
</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 sc.technician like concat('%', #{sc.technician}, '%')</if>
<if test="sc.technician != null and sc.technician != ''">
and sc.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 sc.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
</if>
@@ -60,6 +62,7 @@
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
${sc.params.dataScope}
</where>
ORDER BY sc.create_time DESC
</select>
@@ -80,6 +83,8 @@
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="eventDate != null">event_date,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
@@ -90,6 +95,8 @@
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="eventDate != null">#{eventDate},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
@@ -126,6 +133,5 @@
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
AND bs.is_delete = 0
ORDER BY bs.manage_tags
LIMIT 50
</select>
</mapper>

View File

@@ -59,6 +59,7 @@
<if test="sc.isDelete != null">
and bs.is_delete = #{sc.isDelete}
</if>
${sc.params.dataScope}
</where>
ORDER BY fh.create_time DESC
</select>
@@ -68,26 +69,32 @@
where fh.id = #{id}
</select>
<insert id="insertScFixHoof" parameterType="ScFixHoof"
useGeneratedKeys="true" keyProperty="id">
INSERT INTO sc_fix_hoof
(sheep_id,
sheepfold,
variety_id,
<if test="comment != null">comment,</if>
<if test="technician != null and technician != ''">technician,</if>
<if test="eventDate != null and eventDate != ''">event_date,</if>
create_by,
create_time)
VALUES
(#{sheepId},
#{sheepfold},
<if test="varietyId != null">#{varietyId},</if>
<if test="comment != null">#{comment},</if>
<if test="technician != null and technician != ''">#{technician},</if>
<if test="eventDate != null and eventDate != ''">#{eventDate},</if>
#{createBy},
#{createTime})
<insert id="insertScFixHoof" parameterType="ScFixHoof" useGeneratedKeys="true" keyProperty="id">
insert into sc_fix_hoof
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sheepId != null">sheep_id,</if>
<if test="sheepfold != null">sheepfold,</if>
<if test="varietyId != null">variety_id,</if>
<if test="comment != null">comment,</if>
<if test="technician != null and technician != ''">technician,</if>
<if test="eventDate != null and eventDate != ''">event_date,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sheepId != null">#{sheepId},</if>
<if test="sheepfold != null">#{sheepfold},</if>
<if test="varietyId != null">#{varietyId},</if>
<if test="comment != null">#{comment},</if>
<if test="technician != null and technician != ''">#{technician},</if>
<if test="eventDate != null and eventDate != ''">#{eventDate},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
<update id="updateScFixHoof" parameterType="ScFixHoof">