Blame view

yudao-module-erp/src/main/resources/mapper/statistics/ErpPurchaseStatisticsMapper.xml 1.4 KB
2bd9dcbf   YunaiV   reactor:移除 erp 的 ...
1
2
3
4
5
6
7
8
9
10
11
12
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  <mapper namespace="cn.iocoder.yudao.module.erp.dal.mysql.statistics.ErpPurchaseStatisticsMapper">
  
      <select id="getPurchasePrice" resultType="java.math.BigDecimal">
          SELECT
              (SELECT IFNULL(SUM(total_price), 0)
               FROM erp_purchase_in
               WHERE in_time >= #{beginTime}
                 <if test="endTime != null">
                     AND in_time &lt; #{endTime}
                 </if>
3b2a3dd0   芋道源码   fix: ERP统计查询在多租户关...
13
14
15
                 <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null">
                     AND tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId()}
                 </if>
2bd9dcbf   YunaiV   reactor:移除 erp 的 ...
16
17
18
19
20
21
22
                 AND deleted = 0) -
              (SELECT IFNULL(SUM(total_price), 0)
                  FROM erp_purchase_return
                  WHERE return_time >= #{beginTime}
                  <if test="endTime != null">
                      AND return_time &lt; #{endTime}
                  </if>
3b2a3dd0   芋道源码   fix: ERP统计查询在多租户关...
23
24
25
                  <if test="@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId() != null">
                      AND tenant_id = ${@cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder@getTenantId()}
                  </if>
2bd9dcbf   YunaiV   reactor:移除 erp 的 ...
26
27
28
29
                  AND deleted = 0)
      </select>
  
  </mapper>