insert into purchase_apply_detail(original_stock, quantity, operate, price, purchase_remark, purchase_quantity, rs_id, apply_order_id, remark, id, res_id, times_id, consult_price, b_id) values (#{originalStock}, #{quantity}, 'ADD', #{price}, #{purchaseRemark}, #{purchaseQuantity}, #{rsId}, #{applyOrderId}, #{remark}, #{id}, #{resId}, #{timesId}, #{consultPrice}, #{bId}) 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.remark= #{remark} , t.res_id= #{resId} where 1=1 and t.id= #{id} and t.apply_order_id= #{applyOrderId}