insert into coupon_detail(
buy_price,coupon_name,amount,buy_count,actual_price,validity_day,pool_id,detail_id,shop_id,order_id,shop_name
) values (
#{buyPrice},#{couponName},#{amount},#{buyCount},#{actualPrice},#{validityDay},#{poolId},#{detailId},#{shopId},#{orderId},#{shopName}
)
update coupon_detail t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.buy_price= #{buyPrice}
, t.coupon_name= #{couponName}
, t.amount= #{amount}
, t.order_id= #{orderId}
, t.shop_name= #{shopName}
, t.buy_count= #{buyCount}
, t.actual_price= #{actualPrice}
, t.validity_day= #{validityDay}
, t.pool_id= #{poolId}
, t.shop_id= #{shopId}
where 1=1
and t.detail_id= #{detailId}