--- /dev/null
+ * db 쿼리
+select
+ CONVERT(CHAR(19), a1.ps_date, 20) as ps_date, a2.ct_code, a2.ct_name, a1.ps_prname,
+ a1.ps_qty, a2.pe_bamt, a1.pe_id, a1.ps_no, isnull(a3.is_earn, 0) as is_earn
+from
+ ps a1
+ join pe a2
+ on a1.pe_id= a2.pe_id and a2.ct_code != ''
+ left join disposable_earn_point_status a3
+ on a3.pe_id= a1.pe_id and a3.ps_no= a1.ps_no
+ join ac a4
+ on a4.pe_id= a1.pe_id and a4.ac_fncd2 not in ('01', '00')
+where
+ a1.ps_prcode in (
+ select pr_code from pr where kind_code= '1099'
+ )
+ and a1.ps_date between '2025-01-05' and '2025-10-11'
+order by
+ a1.pe_id desc;
+
+create table disposable_earn_point_status(
+ pe_id varchar,
+ ps_no varchar,
+ is_earn bit default 0,
+ udate datetime default getdate()
+);
+
+
+
+
+ * 방향성
+현금 낸만큼 - 포인트사용 빼고 적립
\ No newline at end of file