insert into purchase_apply_detail(
original_stock,quantity,operate,price,purchase_remark,purchase_quantity,rs_id,apply_order_id,remark,id,res_id
) values (
#{originalStock},#{quantity},#{operate},#{price},#{purchaseRemark},#{purchaseQuantity},#{rsId},#{applyOrderId},#{remark},#{id},#{resId}
)
update purchase_apply_detail t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.original_stock= #{originalStock}
, t.quantity= #{quantity}
, t.price= #{price}
, t.purchase_remark= #{purchaseRemark}
, t.purchase_quantity= #{purchaseQuantity}
, t.rs_id= #{rsId}
, t.apply_order_id= #{applyOrderId}
, t.remark= #{remark}
, t.res_id= #{resId}
where 1=1
and t.id= #{id}