insert into resource_store(
sh_id, description, remark, store_id, res_id, parent_rst_id, warning_stock, rss_id,
res_name, rst_id, out_low_price, price, mini_unit_stock, unit_code, res_code,
mini_unit_code, average_price, stock, out_high_price, show_mobile, is_fixed,
mini_stock, community_id, community_name,
triple_waybill_no, system_name, model, brand, supplier,
budget_approval, budget_quantity, budget_unit_price, budget_amount,
apply_quantity_total, purchase_quantity_total, actual_delivery_quantity,
payable_amount_total, paid_amount_total, unpaid_amount_total, is_occurred,
-- 新增字段(按你提供的顺序补充)
payable_amount, paid_amount, unpaid_amount, total_return_quantity,
supplier1, supplier2, supplier3, rst_name
)
values (
#{shId}, #{description}, #{remark}, #{storeId}, #{resId}, #{parentRstId}, #{warningStock}, #{rssId},
#{resName}, #{rstId}, #{outLowPrice}, #{price}, #{miniUnitStock}, #{unitCode}, #{resCode},
#{miniUnitCode}, #{averagePrice}, #{stock}, #{outHighPrice}, #{showMobile}, #{isFixed},
#{miniStock}, #{communityId}, #{communityName},
#{tripleWaybillNo}, #{systemName}, #{model}, #{brand}, #{supplier},
#{budgetApproval}, #{budgetQuantity}, #{budgetUnitPrice}, #{budgetAmount},
#{applyQuantityTotal}, #{purchaseQuantityTotal}, #{actualDeliveryQuantity},
#{payableAmountTotal}, #{paidAmountTotal}, #{unpaidAmountTotal}, #{isOccurred},
#{payableAmount}, #{paidAmount}, #{unpaidAmount}, #{totalReturnQuantity},
#{supplier1}, #{supplier2}, #{supplier3}, #{rstName}
);
update resource_store t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.sh_id= #{shId}
, t.description= #{description}
, t.remark= #{remark}
, t.parent_rst_id= #{parentRstId}
, t.warning_stock= #{warningStock}
, t.rss_id= #{rssId}
, t.res_name= #{resName}
, t.rst_id= #{rstId}
, t.out_low_price= #{outLowPrice}
, t.price= #{price}
, t.mini_unit_stock= #{miniUnitStock}
, t.unit_code= #{unitCode}
, t.res_code= #{resCode}
, t.mini_unit_code= #{miniUnitCode}
, t.average_price= #{averagePrice}
, t.stock= #{stock}
, t.out_high_price= #{outHighPrice}
, t.show_mobile= #{showMobile}
, t.is_fixed= #{isFixed}
, t.mini_stock= #{miniStock}
where 1=1
and t.res_id= #{resId}
and t.community_id= #{communityId}
and t.store_id= #{storeId}