Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

ct 1 неделя назад
Родитель
Сommit
05c0810fdc
1 измененных файлов с 76 добавлено и 34 удалено
  1. 76 34
      fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml

+ 76 - 34
fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml

@@ -522,39 +522,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="(maps.companyUserNickName != null and maps.companyUserNickName !='') or (maps.params.dataScope!=null) ">
             LEFT JOIN  company_user cu on cu.user_id=so.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
+            WHERE sp.business_code IS NOT NULL
+            ) sp_latest ON sp_latest.business_code = so.order_code AND sp_latest.rn = 1
+            LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id
+        </if>
 
         where so.is_del=0
-        <if test="maps.packageSecondName != null and maps.packageSecondName != '' ">
+        <if test="maps.packageSecondName != null and maps.packageSecondName != ''">
             and so.package_second_name like concat('%', #{maps.packageSecondName}, '%')
         </if>
-        <if test="maps.storeId != null ">
+        <if test="maps.storeId != null">
             and so.store_id = #{maps.storeId}
         </if>
+        <if test="maps.coursePlaySourceConfigId != null">
+            and csc.id = #{maps.coursePlaySourceConfigId}
+        </if>
         <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
             and so.order_code in
             <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
                 #{orderCode}
             </foreach>
         </if>
-        <if test="maps.orderCode != null and maps.orderCode != ''">
+        <if test="maps.orderCode != null  and maps.orderCode != ''">
             and so.order_code = #{maps.orderCode}
         </if>
-        <if test="maps.prescribeCode != null and maps.prescribeCode != ''">
+        <if test="maps.prescribeCode != null  and maps.prescribeCode != ''">
             and p.prescribe_code = #{maps.prescribeCode}
         </if>
-        <if test="maps.userName != null and maps.userName != ''">
+        <if test="maps.userName != null  and maps.userName != ''">
             and so.user_name like concat('%', #{maps.userName}, '%')
         </if>
-        <if test="maps.userPhone != null and maps.userPhone != ''">
+        <if test="maps.userPhone != null  and maps.userPhone != ''">
             and so.user_phone = #{maps.userPhone}
         </if>
         <if test="maps.userId != null ">
             and so.user_id = #{maps.userId}
         </if>
-        <if test="maps.isFirst != null ">
+        <if test="maps.isFirst != null">
             and so.is_first = #{maps.isFirst}
         </if>
-        <if test="maps.status != null  and maps.status != 6">
+        <if test="maps.status != null and maps.status != 6">
             and so.status = #{maps.status}
         </if>
         <if test="maps.status == 6">
@@ -562,9 +575,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             and (
             so.store_id in (select store_id from fs_store where delivery_type=2 or delivery_type=1)
             )
-            and  (so.extend_order_id is null or so.extend_order_id like '')
+            and  (so.extend_order_id is null or  so.extend_order_id like '')
         </if>
-        <if test="maps.deliverySn != null and maps.deliverySn != ''">
+        <if test="maps.source != null">
+            and so.source = #{maps.source}
+        </if>
+        <if test="maps.deliverySn != null  and maps.deliverySn != ''">
             and so.delivery_sn = #{maps.deliverySn}
         </if>
         <if test="maps.prescribeId != null">
@@ -615,7 +631,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="maps.tuieTime != null">
             and DATE(so.tui_money_time) &lt;= DATE(#{maps.tuieTime})
         </if>
-        <if test="maps.companyUserNickName != null and maps.companyUserNickName !='' ">
+        <if test="maps.companyUserNickName != null and  maps.companyUserNickName !=''">
             and cu.nick_name like concat( #{maps.companyUserNickName}, '%')
         </if>
         <if test="maps.companyIds != null and  maps.companyIds.size >0">
@@ -624,69 +640,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 #{companyId}
             </foreach>
         </if>
-        <if test='maps.companyId != null and maps.companyId != "-1" '>
-            and so.company_id = #{maps.companyId}
+        <if test="maps.companyId != null and  maps.companyId != -1">
+            and so.company_id =#{maps.companyId}
         </if>
-        <if test='maps.companyId == "-1"'>
+        <if test="maps.companyId == -1">
             and so.company_id is null
         </if>
-        <if test='maps.deliveryStatus != null '>
+        <if test="maps.deliveryStatus != null">
             and so.delivery_status =#{maps.deliveryStatus}
         </if>
-        <if test='maps.customerId != null '>
+        <if test="maps.customerId != null">
             and so.customer_id =#{maps.customerId}
         </if>
-        <if test='maps.deliveryPayStatus != null '>
+        <if test="maps.deliveryPayStatus != null">
             and so.delivery_pay_status =#{maps.deliveryPayStatus}
         </if>
-        <if test='maps.tuiMoneyStatus != null '>
+        <if test="maps.tuiMoneyStatus != null">
             and so.tui_money_status =#{maps.tuiMoneyStatus}
         </if>
-        <if test='maps.deptId != null '>
+        <if test="maps.deptId != null">
             AND (so.dept_id = #{maps.deptId} OR so.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) ))
         </if>
-        <if test='maps.packageName != null and maps.packageName != "" '>
+        <if test="maps.packageName != null and maps.packageName != ''">
             and so.package_name like concat('%', #{maps.packageName}, '%')
         </if>
-        <if test='maps.payType != null '>
+        <if test="maps.payType != null">
             and so.pay_type IN
-            <foreach collection="maps.payType.split(',') "  item='item' index='index'  open='(' separator=',' close=')'>
+            <foreach collection="maps.payType.split(',')" item="item" index="index" open="(" close=")" separator=",">
                 #{item}
             </foreach>
         </if>
-        <if test='maps.scheduleId != null and  maps.scheduleId != "-1" '>
+        <if test="maps.scheduleId != null  and  maps.scheduleId != -1">
             and so.schedule_id IN
-            <foreach collection="maps.scheduleId.split(',') "  item='item' index='index'  open='(' separator=',' close=')'>
+            <foreach collection="maps.scheduleId.split(',')" item="item" index="index" open="(" close=")" separator=",">
                 #{item}
             </foreach>
         </if>
-        <if test='maps.scheduleId == "-1" '>
+        <if test="maps.scheduleId == -1">
             and so.schedule_id is null
         </if>
-        <if test='maps.orderBuyType != null and  maps.orderBuyType != "-1" '>
+        <if test="maps.orderBuyType != null and maps.orderBuyType != -1">
             and so.order_buy_type IN
-            <foreach collection="maps.orderBuyType.split(',') "  item='item' index='index'  open='(' separator=',' close=')'>
+            <foreach collection="maps.orderBuyType.split(',')" item="item" index="index" open="(" close=")" separator=",">
                 #{item}
             </foreach>
         </if>
-        <if test='maps.orderBuyType == "-1" '>
+        <if test="maps.orderBuyType == -1">
             and so.order_buy_type is null
         </if>
-        <if test='maps.orderChannel == "-1" '>
+        <if test="maps.orderChannel == -1">
             and so.order_channel is null
         </if>
-        <if test='maps.orderChannel != null and  maps.orderChannel != "-1" '>
+        <if test="maps.orderChannel != null and maps.orderChannel != -1">
             and so.order_channel IN
-            <foreach collection="maps.orderChannel.split(',') "  item='item' index='index'  open='(' separator=',' close=')'>
+            <foreach collection="maps.orderChannel.split(',')" item="item" index="index" open="(" close=")" separator=",">
                 #{item}
             </foreach>
         </if>
-        <if test='maps.qwSubject == "-1"'>
+        <if test="maps.qwSubject == -1">
             and so.qw_subject is null
         </if>
-        <if test='maps.qwSubject != null and  maps.qwSubject != "-1" '>
+        <if test="maps.qwSubject != null and maps.qwSubject != -1">
             and so.qw_subject IN
-            <foreach collection="maps.qwSubject.split(',') "  item='item' index='index'  open='(' separator=',' close=')'>
+            <foreach collection="maps.qwSubject.split(',')" item="item" index="index" open="(" close=")" separator=",">
                 #{item}
             </foreach>
         </if>
@@ -1639,6 +1655,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN fs_doctor d ON so.doctor_id= d.doctor_id
         LEFT JOIN company_user cu on cu.user_id=so.company_user_id
         LEFT JOIN fs_store_order_df df on df.order_id=so.order_id
+        <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
+            WHERE sp.business_code IS NOT NULL
+            ) sp_latest ON sp_latest.business_code = so.order_code AND sp_latest.rn = 1
+            LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id
+        </if>
         <where>
             <if test="maps.packageSecondName != null and maps.packageSecondName != ''">
                 and so.package_second_name like concat('%', #{maps.packageSecondName}, '%')
@@ -1646,6 +1672,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.storeId != null">
                 and so.store_id = #{maps.storeId}
             </if>
+            <if test="maps.coursePlaySourceConfigId != null">
+                and csc.id = #{maps.coursePlaySourceConfigId}
+            </if>
             <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
                 and so.order_code in
                 <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
@@ -1837,6 +1866,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN fs_doctor d ON so.doctor_id= d.doctor_id
         LEFT JOIN company_user cu on cu.user_id=so.company_user_id
         LEFT JOIN fs_store_order_df df on df.order_id=so.order_id
+        <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
+            WHERE sp.business_code IS NOT NULL
+            ) sp_latest ON sp_latest.business_code = so.order_code AND sp_latest.rn = 1
+            LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id
+        </if>
         <where>
             <if test="maps.packageSecondName != null and maps.packageSecondName != ''">
                 and so.package_second_name like concat('%', #{maps.packageSecondName}, '%')
@@ -1844,6 +1883,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.storeId != null">
                 and so.store_id = #{maps.storeId}
             </if>
+            <if test="maps.coursePlaySourceConfigId != null">
+                and csc.id = #{maps.coursePlaySourceConfigId}
+            </if>
             <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
                 and so.order_code in
                 <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">