解决首页数据统计的bug
This commit is contained in:
@@ -860,62 +860,66 @@
|
|||||||
|
|
||||||
<select id="getBuyAndSaleBasicStatistics" resultType="java.math.BigDecimal">
|
<select id="getBuyAndSaleBasicStatistics" resultType="java.math.BigDecimal">
|
||||||
SELECT
|
SELECT
|
||||||
ifnull(sum(discount_last_money),0)
|
ifnull(sum(dh.discount_last_money),0)
|
||||||
FROM jsh_depot_head
|
FROM jsh_depot_head dh left join jsh_depot_item di on dh.id = di.header_id
|
||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
|
and di.id is not null
|
||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
and type=#{type}
|
and dh.type=#{type}
|
||||||
</if>
|
</if>
|
||||||
<if test="subType != null">
|
<if test="subType != null">
|
||||||
and sub_type=#{subType}
|
and dh.sub_type=#{subType}
|
||||||
</if>
|
</if>
|
||||||
<if test="hasSupplier == 1">
|
<if test="hasSupplier == 1">
|
||||||
and organ_id is not null
|
and dh.organ_id is not null
|
||||||
</if>
|
</if>
|
||||||
<if test="hasSupplier == 0">
|
<if test="hasSupplier == 0">
|
||||||
and organ_id is null
|
and dh.organ_id is null
|
||||||
</if>
|
</if>
|
||||||
<if test="beginTime != null">
|
<if test="beginTime != null">
|
||||||
and oper_time >= #{beginTime}
|
and dh.oper_time >= #{beginTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="endTime != null">
|
<if test="endTime != null">
|
||||||
and oper_time <= #{endTime}
|
and dh.oper_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="creatorArray != null">
|
<if test="creatorArray != null">
|
||||||
and creator in (
|
and dh.creator in (
|
||||||
<foreach collection="creatorArray" item="creator" separator=",">
|
<foreach collection="creatorArray" item="creator" separator=",">
|
||||||
#{creator}
|
#{creator}
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
and ifnull(delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
|
and ifnull(di.delete_flag,'0') !='1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getBuyAndSaleRetailStatistics" resultType="java.math.BigDecimal">
|
<select id="getBuyAndSaleRetailStatistics" resultType="java.math.BigDecimal">
|
||||||
SELECT
|
SELECT
|
||||||
ifnull(sum(total_price),0)
|
ifnull(sum(dh.total_price),0)
|
||||||
FROM jsh_depot_head
|
FROM jsh_depot_head dh left join jsh_depot_item di on dh.id = di.header_id
|
||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
|
and di.id is not null
|
||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
and type=#{type}
|
and dh.type=#{type}
|
||||||
</if>
|
</if>
|
||||||
<if test="subType != null">
|
<if test="subType != null">
|
||||||
and sub_type=#{subType}
|
and dh.sub_type=#{subType}
|
||||||
</if>
|
</if>
|
||||||
<if test="beginTime != null">
|
<if test="beginTime != null">
|
||||||
and oper_time >= #{beginTime}
|
and dh.oper_time >= #{beginTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="endTime != null">
|
<if test="endTime != null">
|
||||||
and oper_time <= #{endTime}
|
and dh.oper_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="creatorArray != null">
|
<if test="creatorArray != null">
|
||||||
and creator in (
|
and dh.creator in (
|
||||||
<foreach collection="creatorArray" item="creator" separator=",">
|
<foreach collection="creatorArray" item="creator" separator=",">
|
||||||
#{creator}
|
#{creator}
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
and ifnull(delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
|
and ifnull(di.delete_flag,'0') !='1'
|
||||||
</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">
|
||||||
|
|||||||
Reference in New Issue
Block a user