SELECT it.id,
it.user_id,
it.order_id,
it.store_id,
it.goods_id,
it.admin_id,
it.goods_sku_price_id,
it.activity_id,
it.activity_type,
it.item_goods_sku_price_id,
it.goods_sku_text,
it.goods_title,
it.goods_image,
it.goods_original_price,
it.discount_fee,
it.total_price,
it.goods_price,
it.pay_price,
it.goods_num,
it.dispatch_status,
it.dispatch_fee,
it.dispatch_type,
it.dispatch_id,
it.aftersale_status,
it.comment_status,
it.refund_status,
it.refund_fee,
it.refund_cause,
it.refund_msg,
it.express_name,
it.express_no,
it.create_time,
it.update_time,
it.deletetime,
it.`read`,
it.create_by,
it.update_by,
it.dept_id,
(SELECT dict_label
FROM sys_dict_data
WHERE dict_type = 'wcsc_dispatch_status'
AND dict_value = it.dispatch_status) AS dispatchStatusText,
(SELECT dict_label
FROM sys_dict_data
WHERE dict_type = 'wcsc_aftersale_status'
AND dict_value = it.aftersale_status) AS aftersaleStatusText,
(SELECT dict_label
FROM sys_dict_data
WHERE dict_type = 'wcsc_comment_status'
AND dict_value = it.comment_status) AS commentStatusText,
(SELECT dict_label
FROM sys_dict_data
WHERE dict_type = 'wcsc_refund_status'
AND dict_value = it.refund_status) AS refundStatusText,
good.title,
pr.weigh AS pub_weigh,
pr.image AS pub_image,
pr.stock AS pub_stock,
pr.sales AS pub_sales,
pr.sn AS pub_sn,
pr.weight AS pub_weight,
pr.price AS pub_price,
pr.STATUS AS pub_status,
su.nick_name AS nickName
FROM zdy_wcsc_order_item it
LEFT JOIN zdy_wcsc_goods good ON good.id = it.goods_id
LEFT JOIN zdy_wcsc_goods_sku_price pr ON pr.id = it.goods_sku_price_id
LEFT JOIN sys_user su ON su.user_id = it.admin_id
insert into zdy_wcsc_order_item
user_id,
order_id,
store_id,
goods_id,
admin_id,
goods_sku_price_id,
activity_id,
activity_type,
item_goods_sku_price_id,
goods_sku_text,
goods_title,
goods_image,
goods_original_price,
discount_fee,
total_price,
goods_price,
pay_price,
goods_num,
dispatch_status,
dispatch_fee,
dispatch_type,
dispatch_id,
aftersale_status,
comment_status,
refund_status,
refund_fee,
refund_cause,
refund_msg,
express_name,
express_no,
create_time,
update_time,
deletetime,
`read`,
create_by,
update_by,
dept_id,
#{userId},
#{orderId},
#{storeId},
#{goodsId},
#{adminId},
#{goodsSkuPriceId},
#{activityId},
#{activityType},
#{itemGoodsSkuPriceId},
#{goodsSkuText},
#{goodsTitle},
#{goodsImage},
#{goodsOriginalPrice},
#{discountFee},
#{totalPrice},
#{goodsPrice},
#{payPrice},
#{goodsNum},
#{dispatchStatus},
#{dispatchFee},
#{dispatchType},
#{dispatchId},
#{aftersaleStatus},
#{commentStatus},
#{refundStatus},
#{refundFee},
#{refundCause},
#{refundMsg},
#{expressName},
#{expressNo},
#{createTime},
#{updateTime},
#{deletetime},
#{read},
#{createBy},
#{updateBy},
#{deptId},
update zdy_wcsc_order_item
user_id =
#{userId},
order_id =
#{orderId},
store_id =
#{storeId},
goods_id =
#{goodsId},
admin_id =
#{adminId},
goods_sku_price_id =
#{goodsSkuPriceId},
activity_id =
#{activityId},
activity_type =
#{activityType},
item_goods_sku_price_id =
#{itemGoodsSkuPriceId},
goods_sku_text =
#{goodsSkuText},
goods_title =
#{goodsTitle},
goods_image =
#{goodsImage},
goods_original_price =
#{goodsOriginalPrice},
discount_fee =
#{discountFee},
total_price =
#{totalPrice},
goods_price =
#{goodsPrice},
pay_price =
#{payPrice},
goods_num =
#{goodsNum},
dispatch_status =
#{dispatchStatus},
dispatch_fee =
#{dispatchFee},
dispatch_type =
#{dispatchType},
dispatch_id =
#{dispatchId},
aftersale_status =
#{aftersaleStatus},
comment_status =
#{commentStatus},
refund_status =
#{refundStatus},
refund_fee =
#{refundFee},
refund_cause =
#{refundCause},
refund_msg =
#{refundMsg},
express_name =
#{expressName},
express_no =
#{expressNo},
create_time =
#{createTime},
update_time =
#{updateTime},
deletetime =
#{deletetime},
`read` =
#{read},
create_by =
#{createBy},
update_by =
#{updateBy},
dept_id =
#{deptId},
where id = #{id}
delete
from zdy_wcsc_order_item
where id = #{id}
delete from zdy_wcsc_order_item where id in
#{id}