优化收款单

This commit is contained in:
季圣华
2021-06-30 00:53:56 +08:00
parent dc2ba7237c
commit 4e66aeb98b
23 changed files with 693 additions and 37 deletions

View File

@@ -448,4 +448,57 @@
</if>
and ifnull(delete_flag,'0') !='1'
</select>
<select id="debtList" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
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') ='0'
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 &lt;= #{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) &lt; dh.discount_last_money
and ifnull(dh.delete_flag,'0') !='1'
order by dh.id desc
</select>
</mapper>