|
@@ -143,8 +143,8 @@
|
143
|
143
|
|
144
|
144
|
<select id="selectLoanJobDataInfo" resultType="com.oqpo.api.entity.loanmng.LoanMgntBaseInfoEntity">
|
145
|
145
|
select loan_mgnt_unq_no, store_id, loan_dvsn, fn_code_nm('LOAN_DVSN', loan_dvsn) AS loan_dvsn_nm
|
146
|
|
- , nvl(case when loan_dvsn = 'LD01' then (acct_bal + tmp_rcv_acct_total - use_amt_total)
|
147
|
|
- when loan_dvsn = 'LD02' then (CREDT_LIMIT_AMT + acct_bal + tmp_rcv_acct_total - use_amt_total)
|
|
146
|
+ , nvl(case when loan_dvsn = 'LD01' then (nvl(acct_bal,0) + nvl(tmp_rcv_acct_total,0) - nvl(use_amt_total,0))
|
|
147
|
+ when loan_dvsn = 'LD02' then (nvl(CREDT_LIMIT_AMT,0) + nvl(acct_bal,0) + nvl(tmp_rcv_acct_total,0) - nvl(use_amt_total,0))
|
148
|
148
|
else 0 end,0) as ord_use_amt
|
149
|
149
|
from loan_mgnt_base_info
|
150
|
150
|
where store_id = #{storeId}
|
|
@@ -153,21 +153,21 @@
|
153
|
153
|
|
154
|
154
|
<update id="updateloanPchReqUseAmt">
|
155
|
155
|
update loan_mgnt_base_info
|
156
|
|
- set use_amt_total = use_amt_total + #{ordPchReqAmt}
|
|
156
|
+ set use_amt_total = nvl(use_amt_total,0) + #{ordPchReqAmt}
|
157
|
157
|
where loan_mgnt_unq_no = #{loanMgntUnqNo}
|
158
|
158
|
and store_id = #{storeId}
|
159
|
159
|
</update>
|
160
|
160
|
|
161
|
161
|
<update id="updateloanMinusPchReqUseAmt">
|
162
|
162
|
update loan_mgnt_base_info
|
163
|
|
- set use_amt_total = use_amt_total - #{ordPchReqAmt}
|
|
163
|
+ set use_amt_total = nvl(use_amt_total,0) - #{ordPchReqAmt}
|
164
|
164
|
where loan_mgnt_unq_no = #{loanMgntUnqNo}
|
165
|
165
|
and store_id = #{storeId}
|
166
|
166
|
</update>
|
167
|
167
|
|
168
|
168
|
<update id="updateloanMinusInstProc">
|
169
|
169
|
update /* updateloanMinusInstProc */ loan_mgnt_base_info
|
170
|
|
- set use_amt_total = use_amt_total - #{useAmtTotal}
|
|
170
|
+ set use_amt_total = nvl(use_amt_total,0) - #{useAmtTotal}
|
171
|
171
|
where loan_mgnt_unq_no = #{loanMgntUnqNo}
|
172
|
172
|
and store_id = #{storeId}
|
173
|
173
|
</update>
|
|
@@ -177,7 +177,7 @@
|
177
|
177
|
/* updateListLoanMinusProc */
|
178
|
178
|
<foreach collection="gridUpdateData" item="item" separator=";">
|
179
|
179
|
update /* updateloanMinusInstProc */ loan_mgnt_base_info
|
180
|
|
- set use_amt_total = use_amt_total - #{item.useAmtTotal}
|
|
180
|
+ set use_amt_total = nvl(use_amt_total,0) - #{item.useAmtTotal}
|
181
|
181
|
, sys_chg_dttm = NOW()
|
182
|
182
|
, sys_chg_id = #{userId}
|
183
|
183
|
where loan_mgnt_unq_no = #{item.loanMgntUnqNo}
|
|
@@ -207,8 +207,8 @@
|
207
|
207
|
update loan_mgnt_base_info
|
208
|
208
|
set sys_chg_dttm = now()
|
209
|
209
|
,sys_chg_id = #{userId}
|
210
|
|
- ,use_amt_total = use_amt_total - #{sttlAmt}
|
211
|
|
- ,acct_bal = acct_bal - #{sttlAmt}
|
|
210
|
+ ,use_amt_total = nvl(use_amt_total,0) - #{sttlAmt}
|
|
211
|
+ ,acct_bal = nvl(acct_bal,0) - #{sttlAmt}
|
212
|
212
|
where loan_mgnt_unq_no = #{loanMgntUnqNo}
|
213
|
213
|
and store_id = #{storeId}
|
214
|
214
|
</update>
|