binquan.qiu | 729f54d | 2020-09-27 11:25:56 +0800 | [diff] [blame] | 1 | create or replace view v_transdtl as |
| 2 | SELECT t.transdate,t.transtime,t.billno,'' AS tradeno,'' AS authno,t.custname,c.bankcardno,d.rulename, |
| 3 | t1.deptname,t.termid,s.shopname,'' AS searchno,t.amount,'' AS serviceamt,t.transtype, |
| 4 | t.status,'T+1' AS cleartype,'普通' AS servicetype,0 AS revertamt,t.revbillno, |
| 5 | substr((t.revbillno), 0, 9) AS revtransdate FROM ((((tb_transdtl t |
| 6 | JOIN tb_card c ON (((t.cardno) = (c.cardno)))) |
| 7 | JOIN tb_discount_rule d ON ((t.ruleid = d.ruleid))) |
| 8 | JOIN ( SELECT c_1.custid, |
| 9 | p.deptname |
| 10 | FROM (tb_customer c_1 |
| 11 | JOIN tb_dept p ON (((c_1.deptcode) = (p.deptcode))))) t1 ON (((t.custid) = (t1.custid)))) |
| 12 | JOIN tb_shopsettlement s ON (((t.shopid) = (s.shopid)))); |