解决首页重复统计数据的bug
This commit is contained in:
@@ -859,10 +859,12 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getBuyAndSaleBasicStatistics" resultType="java.math.BigDecimal">
|
<select id="getBuyAndSaleBasicStatistics" resultType="java.math.BigDecimal">
|
||||||
SELECT
|
select
|
||||||
ifnull(sum(dh.discount_last_money),0)
|
ifnull(sum(discount_last_money),0) from
|
||||||
FROM jsh_depot_head dh left join jsh_depot_item di on dh.id = di.header_id
|
(select distinct dh.id, dh.discount_last_money
|
||||||
WHERE 1=1
|
from jsh_depot_head dh
|
||||||
|
left join jsh_depot_item di on dh.id = di.header_id
|
||||||
|
where 1=1
|
||||||
and di.id is not null
|
and di.id is not null
|
||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
and dh.type=#{type}
|
and dh.type=#{type}
|
||||||
@@ -890,14 +892,16 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
and ifnull(dh.delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
and ifnull(di.delete_flag,'0') !='1'
|
and ifnull(di.delete_flag,'0') !='1') tb
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getBuyAndSaleRetailStatistics" resultType="java.math.BigDecimal">
|
<select id="getBuyAndSaleRetailStatistics" resultType="java.math.BigDecimal">
|
||||||
SELECT
|
select
|
||||||
ifnull(sum(dh.total_price),0)
|
ifnull(sum(total_price),0) from
|
||||||
FROM jsh_depot_head dh left join jsh_depot_item di on dh.id = di.header_id
|
(select distinct dh.id, dh.total_price
|
||||||
WHERE 1=1
|
from jsh_depot_head dh
|
||||||
|
left join jsh_depot_item di on dh.id = di.header_id
|
||||||
|
where 1=1
|
||||||
and di.id is not null
|
and di.id is not null
|
||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
and dh.type=#{type}
|
and dh.type=#{type}
|
||||||
@@ -919,7 +923,7 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
and ifnull(dh.delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
and ifnull(di.delete_flag,'0') !='1'
|
and ifnull(di.delete_flag,'0') !='1') tb
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="debtList" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
|
<select id="debtList" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
|
||||||
|
|||||||
@@ -455,7 +455,9 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="inOrOutPrice" resultType="java.math.BigDecimal">
|
<select id="inOrOutPrice" resultType="java.math.BigDecimal">
|
||||||
select ifnull(sum(discount_last_money),0) as allMoney from jsh_depot_head dh
|
select ifnull(sum(discount_last_money),0) as allMoney from
|
||||||
|
(select distinct dh.id, dh.discount_last_money
|
||||||
|
from jsh_depot_head dh
|
||||||
left join jsh_depot_item di on dh.id = di.header_id
|
left join jsh_depot_item di on dh.id = di.header_id
|
||||||
where 1=1
|
where 1=1
|
||||||
and di.id is not null
|
and di.id is not null
|
||||||
@@ -470,11 +472,13 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
and ifnull(dh.delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
and ifnull(di.delete_flag, '0') != '1'
|
and ifnull(di.delete_flag, '0') != '1') tb
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="inOrOutRetailPrice" resultType="java.math.BigDecimal">
|
<select id="inOrOutRetailPrice" resultType="java.math.BigDecimal">
|
||||||
select ifnull(sum(total_price),0) as allMoney from jsh_depot_head dh
|
select ifnull(sum(total_price),0) as allMoney from
|
||||||
|
(select distinct dh.id, dh.total_price
|
||||||
|
from jsh_depot_head dh
|
||||||
left join jsh_depot_item di on dh.id = di.header_id
|
left join jsh_depot_item di on dh.id = di.header_id
|
||||||
where 1=1
|
where 1=1
|
||||||
and di.id is not null
|
and di.id is not null
|
||||||
@@ -489,7 +493,7 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
and ifnull(dh.delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
and ifnull(di.delete_flag, '0') != '1'
|
and ifnull(di.delete_flag, '0') != '1') tb
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getStockCheckSumByDepotList" resultType="java.math.BigDecimal">
|
<select id="getStockCheckSumByDepotList" resultType="java.math.BigDecimal">
|
||||||
|
|||||||
Reference in New Issue
Block a user