|
|
|
@ -2953,6 +2953,8 @@ |
|
|
|
a.site, |
|
|
|
a.bu_no, |
|
|
|
a.inspection_no, |
|
|
|
-- 明细唯一顺序号:用于前端回传后精确更新对应明细行,避免同 item_no 多行被互相覆盖 |
|
|
|
a.order_id, |
|
|
|
a.template_id, |
|
|
|
a.sampling_level_no, |
|
|
|
a.sampling_level_desc, |
|
|
|
@ -3046,7 +3048,20 @@ |
|
|
|
sampling_qty = #{samplingQty,jdbcType=DECIMAL}, |
|
|
|
text_value = #{textValue}, |
|
|
|
number_value = #{numberValue,jdbcType=DECIMAL} |
|
|
|
WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} |
|
|
|
WHERE inspection_no = #{inspectionNo} |
|
|
|
and site = #{site} |
|
|
|
and bu_no = #{buNo} |
|
|
|
<choose> |
|
|
|
<!-- 优先使用 order_id 精确定位单行,避免同 item_no 多行时被批量覆盖 --> |
|
|
|
<when test="orderId != null"> |
|
|
|
and order_id = #{orderId,jdbcType=INTEGER} |
|
|
|
</when> |
|
|
|
<!-- 兼容历史数据:若 order_id 为空,退回 item_no + object_id 组合定位 --> |
|
|
|
<otherwise> |
|
|
|
and item_no = #{itemNo} |
|
|
|
and object_id = #{objectId} |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
</update> |
|
|
|
|
|
|
|
<!-- 查询该记录明细是否已存在 --> |
|
|
|
|