|
@@ -283,8 +283,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="maps.doctorName != null">LEFT JOIN fs_doctor d ON d.doctor_id = o.doctor_id </if>
|
|
<if test="maps.doctorName != null">LEFT JOIN fs_doctor d ON d.doctor_id = o.doctor_id </if>
|
|
|
<if test="(maps.userPhone != null and maps.userPhone != '') or (maps.userName != null and maps.userName != '')">LEFT JOIN fs_store_order fso ON fso.order_id = o.store_order_id </if>
|
|
<if test="(maps.userPhone != null and maps.userPhone != '') or (maps.userName != null and maps.userName != '')">LEFT JOIN fs_store_order fso ON fso.order_id = o.store_order_id </if>
|
|
|
<if test='maps.companyUserName != null or maps.params.dataScope!=null'>LEFT JOIN company_user cu ON cu.user_id = o.company_user_id </if>
|
|
<if test='maps.companyUserName != null or maps.params.dataScope!=null'>LEFT JOIN company_user cu ON cu.user_id = o.company_user_id </if>
|
|
|
|
|
+ <if test="maps.coursePlaySourceConfigId != null">LEFT JOIN (
|
|
|
|
|
+ SELECT sp.*,
|
|
|
|
|
+ ROW_NUMBER() OVER (PARTITION BY sp.business_code ORDER BY sp.create_time DESC) AS rn
|
|
|
|
|
+ FROM fs_store_payment sp
|
|
|
|
|
+ ) sp_latest ON sp_latest.business_code = o.order_sn AND sp_latest.rn = 1 LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id</if>
|
|
|
where 1=1
|
|
where 1=1
|
|
|
<if test="maps.orderSn != null and maps.orderSn != ''"> and o.order_sn = #{maps.orderSn}</if>
|
|
<if test="maps.orderSn != null and maps.orderSn != ''"> and o.order_sn = #{maps.orderSn}</if>
|
|
|
|
|
+ <if test="maps.coursePlaySourceConfigId != null"> and csc.id = #{maps.coursePlaySourceConfigId}</if>
|
|
|
<if test="maps.phone != null">and u.phone like concat( #{maps.phone}, '%')</if>
|
|
<if test="maps.phone != null">and u.phone like concat( #{maps.phone}, '%')</if>
|
|
|
<if test="maps.doctorName != null">and d.doctor_name like concat('%', #{maps.doctorName}, '%')</if>
|
|
<if test="maps.doctorName != null">and d.doctor_name like concat('%', #{maps.doctorName}, '%')</if>
|
|
|
<if test="maps.packageName != null and maps.packageName != ''"> and o.package_name like concat('%', #{maps.packageName}, '%')</if>
|
|
<if test="maps.packageName != null and maps.packageName != ''"> and o.package_name like concat('%', #{maps.packageName}, '%')</if>
|