|
@@ -1234,7 +1234,7 @@
|
|
|
AND tenant_id = #{tenantId}
|
|
AND tenant_id = #{tenantId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="customerId != null and customerId != ''">
|
|
<if test="customerId != null and customerId != ''">
|
|
|
- AND tenant_id = #{customerId}
|
|
|
|
|
|
|
+ AND old_customer_id = #{customerId}
|
|
|
</if>
|
|
</if>
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
tenant_id
|
|
tenant_id
|
|
@@ -1348,8 +1348,12 @@
|
|
|
AND vo.`status` = 1
|
|
AND vo.`status` = 1
|
|
|
AND vo.check_status = 1
|
|
AND vo.check_status = 1
|
|
|
AND vo.old_customer_id IS NOT NULL
|
|
AND vo.old_customer_id IS NOT NULL
|
|
|
- AND vo.check_time BETWEEN #{startTime}
|
|
|
|
|
- AND #{endTime}
|
|
|
|
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
|
|
+ AND vo.check_time >= #{startTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
|
+ AND vo.check_time <= #{endTime}
|
|
|
|
|
+ </if>
|
|
|
<if test="tenantId != null and tenantId != ''">
|
|
<if test="tenantId != null and tenantId != ''">
|
|
|
AND vo.tenant_id = #{tenantId}
|
|
AND vo.tenant_id = #{tenantId}
|
|
|
</if>
|
|
</if>
|
|
@@ -1357,7 +1361,7 @@
|
|
|
AND vo.create_sys_user_id = #{createSysUserId}
|
|
AND vo.create_sys_user_id = #{createSysUserId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="customerId != null and customerId != ''">
|
|
<if test="customerId != null and customerId != ''">
|
|
|
- AND vo.tenant_id = #{customerId}
|
|
|
|
|
|
|
+ AND vo.old_customer_id = #{customerId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="businessName != null and businessName != ''">
|
|
<if test="businessName != null and businessName != ''">
|
|
|
AND (
|
|
AND (
|
|
@@ -1416,7 +1420,7 @@
|
|
|
AND tenant_id = #{tenantId}
|
|
AND tenant_id = #{tenantId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="customerId != null and customerId != ''">
|
|
<if test="customerId != null and customerId != ''">
|
|
|
- AND tenant_id = #{customerId}
|
|
|
|
|
|
|
+ AND old_customer_id = #{customerId}
|
|
|
</if>
|
|
</if>
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
tenant_id
|
|
tenant_id
|
|
@@ -1535,7 +1539,7 @@
|
|
|
AND tenant_id = #{tenantId}
|
|
AND tenant_id = #{tenantId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="customerId != null and customerId != ''">
|
|
<if test="customerId != null and customerId != ''">
|
|
|
- AND tenant_id = #{customerId}
|
|
|
|
|
|
|
+ AND old_customer_id = #{customerId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="createSysUserId != null and createSysUserId != ''">
|
|
<if test="createSysUserId != null and createSysUserId != ''">
|
|
|
AND create_sys_user_id = #{createSysUserId}
|
|
AND create_sys_user_id = #{createSysUserId}
|
|
@@ -1625,7 +1629,7 @@
|
|
|
AND too.tenant_id = #{tenantId}
|
|
AND too.tenant_id = #{tenantId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="customerId != null and customerId != ''">
|
|
<if test="customerId != null and customerId != ''">
|
|
|
- AND too.tenant_id = #{customerId}
|
|
|
|
|
|
|
+ AND too.old_customer_id = #{customerId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="businessName != null and businessName != ''">
|
|
<if test="businessName != null and businessName != ''">
|
|
|
AND (
|
|
AND (
|
|
@@ -1782,7 +1786,7 @@
|
|
|
AND ouu.business_name = #{businessName}
|
|
AND ouu.business_name = #{businessName}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="customerId != null and customerId != ''">
|
|
<if test="customerId != null and customerId != ''">
|
|
|
- AND oo.tenant_id = #{customerId}
|
|
|
|
|
|
|
+ AND oo.old_customer_id = #{customerId}
|
|
|
</if>
|
|
</if>
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
ouu.business_name UNION ALL
|
|
ouu.business_name UNION ALL
|
|
@@ -1883,7 +1887,7 @@
|
|
|
AND oo.create_sys_user_id = #{createSysUserId}
|
|
AND oo.create_sys_user_id = #{createSysUserId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="customerId != null and customerId != ''">
|
|
<if test="customerId != null and customerId != ''">
|
|
|
- AND oo.tenant_id = #{customerId}
|
|
|
|
|
|
|
+ AND oo.old_customer_id = #{customerId}
|
|
|
</if>
|
|
</if>
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
ouu.business_name UNION ALL
|
|
ouu.business_name UNION ALL
|
|
@@ -2183,7 +2187,7 @@
|
|
|
og.tenant_id,
|
|
og.tenant_id,
|
|
|
2 AS order_type,
|
|
2 AS order_type,
|
|
|
IFNULL( SUM( og.goods_received ), 0 ) money2,
|
|
IFNULL( SUM( og.goods_received ), 0 ) money2,
|
|
|
- COUNT( * ) order_num2
|
|
|
|
|
|
|
+ COUNT(DISTINCT o.order_sn) order_num2
|
|
|
<if test="tenantId != null and tenantId != ''">
|
|
<if test="tenantId != null and tenantId != ''">
|
|
|
,'' AS create_sys_user_id, '' as create_username
|
|
,'' AS create_sys_user_id, '' as create_username
|
|
|
</if>
|
|
</if>
|