|
@@ -1194,6 +1194,26 @@
|
|
|
<if test="createSysUserId != null and createSysUserId != ''">
|
|
|
AND 1=0
|
|
|
</if>
|
|
|
+ <if test="businessName != null and businessName != ''">
|
|
|
+ AND (
|
|
|
+ SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ concat( `cet`.`education_name`, '-', `cb`.`business_name`, `cpt`.`project_name` ) AS `business_name`,
|
|
|
+ g.goods_id
|
|
|
+ FROM
|
|
|
+ `goods` `g`
|
|
|
+ LEFT JOIN `course_education_type` `cet` ON `g`.`education_type_id` = `cet`.`id`
|
|
|
+ LEFT JOIN `course_project_type` `cpt` ON `g`.`education_type_id` = `cpt`.`id`
|
|
|
+ LEFT JOIN `course_business` `cb` ON `g`.`business_id` = `cb`.`id`
|
|
|
+ ) oug
|
|
|
+ WHERE
|
|
|
+ oug.goods_id = og.goods_id
|
|
|
+ AND oug.business_name = #{businessName}
|
|
|
+ )>0
|
|
|
+ </if>
|
|
|
)) money
|
|
|
FROM
|
|
|
top_old_order vo
|
|
@@ -1213,6 +1233,23 @@
|
|
|
<if test="customerId != null and customerId != ''">
|
|
|
AND vo.tenant_id = #{customerId}
|
|
|
</if>
|
|
|
+ <if test="businessName != null and businessName != ''">
|
|
|
+ AND (
|
|
|
+ SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ `otg`.`order_sn` AS `order_sn`,
|
|
|
+ concat( substr( `otg`.`business_full_name`, 5, 4 ), '-', `otg`.`business_name` ) AS `business_name`
|
|
|
+ FROM
|
|
|
+ `top_old_order_goods` `otg`
|
|
|
+ ) ouu
|
|
|
+ WHERE
|
|
|
+ ouu.order_sn = vo.order_sn
|
|
|
+ AND ouu.business_name = #{businessName}
|
|
|
+ ) >0
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getTenantStatisticsOrderNum" parameterType="com.zhongzheng.modules.top.order.bo.TopOrderStatisticsBo"
|
|
@@ -1908,12 +1945,6 @@
|
|
|
FROM
|
|
|
`order` o
|
|
|
LEFT JOIN `order_goods` `og` ON o.order_sn = og.order_sn
|
|
|
- <if test="businessName != null and businessName != ''">
|
|
|
- LEFT JOIN `goods` `g` ON g.goods_id = og.goods_id
|
|
|
- LEFT JOIN `course_education_type` `cet` ON `g`.`education_type_id` = `cet`.`id`
|
|
|
- LEFT JOIN `course_project_type` `cpt` ON `g`.`education_type_id` = `cpt`.`id`
|
|
|
- LEFT JOIN `course_business` `cb` ON `g`.`business_id` = `cb`.`id`
|
|
|
- </if>
|
|
|
WHERE
|
|
|
o.`status` = 1
|
|
|
AND o.order_status = 1
|
|
@@ -1994,13 +2025,15 @@
|
|
|
(
|
|
|
SELECT
|
|
|
`otg`.`order_sn` AS `order_sn`,
|
|
|
- concat( substr( `otg`.`business_full_name`, 5, 4 ), '-', `otg`.`business_name` ) AS `business_name`
|
|
|
+ concat( substr( `otg`.`business_full_name`, 5, 4 ), '-', `otg`.`business_name` ) AS `business_name`,
|
|
|
+ otg.order_goods_id
|
|
|
FROM
|
|
|
`top_old_order_goods` `otg`
|
|
|
) ou
|
|
|
GROUP BY
|
|
|
ou.order_sn,
|
|
|
- ou.business_name
|
|
|
+ ou.business_name,
|
|
|
+ ou.order_goods_id
|
|
|
) ouu
|
|
|
LEFT JOIN top_old_order oo ON ouu.order_sn = oo.order_sn
|
|
|
WHERE
|