UPDATE trade_detail SET voucher_status = #{refundStatus} WHERE id = #{item.id} AND voucher_status = #{item.voucherStatus} UPDATE trade_detail d LEFT JOIN ( SELECT detail_id FROM trade_detail_base WHERE use_status != 3 and order_id = #{orderId} GROUP BY detail_id ) b ON d.id = b.detail_id SET d.voucher_status = 3 WHERE d.order_id = #{orderId} and d.voucher_status in (1,2,8) and b.detail_id is null and d.voucher_status != 3 UPDATE trade_detail SET voucher_status = #{voucherStatus} WHERE id = #{tradeDetailId} update trade_detail set faceimg=#{url} WHERE voucher_code = #{voucherCode} td.*,tdo.order_no,tdb.id detail_base_id,tdb.detail_id,tdb.product_base_id,tdb.product_base_name,tdb.product_base_type, tdb.product_resource_id,tdb.product_resource_name,tdb.supplier_product_id,tdb.supplier_id, tdb.supplier_name,tdb.is_system_direct,tdb.use_status,tdb.check_status base_check_status,tdb.verify_time base_verify_time, tdb.price base_price,tdb.usage_count,tdb.product_resource_price,tdb.project_id,tdb.project_name, tdb.specification_id,tdb.specification_name,tdb.spec_type base_spec_type,tdb.supplier_voucher_code,tdb.plat_supplier_order_id, tv.id visitorId,tv.credential_no,tv.credential_type,tv.gender,tv.`name`,tv.mobile,tv.gender INSERT INTO system_sms_send_log ( `id`, `order_no`, `sms_config_id`, `sms_content`, `mobile`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `result`, `status` ) VALUES ( #{smsSendLogDTO.id}, #{smsSendLogDTO.orderNo}, #{smsSendLogDTO.smsConfigId}, #{smsSendLogDTO.smsContent}, #{smsSendLogDTO.mobile}, 1, now(), 1, now(), 0, #{smsSendLogDTO.result}, #{smsSendLogDTO.status} );