25 lines
1.1 KiB
XML
25 lines
1.1 KiB
XML
|
<?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.yskj.linghe.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 < #{endTime}
|
||
|
</if>
|
||
|
AND tenant_id = ${@cn.yskj.linghe.framework.tenant.core.context.TenantContextHolder@getRequiredTenantId()}
|
||
|
AND deleted = 0) -
|
||
|
(SELECT IFNULL(SUM(total_price), 0)
|
||
|
FROM erp_purchase_return
|
||
|
WHERE return_time >= #{beginTime}
|
||
|
<if test="endTime != null">
|
||
|
AND return_time < #{endTime}
|
||
|
</if>
|
||
|
AND tenant_id = ${@cn.yskj.linghe.framework.tenant.core.context.TenantContextHolder@getRequiredTenantId()}
|
||
|
AND deleted = 0)
|
||
|
</select>
|
||
|
|
||
|
</mapper>
|