Browse Source

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

YunaiV 7 months ago
parent
commit
fe3f144cff

+ 2 - 0
yudao-module-erp/yudao-module-erp-biz/src/main/resources/mapper/statistics/ErpPurchaseStatisticsMapper.xml

@@ -10,6 +10,7 @@
                <if test="endTime != null">
                    AND in_time &lt; #{endTime}
                </if>
+               AND tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getRequiredTenantId()}
                AND deleted = 0) -
             (SELECT IFNULL(SUM(total_price), 0)
                 FROM erp_purchase_return
@@ -17,6 +18,7 @@
                 <if test="endTime != null">
                     AND return_time &lt; #{endTime}
                 </if>
+                AND tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getRequiredTenantId()}
                 AND deleted = 0)
     </select>
 

+ 2 - 0
yudao-module-erp/yudao-module-erp-biz/src/main/resources/mapper/statistics/ErpSaleStatisticsMapper.xml

@@ -10,6 +10,7 @@
                <if test="endTime != null">
                    AND out_time &lt; #{endTime}
                </if>
+               AND tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getRequiredTenantId()}
                AND deleted = 0) -
             (SELECT IFNULL(SUM(total_price), 0)
                 FROM erp_sale_return
@@ -17,6 +18,7 @@
                 <if test="endTime != null">
                     AND return_time &lt; #{endTime}
                 </if>
+                AND tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getRequiredTenantId()}
                 AND deleted = 0)
     </select>