优化单据的额查询列表的逻辑,提高查询速度(继续优化)

This commit is contained in:
季圣华
2022-11-23 23:34:43 +08:00
parent 95ead95c8f
commit 43111edc54
9 changed files with 195 additions and 66 deletions

View File

@@ -189,10 +189,23 @@
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getFinancialBillNoByBillIdList" resultType="com.jsh.erp.datasource.entities.AccountItem">
select ai.bill_id 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 1=1
<if test="idList.size()>0">
and ai.bill_id in
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
and ifnull(ah.delete_flag,'0') !='1'
</select>
<select id="getFinancialBillNoByBillId" resultType="com.jsh.erp.datasource.entities.AccountHead">
select ah.bill_no 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 bill_id=#{billId}
where ai.bill_id=#{billId}
and ifnull(ah.delete_flag,'0') !='1'
</select>
</mapper>