a.id AS "id", a.orderCode AS "orderCode", a.totalAmount AS "totalAmount", a.refundAmount AS "refundAmount", a.paymentTime AS "paymentTime", a.refundTime AS "refundTime", a.couponCode AS "couponCode", a.discountAmount AS "discountAmount", a.status AS "status", a.customerCode AS "customerCode", a.customerName AS "customerName", a.customerMobile AS "customerMobile", a.refundFlag AS "refundFlag", a.createTime AS "createTime", a.updateTime AS "updateTime", a.delFlag AS "delFlag", u.userName AS "clubName", ccrs.mobile AS "couponMobile" LEFT JOIN cm_coupon_record ccr ON ccr.couponCode = a.couponCode LEFT JOIN cm_coupon_record_scan ccrs ON ccrs.couponCode = a.couponCode LEFT JOIN user u ON u.userID = ccr.userID LEFT JOIN club c on c.userID = u.companyUserID INSERT INTO cm_coupon_order_record( id, orderCode, totalAmount, refundAmount, paymentTime, refundTime, couponCode, discountAmount, status, customerCode, customerName, customerMobile, refundFlag, createTime, updateTime, delFlag ) VALUES ( #{id}, #{orderCode}, #{totalAmount}, #{refundAmount}, #{paymentTime}, #{refundTime}, #{couponCode}, #{discountAmount}, #{status}, #{customerCode}, #{customerName}, #{customerMobile}, #{refundFlag}, #{createTime}, #{updateTime}, #{delFlag} ) UPDATE cm_coupon_order_record SET orderCode = #{orderCode}, totalAmount = #{totalAmount}, refundAmount = #{refundAmount}, paymentTime = #{paymentTime}, refundTime = #{refundTime}, couponCode = #{couponCode}, discountAmount = #{discountAmount}, status = #{status}, customerCode = #{customerCode}, customerName = #{customerName}, customerMobile = #{customerMobile}, refundFlag = #{refundFlag}, createTime = #{createTime}, updateTime = #{updateTime}, delFlag = #{delFlag} WHERE id = #{id} DELETE FROM cm_coupon_order_record WHERE id = #{id}