转场数据分离bug修复

This commit is contained in:
zyh
2026-02-09 21:46:12 +08:00
parent fb80399602
commit d9a621d6a7
5 changed files with 95 additions and 69 deletions

View File

@@ -91,53 +91,54 @@
WHERE t.id = #{id}
</select>
<insert id="insertScTransitionInfo" parameterType="ScTransitionInfo" useGeneratedKeys="true" keyProperty="id">
insert into sc_transition_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sheepId != null">sheep_id,</if>
<if test="varietyId != null">variety_id,</if>
<if test="transTo != null and transTo != ''">trans_to,</if>
<if test="transFrom != null and transFrom != ''">trans_from,</if>
<if test="eventType != null and eventType != ''">event_type,</if>
<if test="transType != null">trans_type,</if>
<if test="transitionDate != null">transition_date,</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>
<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="varietyId != null">#{varietyId},</if>
<if test="transTo != null and transTo != ''">#{transTo},</if>
<if test="transFrom != null and transFrom != ''">#{transFrom},</if>
<if test="eventType != null and eventType != ''">#{eventType},</if>
<if test="transType != null">#{transType},</if>
<if test="transitionDate != null">#{transitionDate},</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>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
<!-- <insert id="insertScTransitionInfo" parameterType="ScTransitionInfo" useGeneratedKeys="true" keyProperty="id">-->
<!-- insert into sc_transition_info-->
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
<!-- <if test="sheepId != null">sheep_id,</if>-->
<!-- <if test="varietyId != null">variety_id,</if>-->
<!-- <if test="transTo != null and transTo != ''">trans_to,</if>-->
<!-- <if test="transFrom != null and transFrom != ''">trans_from,</if>-->
<!-- <if test="eventType != null and eventType != ''">event_type,</if>-->
<!-- <if test="transType != null">trans_type,</if>-->
<!-- <if test="transitionDate != null">transition_date,</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>-->
<!-- <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="varietyId != null">#{varietyId},</if>-->
<!-- <if test="transTo != null and transTo != ''">#{transTo},</if>-->
<!-- <if test="transFrom != null and transFrom != ''">#{transFrom},</if>-->
<!-- <if test="eventType != null and eventType != ''">#{eventType},</if>-->
<!-- <if test="transType != null">#{transType},</if>-->
<!-- <if test="transitionDate != null">#{transitionDate},</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>-->
<!-- <if test="userId != null">#{userId},</if>-->
<!-- <if test="deptId != null">#{deptId},</if>-->
<!-- </trim>-->
<!-- </insert>-->
<insert id="insertScTransitionInfoBatch">
INSERT INTO sc_transition_info (
sheep_id, variety_id, trans_to, trans_from,
sheep_id,sheepfold_id, variety_id, trans_to, trans_from,
event_type,trans_type, transition_date, technician, status, comment,
create_by, create_time
create_by, create_time,user_id,dept_id
) VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.sheepId}, #{item.varietyId}, #{item.transTo}, #{item.transFrom}, #{item.eventType},
#{item.sheepId},#{item.sheepfoldId}, #{item.varietyId}, #{item.transTo}, #{item.transFrom}, #{item.eventType},
#{item.transType},#{item.transitionDate}, #{item.technician}, #{item.status}, #{item.comment},
#{item.createBy}, now()
#{item.createBy}, now(), #{item.userId},
#{item.deptId}
)
</foreach>
</insert>