Commit fe3f144cff6e63aaa459f79f8370aa47a754641d

Authored by YunaiV
1 parent 26588981

【缺陷修复】ERP:数据统计时,租户在 MyBatis XML 不生效的问题

yudao-module-erp/yudao-module-erp-biz/src/main/resources/mapper/statistics/ErpPurchaseStatisticsMapper.xml
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 <if test="endTime != null"> 10 <if test="endTime != null">
11 AND in_time &lt; #{endTime} 11 AND in_time &lt; #{endTime}
12 </if> 12 </if>
  13 + AND tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getRequiredTenantId()}
13 AND deleted = 0) - 14 AND deleted = 0) -
14 (SELECT IFNULL(SUM(total_price), 0) 15 (SELECT IFNULL(SUM(total_price), 0)
15 FROM erp_purchase_return 16 FROM erp_purchase_return
@@ -17,6 +18,7 @@ @@ -17,6 +18,7 @@
17 <if test="endTime != null"> 18 <if test="endTime != null">
18 AND return_time &lt; #{endTime} 19 AND return_time &lt; #{endTime}
19 </if> 20 </if>
  21 + AND tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getRequiredTenantId()}
20 AND deleted = 0) 22 AND deleted = 0)
21 </select> 23 </select>
22 24
yudao-module-erp/yudao-module-erp-biz/src/main/resources/mapper/statistics/ErpSaleStatisticsMapper.xml
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 <if test="endTime != null"> 10 <if test="endTime != null">
11 AND out_time &lt; #{endTime} 11 AND out_time &lt; #{endTime}
12 </if> 12 </if>
  13 + AND tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getRequiredTenantId()}
13 AND deleted = 0) - 14 AND deleted = 0) -
14 (SELECT IFNULL(SUM(total_price), 0) 15 (SELECT IFNULL(SUM(total_price), 0)
15 FROM erp_sale_return 16 FROM erp_sale_return
@@ -17,6 +18,7 @@ @@ -17,6 +18,7 @@
17 <if test="endTime != null"> 18 <if test="endTime != null">
18 AND return_time &lt; #{endTime} 19 AND return_time &lt; #{endTime}
19 </if> 20 </if>
  21 + AND tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getRequiredTenantId()}
20 AND deleted = 0) 22 AND deleted = 0)
21 </select> 23 </select>
22 24