| | |
| | | SELECT |
| | | o.id, |
| | | o.order_no AS orderNo, |
| | | o.course_id AS courseId, |
| | | o.course_video_id AS courseVideoId, |
| | | o.user_nickname AS userNickname, |
| | | o.user_phone AS userPhone, |
| | | o.product_name_snapshot AS productName, |
| | | o.course_title_snapshot AS courseTitle, |
| | | o.chapter_name_snapshot AS chapterName, |
| | | o.cover_img_snapshot AS coverImage, |
| | | o.order_amount AS orderAmount, |
| | | o.payment_method AS paymentMethod, |
| | | o.refund_amount AS refundAmount, |
| | | o.refund_remark AS refundRemark, |
| | | o.status, |
| | | o.paid_at AS paidAt, |
| | | o.refunded_at AS refundedAt, |
| | | o.created_at AS createdAt |
| | | FROM tcm_course_purchase_order o |
| | | <include refid="CoursePurchaseOrderWhere"/> |
| | | ORDER BY o.id DESC |
| | | </select> |
| | | |
| | | <select id="selectOrderList" resultType="com.tcm.training.admin.live.vo.CoursePurchaseOrderListRow"> |
| | | <select id="selectAppUserOrderPage" resultType="com.tcm.training.admin.live.vo.CoursePurchaseOrderListRow"> |
| | | SELECT |
| | | o.id, |
| | | o.order_no AS orderNo, |
| | | o.course_id AS courseId, |
| | | o.course_video_id AS courseVideoId, |
| | | o.user_nickname AS userNickname, |
| | | o.user_phone AS userPhone, |
| | | o.product_name_snapshot AS productName, |
| | | o.course_title_snapshot AS courseTitle, |
| | | o.chapter_name_snapshot AS chapterName, |
| | | o.cover_img_snapshot AS coverImage, |
| | | o.order_amount AS orderAmount, |
| | | o.payment_method AS paymentMethod, |
| | | o.refund_amount AS refundAmount, |
| | | o.refund_remark AS refundRemark, |
| | | o.status, |
| | | o.paid_at AS paidAt, |
| | | o.refunded_at AS refundedAt, |
| | | o.created_at AS createdAt |
| | | FROM tcm_course_purchase_order o |
| | | WHERE o.deleted = 0 |
| | | AND o.course_type = 'HEALTH_COURSE' |
| | | AND o.status IN ('PAID', 'REFUNDED') |
| | | AND o.app_user_id = #{appUserId} |
| | | <if test="productName != null and productName.trim() != ''"> |
| | | AND o.product_name_snapshot LIKE CONCAT('%', #{productName}, '%') |
| | | </if> |
| | | ORDER BY o.id DESC |
| | | </select> |
| | | |
| | | <select id="selectAppUserOrderDetail" resultType="com.tcm.training.admin.live.vo.CoursePurchaseOrderListRow"> |
| | | SELECT |
| | | o.id, |
| | | o.order_no AS orderNo, |
| | | o.course_id AS courseId, |
| | | o.course_video_id AS courseVideoId, |
| | | o.user_nickname AS userNickname, |
| | | o.user_phone AS userPhone, |
| | | o.product_name_snapshot AS productName, |
| | | o.course_title_snapshot AS courseTitle, |
| | | o.chapter_name_snapshot AS chapterName, |
| | | o.cover_img_snapshot AS coverImage, |
| | | o.order_amount AS orderAmount, |
| | | o.payment_method AS paymentMethod, |
| | | o.refund_amount AS refundAmount, |
| | | o.refund_remark AS refundRemark, |
| | | o.status, |
| | | o.paid_at AS paidAt, |
| | | o.refunded_at AS refundedAt, |
| | | o.created_at AS createdAt |
| | | FROM tcm_course_purchase_order o |
| | | WHERE o.deleted = 0 |
| | | AND o.course_type = 'HEALTH_COURSE' |
| | | AND o.app_user_id = #{appUserId} |
| | | AND o.order_no = #{orderNo} |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="selectOrderList" resultType="com.tcm.training.admin.live.vo.CoursePurchaseOrderListRow"> |
| | | SELECT |
| | | o.id, |
| | | o.order_no AS orderNo, |
| | | o.course_id AS courseId, |
| | | o.course_video_id AS courseVideoId, |
| | | o.user_nickname AS userNickname, |
| | | o.user_phone AS userPhone, |
| | | o.product_name_snapshot AS productName, |
| | | o.course_title_snapshot AS courseTitle, |
| | | o.chapter_name_snapshot AS chapterName, |
| | | o.cover_img_snapshot AS coverImage, |
| | | o.order_amount AS orderAmount, |
| | | o.payment_method AS paymentMethod, |
| | | o.refund_amount AS refundAmount, |
| | | o.refund_remark AS refundRemark, |
| | | o.status, |
| | | o.paid_at AS paidAt, |
| | | o.refunded_at AS refundedAt, |
| | | o.created_at AS createdAt |
| | | FROM tcm_course_purchase_order o |
| | | <include refid="CoursePurchaseOrderWhere"/> |
| | | ORDER BY o.id DESC |
| | | </select> |
| | | |
| | | <select id="selectPaidCourseSnapshots" resultType="com.tcm.training.admin.live.vo.CoursePurchaseOrderListRow"> |
| | | SELECT |
| | | o.id, |
| | | o.order_no AS orderNo, |
| | | o.course_id AS courseId, |
| | | o.course_video_id AS courseVideoId, |
| | | o.user_nickname AS userNickname, |
| | | o.user_phone AS userPhone, |
| | | o.product_name_snapshot AS productName, |
| | | o.course_title_snapshot AS courseTitle, |
| | | o.chapter_name_snapshot AS chapterName, |
| | | o.cover_img_snapshot AS coverImage, |
| | | o.order_amount AS orderAmount, |
| | | o.payment_method AS paymentMethod, |
| | | o.refund_amount AS refundAmount, |
| | | o.refund_remark AS refundRemark, |
| | | o.status, |
| | | o.paid_at AS paidAt, |
| | | o.refunded_at AS refundedAt, |
| | | o.created_at AS createdAt |
| | | FROM tcm_course_purchase_order o |
| | | WHERE o.deleted = 0 |
| | | AND o.course_type = 'HEALTH_COURSE' |
| | | AND o.purchase_target_type = 'COURSE' |
| | | AND o.status = 'PAID' |
| | | AND o.app_user_id = #{appUserId} |
| | | ORDER BY o.paid_at DESC, o.id DESC |
| | | </select> |
| | | |
| | | </mapper> |