|
@@ -7,14 +7,19 @@
|
7
|
7
|
/* SttlStateMapper.selectSttlStateGridList */
|
8
|
8
|
SELECT A.sttl_mgnt_unq_no,
|
9
|
9
|
DATE_FORMAT(A.sttl_req_dt, '%Y.%m.%d') AS sttl_req_dt,
|
|
10
|
+ DATE_FORMAT(A.sttl_dt, '%Y.%m.%d') AS sttl_dt,
|
10
|
11
|
A.brand_id, FN_BRAND_NM(A.brand_id) AS brand_nm,
|
11
|
12
|
A.store_id, FN_STORE_NM(A.brand_id, A.store_id) AS store_nm,
|
12
|
13
|
A.spply_id, FN_SPPLY_NM(A.spply_id) AS spply_nm,
|
13
|
14
|
A.sttl_st_cd, FN_CODE_NM('STTL_ST_CD', A.sttl_st_cd) AS sttl_st_nm,
|
14
|
|
- A.sttl_req_amt,
|
15
|
|
- DATE_FORMAT(A.sttl_dt, '%Y.%m.%d') AS sttl_dt, A.sttl_amt, A.sttl_reg_mgr_nm, A.sttl_reg_mgr_id,
|
16
|
|
- A.sttl_req_amt - IFNULL(A.sttl_amt, 0) AS acct_bal
|
|
15
|
+ A.sttl_req_amt, /* 정산요청금액 */
|
|
16
|
+ A.sttl_amt, /* 정산확정금액 */
|
|
17
|
+ A.rcpt_amt, /* 수납금액 */
|
|
18
|
+ (A.sttl_amt - IFNULL(A.rcpt_amt, 0)) AS unpaid_amt, /* 미납금액 */
|
|
19
|
+ A.sttl_reg_mgr_nm, A.sttl_reg_mgr_id,
|
|
20
|
+ B.loan_dvsn, FN_CODE_NM('LOAN_DVSN', B.loan_dvsn) AS loan_dvsn_nm
|
17
|
21
|
FROM stl_mgnt_base_info A
|
|
22
|
+ INNER JOIN store_base_info B ON A.brand_id = B.brand_id AND A.store_id = B.store_id
|
18
|
23
|
WHERE A.brand_id = #{sBrandId}
|
19
|
24
|
AND A.sttl_req_dt BETWEEN #{fromDt} AND #{toDt}
|
20
|
25
|
AND A.sttl_st_cd IN ('ST10','ST20','ST30')
|
|
@@ -59,6 +64,7 @@
|
59
|
64
|
/* SttlStateMapper.selectSttlStateGridCnt */
|
60
|
65
|
SELECT COUNT(*)
|
61
|
66
|
FROM stl_mgnt_base_info A
|
|
67
|
+ INNER JOIN store_base_info B ON A.brand_id = B.brand_id AND A.store_id = B.store_id
|
62
|
68
|
WHERE A.brand_id = #{sBrandId}
|
63
|
69
|
AND A.sttl_req_dt BETWEEN #{fromDt} AND #{toDt}
|
64
|
70
|
AND A.sttl_st_cd IN ('ST10','ST20','ST30')
|