|
|
@@ -1929,133 +1929,143 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
) >= 3
|
|
|
</select>
|
|
|
|
|
|
- <select id="getDeliveryNote" resultType="com.fs.hisStore.vo.FsStoreOrderDeliveryNoteExportVO">
|
|
|
- SELECT
|
|
|
- CONCAT('AC', o.id) AS orderNumber,
|
|
|
- o.real_name AS recipient,
|
|
|
- o.user_phone AS recipientPhone,
|
|
|
- o.user_address AS recipientAddress,
|
|
|
- GROUP_CONCAT(
|
|
|
- DISTINCT IFNULL(
|
|
|
- CASE WHEN LENGTH(sps.product_name) > 0
|
|
|
- THEN CONCAT(sps.product_name, '*', sois.num)
|
|
|
- END, ''
|
|
|
- )
|
|
|
- SEPARATOR '+'
|
|
|
- ) AS nameAndNumber,
|
|
|
- sps.keyword
|
|
|
- FROM
|
|
|
- fs_store_order_scrm o
|
|
|
- LEFT JOIN fs_store_order_item_scrm sois
|
|
|
- ON sois.order_id = o.id
|
|
|
- LEFT JOIN fs_store_product_scrm sps
|
|
|
- ON sps.product_id = sois.product_id
|
|
|
- LEFT JOIN fs_user u
|
|
|
- ON o.user_id = u.user_id
|
|
|
- LEFT JOIN company c
|
|
|
- ON c.company_id = o.company_id
|
|
|
- LEFT JOIN company_user cu
|
|
|
- ON cu.user_id = o.company_user_id
|
|
|
- LEFT JOIN (
|
|
|
- SELECT DISTINCT order_id
|
|
|
- FROM fs_store_payment_scrm
|
|
|
- WHERE is_pay_remain != 0 AND STATUS != 0
|
|
|
- ) fp
|
|
|
- ON o.id = fp.order_id
|
|
|
- WHERE
|
|
|
- o.is_del = 0 and
|
|
|
- 1 = 1
|
|
|
- <if test="maps.orderCode != null and maps.orderCode != ''">
|
|
|
- AND o.order_code LIKE CONCAT('%', #{maps.orderCode}, '%')
|
|
|
- </if>
|
|
|
- <if test="maps.userId != null">
|
|
|
- AND o.user_id = #{maps.userId}
|
|
|
- </if>
|
|
|
- <if test="maps.deliveryId != null and maps.deliveryId != ''">
|
|
|
- AND o.delivery_id = #{maps.deliveryId}
|
|
|
- </if>
|
|
|
- <if test="maps.nickname != null and maps.nickname != ''">
|
|
|
- AND u.nickname LIKE CONCAT('%', #{maps.nickname}, '%')
|
|
|
- </if>
|
|
|
- <if test="maps.realName != null and maps.realName != ''">
|
|
|
- AND o.real_name LIKE CONCAT('%', #{maps.realName}, '%')
|
|
|
- </if>
|
|
|
- <if test="maps.phone != null and maps.phone != ''">
|
|
|
- AND u.phone LIKE CONCAT('%', #{maps.phone}, '%')
|
|
|
- </if>
|
|
|
- <if test="maps.userPhone != null and maps.userPhone != ''">
|
|
|
- AND o.user_phone LIKE CONCAT('%', #{maps.userPhone}, '%')
|
|
|
- </if>
|
|
|
- <if test="maps.status == null">
|
|
|
- AND o.status = 1
|
|
|
- </if>
|
|
|
- <if test="maps.status != null">
|
|
|
- AND o.status = #{maps.status}
|
|
|
- </if>
|
|
|
- <if test="maps.deliveryStatus != null">
|
|
|
- AND o.delivery_status = #{maps.deliveryStatus}
|
|
|
- </if>
|
|
|
- <if test="maps.deliveryPayStatus != null">
|
|
|
- AND o.delivery_pay_status = #{maps.deliveryPayStatus}
|
|
|
- </if>
|
|
|
- <if test="maps.companyId != null">
|
|
|
- AND o.company_id = #{maps.companyId}
|
|
|
- </if>
|
|
|
- <if test="maps.isHealth != null and maps.isHealth != ''">
|
|
|
- AND o.company_id IS NULL
|
|
|
- </if>
|
|
|
- <if test="maps.notHealth != null and maps.notHealth != ''">
|
|
|
- AND o.company_id IS NOT NULL
|
|
|
- </if>
|
|
|
- <if test="maps.companyUserId != null">
|
|
|
- AND o.company_user_id = #{maps.companyUserId}
|
|
|
- </if>
|
|
|
- <if test="maps.companyUserNickName != null and maps.companyUserNickName != ''">
|
|
|
- AND cu.nick_name LIKE CONCAT('%', #{maps.companyUserNickName}, '%')
|
|
|
- </if>
|
|
|
- <if test="maps.orderType != null">
|
|
|
- AND o.order_type = #{maps.orderType}
|
|
|
- </if>
|
|
|
- <if test="maps.payType != null">
|
|
|
- AND o.pay_type = #{maps.payType}
|
|
|
- </if>
|
|
|
- <if test="maps.createTimeList != null">
|
|
|
- AND o.create_time >= STR_TO_DATE(#{maps.createTimeList[0]}, '%Y%m%d')
|
|
|
- AND o.create_time < DATE_ADD(STR_TO_DATE(#{maps.createTimeList[1]}, '%Y%m%d'), INTERVAL 1 DAY)
|
|
|
- </if>
|
|
|
- <if test="maps.payTimeList != null">
|
|
|
- AND o.pay_time >= STR_TO_DATE(#{maps.payTimeList[0]}, '%Y%m%d')
|
|
|
- AND o.pay_time < DATE_ADD(STR_TO_DATE(#{maps.payTimeList[1]}, '%Y%m%d'), INTERVAL 1 DAY)
|
|
|
- </if>
|
|
|
- <if test="maps.deliverySendTimeList != null">
|
|
|
- AND o.delivery_send_time >= STR_TO_DATE(#{maps.deliverySendTimeList[0]}, '%Y%m%d')
|
|
|
- AND o.delivery_send_time < DATE_ADD(STR_TO_DATE(#{maps.deliverySendTimeList[1]}, '%Y%m%d'), INTERVAL 1 DAY)
|
|
|
- </if>
|
|
|
- <if test="maps.deliveryImportTimeList != null">
|
|
|
- AND o.delivery_import_time >= STR_TO_DATE(#{maps.deliveryImportTimeList[0]}, '%Y%m%d')
|
|
|
- AND o.delivery_import_time < DATE_ADD(STR_TO_DATE(#{maps.deliveryImportTimeList[1]}, '%Y%m%d'), INTERVAL 1 DAY)
|
|
|
- </if>
|
|
|
- <if test="maps.deptId != null">
|
|
|
- AND (o.dept_id = #{maps.deptId}
|
|
|
- OR o.dept_id IN (SELECT t.dept_id FROM company_dept t WHERE FIND_IN_SET(#{maps.deptId}, t.ancestors)))
|
|
|
- </if>
|
|
|
- <if test="maps.isUpload != null and maps.isUpload == 0">
|
|
|
- AND o.certificates IS NULL
|
|
|
- </if>
|
|
|
- <if test="maps.scheduleId != null">
|
|
|
- AND o.schedule_id = #{maps.scheduleId}
|
|
|
- </if>
|
|
|
- <if test="maps.isUpload != null and maps.isUpload == 1">
|
|
|
- AND o.certificates IS NOT NULL
|
|
|
- </if>
|
|
|
- <if test="maps.appId != null and maps.appId != ''">
|
|
|
- AND u.app_id LIKE CONCAT('%', #{maps.appId}, '%')
|
|
|
- </if>
|
|
|
- ${maps.params.dataScope}
|
|
|
- AND o.paid = 1
|
|
|
- GROUP BY o.id
|
|
|
- LIMIT 10000;
|
|
|
- </select>
|
|
|
+<!-- <select id="getDeliveryNote1" resultType="com.fs.hisStore.vo.FsStoreOrderDeliveryNoteExportVO">-->
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- o.order_code AS orderNumber,-->
|
|
|
+<!-- o.real_name AS recipient,-->
|
|
|
+<!-- o.user_phone AS recipientPhone,-->
|
|
|
+<!-- o.user_address AS recipientAddress,-->
|
|
|
+<!-- GROUP_CONCAT(-->
|
|
|
+<!-- DISTINCT IFNULL(-->
|
|
|
+<!-- CASE WHEN LENGTH(sps.product_name) > 0-->
|
|
|
+<!-- THEN CONCAT(sps.product_name, '*', sois.num)-->
|
|
|
+<!-- END, ''-->
|
|
|
+<!-- )-->
|
|
|
+<!-- SEPARATOR '+'-->
|
|
|
+<!-- ) AS nameAndNumber,-->
|
|
|
+<!-- sps.keyword,-->
|
|
|
+<!-- fcpsc.name AS miniAppName-->
|
|
|
+<!-- FROM-->
|
|
|
+<!-- fs_store_order_scrm o-->
|
|
|
+<!-- LEFT JOIN fs_store_order_item_scrm sois-->
|
|
|
+<!-- ON sois.order_id = o.id-->
|
|
|
+<!-- LEFT JOIN fs_store_product_scrm sps-->
|
|
|
+<!-- ON sps.product_id = sois.product_id-->
|
|
|
+<!-- LEFT JOIN fs_user u-->
|
|
|
+<!-- ON o.user_id = u.user_id-->
|
|
|
+<!-- LEFT JOIN company c-->
|
|
|
+<!-- ON c.company_id = o.company_id-->
|
|
|
+<!-- LEFT JOIN company_user cu-->
|
|
|
+<!-- ON cu.user_id = o.company_user_id-->
|
|
|
+<!-- LEFT JOIN (-->
|
|
|
+<!-- SELECT DISTINCT order_id-->
|
|
|
+<!-- FROM fs_store_payment_scrm-->
|
|
|
+<!-- WHERE is_pay_remain != 0 AND STATUS != 0-->
|
|
|
+<!-- ) fp-->
|
|
|
+<!-- ON o.id = fp.order_id-->
|
|
|
+<!-- LEFT JOIN (-->
|
|
|
+<!-- SELECT order_id, app_id-->
|
|
|
+<!-- FROM fs_store_payment_scrm-->
|
|
|
+<!-- WHERE STATUS = 1 AND app_id IS NOT NULL-->
|
|
|
+<!-- GROUP BY order_id-->
|
|
|
+<!-- ) fsp-->
|
|
|
+<!-- ON o.id = fsp.order_id-->
|
|
|
+<!-- LEFT JOIN fs_course_play_source_config fcpsc-->
|
|
|
+<!-- ON fsp.app_id = fcpsc.appid AND fcpsc.is_del = 0-->
|
|
|
+<!-- WHERE-->
|
|
|
+<!-- o.is_del = 0 and-->
|
|
|
+<!-- 1 = 1-->
|
|
|
+<!-- <if test="maps.orderCode != null and maps.orderCode != ''">-->
|
|
|
+<!-- AND o.order_code LIKE CONCAT('%', #{maps.orderCode}, '%')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.userId != null">-->
|
|
|
+<!-- AND o.user_id = #{maps.userId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.deliveryId != null and maps.deliveryId != ''">-->
|
|
|
+<!-- AND o.delivery_id = #{maps.deliveryId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.nickname != null and maps.nickname != ''">-->
|
|
|
+<!-- AND u.nickname LIKE CONCAT('%', #{maps.nickname}, '%')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.realName != null and maps.realName != ''">-->
|
|
|
+<!-- AND o.real_name LIKE CONCAT('%', #{maps.realName}, '%')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.phone != null and maps.phone != ''">-->
|
|
|
+<!-- AND u.phone LIKE CONCAT('%', #{maps.phone}, '%')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.userPhone != null and maps.userPhone != ''">-->
|
|
|
+<!-- AND o.user_phone LIKE CONCAT('%', #{maps.userPhone}, '%')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.status == null">-->
|
|
|
+<!-- AND o.status = 1-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.status != null">-->
|
|
|
+<!-- AND o.status = #{maps.status}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.deliveryStatus != null">-->
|
|
|
+<!-- AND o.delivery_status = #{maps.deliveryStatus}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.deliveryPayStatus != null">-->
|
|
|
+<!-- AND o.delivery_pay_status = #{maps.deliveryPayStatus}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.companyId != null">-->
|
|
|
+<!-- AND o.company_id = #{maps.companyId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.isHealth != null and maps.isHealth != ''">-->
|
|
|
+<!-- AND o.company_id IS NULL-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.notHealth != null and maps.notHealth != ''">-->
|
|
|
+<!-- AND o.company_id IS NOT NULL-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.companyUserId != null">-->
|
|
|
+<!-- AND o.company_user_id = #{maps.companyUserId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.companyUserNickName != null and maps.companyUserNickName != ''">-->
|
|
|
+<!-- AND cu.nick_name LIKE CONCAT('%', #{maps.companyUserNickName}, '%')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.orderType != null">-->
|
|
|
+<!-- AND o.order_type = #{maps.orderType}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.payType != null">-->
|
|
|
+<!-- AND o.pay_type = #{maps.payType}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.createTimeList != null">-->
|
|
|
+<!-- AND o.create_time >= STR_TO_DATE(#{maps.createTimeList[0]}, '%Y%m%d')-->
|
|
|
+<!-- AND o.create_time < DATE_ADD(STR_TO_DATE(#{maps.createTimeList[1]}, '%Y%m%d'), INTERVAL 1 DAY)-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.payTimeList != null">-->
|
|
|
+<!-- AND o.pay_time >= STR_TO_DATE(#{maps.payTimeList[0]}, '%Y%m%d')-->
|
|
|
+<!-- AND o.pay_time < DATE_ADD(STR_TO_DATE(#{maps.payTimeList[1]}, '%Y%m%d'), INTERVAL 1 DAY)-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.deliverySendTimeList != null">-->
|
|
|
+<!-- AND o.delivery_send_time >= STR_TO_DATE(#{maps.deliverySendTimeList[0]}, '%Y%m%d')-->
|
|
|
+<!-- AND o.delivery_send_time < DATE_ADD(STR_TO_DATE(#{maps.deliverySendTimeList[1]}, '%Y%m%d'), INTERVAL 1 DAY)-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.deliveryImportTimeList != null">-->
|
|
|
+<!-- AND o.delivery_import_time >= STR_TO_DATE(#{maps.deliveryImportTimeList[0]}, '%Y%m%d')-->
|
|
|
+<!-- AND o.delivery_import_time < DATE_ADD(STR_TO_DATE(#{maps.deliveryImportTimeList[1]}, '%Y%m%d'), INTERVAL 1 DAY)-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.deptId != null">-->
|
|
|
+<!-- AND (o.dept_id = #{maps.deptId}-->
|
|
|
+<!-- OR o.dept_id IN (SELECT t.dept_id FROM company_dept t WHERE FIND_IN_SET(#{maps.deptId}, t.ancestors)))-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.isUpload != null and maps.isUpload == 0">-->
|
|
|
+<!-- AND o.certificates IS NULL-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.scheduleId != null">-->
|
|
|
+<!-- AND o.schedule_id = #{maps.scheduleId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.isUpload != null and maps.isUpload == 1">-->
|
|
|
+<!-- AND o.certificates IS NOT NULL-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="maps.appId != null and maps.appId != ''">-->
|
|
|
+<!-- AND u.app_id LIKE CONCAT('%', #{maps.appId}, '%')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- ${maps.params.dataScope}-->
|
|
|
+<!-- AND o.paid = 1-->
|
|
|
+<!-- GROUP BY o.id-->
|
|
|
+<!-- LIMIT 10000;-->
|
|
|
+<!-- </select>-->
|
|
|
<select id="selectUserPurchasedCount" resultType="java.lang.Integer">
|
|
|
SELECT IFNULL(SUM(oi.num), 0)
|
|
|
FROM fs_store_order_item_scrm oi
|
|
|
@@ -2111,7 +2121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="getDeliveryNote" resultType="com.fs.hisStore.vo.FsStoreOrderDeliveryNoteExportVO">
|
|
|
SELECT
|
|
|
- CONCAT('AC', o.id) AS orderNumber,
|
|
|
+ o.order_code AS orderNumber,
|
|
|
o.real_name AS recipient,
|
|
|
o.user_phone AS recipientPhone,
|
|
|
o.user_address AS recipientAddress,
|
|
|
@@ -2123,7 +2133,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
)
|
|
|
SEPARATOR '+'
|
|
|
) AS nameAndNumber,
|
|
|
- sps.keyword
|
|
|
+ sps.keyword,
|
|
|
+ fcpsc.name AS miniAppName
|
|
|
FROM
|
|
|
fs_store_order_scrm o
|
|
|
LEFT JOIN fs_store_order_item_scrm sois
|
|
|
@@ -2142,6 +2153,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
WHERE is_pay_remain != 0 AND STATUS != 0
|
|
|
) fp
|
|
|
ON o.id = fp.order_id
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT order_id, app_id
|
|
|
+ FROM fs_store_payment_scrm
|
|
|
+ WHERE STATUS = 1 AND app_id IS NOT NULL
|
|
|
+ GROUP BY order_id
|
|
|
+ ) fsp
|
|
|
+ ON o.id = fsp.order_id
|
|
|
+ LEFT JOIN fs_course_play_source_config fcpsc
|
|
|
+ ON fsp.app_id = fcpsc.appid AND fcpsc.is_del = 0
|
|
|
WHERE
|
|
|
o.is_del = 0 and
|
|
|
1 = 1
|
|
|
@@ -2229,7 +2249,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND o.certificates IS NOT NULL
|
|
|
</if>
|
|
|
<if test="maps.appId != null and maps.appId != ''">
|
|
|
- AND u.app_id LIKE CONCAT('%', #{maps.appId}, '%')
|
|
|
+ AND fsp.app_id = #{maps.appId}
|
|
|
</if>
|
|
|
${maps.params.dataScope}
|
|
|
AND o.paid = 1
|