id,
order_num,
user_id,
pick_up_method,
(select su.name from union_user as su where su.id=union_exchange_record.user_id) as userName,
(select su.phone from union_user as su where su.id=union_exchange_record.user_id) as phone,
goods_id,
(select su.good_name from union_store as su where su.id=union_exchange_record.goods_id) as goodName,
(select su.goods_cover_url from union_store as su where su.id=union_exchange_record.goods_id) as goodsCoverUrl,
(select su.goods_url from union_store as su where su.id=union_exchange_record.goods_id) as goodsUrl,
order_type,
consumption_points,
consignee,
consignee_phone,
consignee_address,
lat,
lng,
goods_num,
logistics_company,
logistics_num,
play_integral,
community_id,
pick_up_address,
create_time,
update_time
insert into union_exchange_record
id,
user_id,
community_id,
order_num,
goods_id,
order_type,
consumption_points,
consignee,
consignee_phone,
consignee_address,
lat,
lng,
goods_num,
logistics_company,
logistics_num,
play_integral,
pick_up_method,
pick_up_address,
create_time
values
#{item.id},
#{item.userId},
#{item.communityId},
#{item.orderNum},
#{item.goodsId},
#{item.orderType},
#{item.consumptionPoints},
#{item.consignee},
#{item.consigneePhone},
#{item.consigneeAddress},
#{item.lat},
#{item.lng},
#{item.goodsNum},
#{item.logisticsCompany},
#{item.logisticsNum},
#{item.playIntegral},
#{item.pickUpMethod},
#{item.pickUpAddress},
sysdate()
update union_exchange_record
id=#{item.id},
user_id=#{item.userId},
community_id=#{item.communityId},
order_num=#{item.orderNum},
goods_id=#{item.goodsId},
order_type=#{item.orderType},
consumption_points=#{item.consumptionPoints},
consignee=#{item.consignee},
consignee_phone=#{item.consigneePhone},
consignee_address=#{item.consigneeAddress},
lat=#{item.lat},
lng=#{item.lng},
goods_num=#{item.goodsNum},
logistics_company=#{item.logisticsCompany},
logistics_num=#{item.logisticsNum},
play_integral=#{item.playIntegral},
pick_up_method=#{item.pickUpMethod},
pick_up_address=#{item.pickUpAddress},
update_time=sysdate()
where id = #{item.id}
delete from union_exchange_record where id=#{id}