给收付款增加对供应商和客户期初收款的接口
This commit is contained in:
@@ -59,8 +59,13 @@
|
||||
and ah.remark like #{bindRemark}
|
||||
</if>
|
||||
<if test="number != null and number !=''">
|
||||
<bind name="bindNumber" value="'%'+number+'%'"/>
|
||||
and dh.number like #{bindNumber}
|
||||
<if test="number == 'QiChu'">
|
||||
and ai.bill_id is null
|
||||
</if>
|
||||
<if test="number != 'QiChu'">
|
||||
<bind name="bindNumber" value="'%'+number+'%'"/>
|
||||
and dh.number like #{bindNumber}
|
||||
</if>
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
order by ah.id desc
|
||||
@@ -117,8 +122,13 @@
|
||||
and ah.remark like #{bindRemark}
|
||||
</if>
|
||||
<if test="number != null and number !=''">
|
||||
<bind name="bindNumber" value="'%'+number+'%'"/>
|
||||
and dh.number like #{bindNumber}
|
||||
<if test="number == 'QiChu'">
|
||||
and ai.bill_id is null
|
||||
</if>
|
||||
<if test="number != 'QiChu'">
|
||||
<bind name="bindNumber" value="'%'+number+'%'"/>
|
||||
and dh.number like #{bindNumber}
|
||||
</if>
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1') tb
|
||||
</select>
|
||||
|
||||
@@ -124,4 +124,13 @@
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="getFinishDebtByOrganId" resultType="java.math.BigDecimal">
|
||||
select ifnull(sum(ai.each_amount),0) from jsh_account_head ah
|
||||
left join jsh_account_item ai on ah.id = ai.header_id and ifnull(ai.delete_flag,'0') !='1'
|
||||
where ah.organ_id = #{organId}
|
||||
and (ah.type = '收款' or ah.type = '付款')
|
||||
and ai.bill_id is null
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1002,6 +1002,63 @@
|
||||
< (dh.discount_last_money + dh.other_money - ifnull(dh.deposit,0))
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
order by dh.oper_time desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="debtListCount" resultType="java.lang.Integer">
|
||||
select count(1) from (
|
||||
select distinct dh.*, s.supplier OrganName, u.username userName
|
||||
from jsh_depot_head dh
|
||||
left join jsh_supplier s on dh.organ_id=s.id and ifnull(s.delete_Flag,'0') !='1'
|
||||
left join jsh_user u on dh.creator=u.id and ifnull(u.Status,'0') !='1'
|
||||
left join jsh_depot_item di on dh.id = di.header_id and ifnull(di.delete_flag,'0') !='1'
|
||||
left join jsh_material m on di.material_id = m.id and ifnull(m.delete_flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="organId != null">
|
||||
and dh.organ_id = #{organId}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and dh.type=#{type}
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and dh.sub_type=#{subType}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and dh.status =#{status}
|
||||
</if>
|
||||
<if test="number != null">
|
||||
<bind name="bindNumber" value="'%'+number+'%'"/>
|
||||
and dh.number like #{bindNumber}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and dh.oper_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= #{endTime}
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="depotArray != null and depotArray !=''">
|
||||
and di.depot_id in (
|
||||
<foreach collection="depotArray" item="depotId" separator=",">
|
||||
#{depotId}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="creatorArray != null">
|
||||
and dh.creator in (
|
||||
<foreach collection="creatorArray" item="creator" separator=",">
|
||||
#{creator}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
and (abs(dh.change_amount)+(select ifnull(sum(abs(ai.each_amount)),0) from jsh_account_item ai where ai.bill_id=dh.id and ifnull(ai.delete_flag,'0') !='1'))
|
||||
< (dh.discount_last_money + dh.other_money - ifnull(dh.deposit,0))
|
||||
and ifnull(dh.delete_flag,'0') !='1' ) tb
|
||||
</select>
|
||||
|
||||
<select id="getFinishDepositByNumberList" resultType="com.jsh.erp.datasource.vo.FinishDepositVo">
|
||||
|
||||
Reference in New Issue
Block a user