рассчет флагов: flag_debt5000 & flag_90_12
This commit is contained in:
parent
543e492bf2
commit
405028d078
1 changed files with 3 additions and 2 deletions
|
|
@ -56,6 +56,7 @@
|
|||
<foreach item="fid" collection="fids" open="(" separator="," close=")">
|
||||
#{fid}
|
||||
</foreach>
|
||||
AND REPORTED_DT >= (CURRENT DATE - 12 MONTHS)
|
||||
)
|
||||
where rn=1
|
||||
group by FID
|
||||
|
|
@ -65,7 +66,7 @@
|
|||
<select id="findFlag90ByPastDueArrear" resultMap="PaymentsFlagResult">
|
||||
SELECT
|
||||
FID as fid,
|
||||
(case when (sum(case when (REPORTED_DT >= #{reportedDate} and DAYS_PAST_DUE > 90) then 1 else 0 end) = 0) then 0 else 1 end) as flag
|
||||
(case when (sum(case when (REPORTED_DT >= #{reportedDate} and DAYS_PAST_DUE >= 90) then 1 else 0 end) = 0) then 0 else 1 end) as flag
|
||||
FROM RU_PASTDUEARREAR
|
||||
WHERE FID IN
|
||||
<foreach item="fid" collection="fids" open="(" separator="," close=")">
|
||||
|
|
@ -78,7 +79,7 @@
|
|||
<select id="findFlag90ByRuPaymt" resultMap="PaymentsFlagResult">
|
||||
SELECT
|
||||
FID as fid,
|
||||
(case when (sum(case when (REPORTED_DT >= #{reportedDate} and DAYS_PAST_DUE > 90) then 1 else 0 end) = 0) then 0 else 1 end) as flag
|
||||
(case when (sum(case when (REPORTED_DT >= #{reportedDate} and DAYS_PAST_DUE >= 90) then 1 else 0 end) = 0) then 0 else 1 end) as flag
|
||||
FROM RU_PAYMT
|
||||
WHERE FID IN
|
||||
<foreach item="fid" collection="fids" open="(" separator="," close=")">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue