应付产品增加状态过滤

This commit is contained in:
liuminghui
2026-11-06 09:27:49 +08:00
parent 270b762443
commit b4da248815
3 changed files with 34 additions and 29 deletions
@@ -320,32 +320,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where product_id = #{rootId} or origin_id = #{rootId}
</select>
<!-- 取价只看有效期。生效/失效开关不参与,和历史页说明一致。 -->
<select id="selectEffectiveVersionId" resultType="long">
select v.product_id
from pay_product v
inner join pay_product_term t on t.product_id = v.product_id
where (v.channel_id is null or v.channel_id = '')
and (v.product_id = #{stableId} or v.origin_id = #{stableId})
and t.status = '0'
and (t.effective_start is null or t.effective_start &lt;= date(#{bizDate}))
and (t.effective_end is null or t.effective_end &gt;= date(#{bizDate}))
order by ifnull(v.version_no, 1) desc, v.product_id desc
limit 1
</select>
<select id="selectInactiveCovering" resultMap="PayProductResult">
select v.product_id, v.product_name, t.version_no
from pay_product v
inner join pay_product_term t on t.product_id = v.product_id
where (v.channel_id is null or v.channel_id = '')
and (v.product_id = #{stableId} or v.origin_id = #{stableId})
and ifnull(t.status, '1') &lt;&gt; '0'
and (t.effective_start is null or t.effective_start &lt;= date(#{bizDate}))
and (t.effective_end is null or t.effective_end &gt;= date(#{bizDate}))
order by ifnull(t.version_no, 1) desc, v.product_id desc
limit 1
</select>
<select id="selectLatestVersionId" resultType="long">
select v.product_id
from pay_product v