123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <?xml version="1.0" encoding="UTF-8"?>
- <das-client>
- <Sqls>
- <Sql name='O_QueryOrderListView'><![CDATA[
- select @a from o_order_view where 1=1 @b
- ]]></Sql>
-
- <Sql name='RF_QueryZdtfcx'><![CDATA[
- select t.orderid,
- t.updatekey,
- date_format(t.begin,'%Y-%m-%d') operatetime,
- t.price,
- t.serviceid,
- t.cardno,
- t.channelid
- from o_order_view t,YY_WATER y where 1=1 and orderstate=4 and t.orderid=y.yyorderid
- and y.state='5' @a order by t.begin desc
- ]]></Sql>
- <Sql name='RF_QueryCountZdtfcx'><![CDATA[
- select count(*) from o_order_view t where 1=1 @a
- ]]></Sql>
- <Sql name='O_QueryOrderDetail'><![CDATA[
- select
- @a
- from (
- select
- b.OPERATORNAME as channel,a.orderno,a.businessorderid,b.cardno,a.transactions,
- b.price*0.01 as price,
- (select sum(q.transactions) from P_BILL q where q.businessorderid=a.businessorderid and q.ordertype=a.ordertype group by q.businessorderid,q.ordertype) as transSum,
- a.ordertype,
- case when a.ordertype=1 and c.paystate is not null then '1' when a.ordertype=2 and d.paystate is not null then '2' else '' end payFlag,
- case when a.ordertype=1 then c.paystate when a.ordertype=2 then d.paystate else '0' end state,
- date_format(a.transtime,'%Y-%m-%d %H:%i:%S') transTime,date_format(b.begin,'%Y-%m-%d %H:%i:%S') beginDate,a.orderstatus,
- c.paystate,d.paystate paystate1
- from P_BILL a
- left join O_ORDER b on a.businessorderid=b.orderid
- left join O_PAYORDER c on a.businessorderid=c.orderid
- left join O_CANCELORDER d on a.businessorderid=d.orderid
- where @b
- order by a.businessorderid,a.ordertype ) tt
- ]]></Sql>
- <Sql name='O_OrderDetailUpdateDealState'><![CDATA[
- update P_BILL set orderstatus = ? where businessorderid = ?
- ]]></Sql>
- <Sql name='O_QueryOrderByDate'><![CDATA[
- select @a from O_ORDER_DATE t where @b
- ]]></Sql>
- <Sql name='O_QueryOrderByDateTotal'><![CDATA[
- select @a from O_ORDER_DATE t where @b union select @c from O_ORDER_DATE t where @d
- ]]></Sql>
- <Sql name='O_OrderDetailUpdateCheckState'><![CDATA[
- update O_ORDER_DATE set checkstate = ? where day = ?
- ]]></Sql>
- <Sql name='O_HasOrderYesterdayCount'><![CDATA[
- select @a from O_ORDER_DATE where @b
- ]]></Sql>
- <Sql name='O_DeleteOrderYesterday'><![CDATA[
- delete from O_ORDER_DATE where day = ?
- ]]></Sql>
- <Sql name='O_InsertIntoOrderBySelect'><![CDATA[
- insert into O_ORDER_DATE
- select
- r.day,r.hispaynum,r.channelpaynuym,r.hiscancelpaynum,r.channelcancelpaynum,
- FORMAT(r.hispay, 2) hispay,
- FORMAT(r.channelpay, 2) channelpay,
- FORMAT(r.hiscancelpay, 2) hiscancelpay,
- FORMAT(r.channelcancelpay, 2) channelcancelpay,
- case when r.hispaynum=r.channelpaynuym and r.hiscancelpaynum=r.channelcancelpaynum and r.hispay=r.channelpay
- and r.hiscancelpay=r.channelcancelpay then 1 else 2 end syscheckstate, 0 checkstate ,hosid
- from
- ( select
- date_format(s.transtime,'%Y-%m-%d') as day,
- sum(hispstate) hispaynum,
- sum(channelpstate) channelpaynuym,
- sum(hiscstate) hiscancelpaynum,
- sum(channelcstate) channelcancelpaynum,
- sum(hisprice) hispay,
- sum(channelprice) channelpay,
- sum(hiscanprice) hiscancelpay,
- sum(channelcanprice) channelcancelpay,
- hosid
- from(
- select
- a.transtime,c.paystate,d.paystate d_paystate,a.ordertype,b.hosid,
- case when a.ordertype =1 and c.paystate=2 then 1 else 0 end as hispstate,
- case when a.ordertype =1 then 1 else 0 end as channelpstate,
- case when a.ordertype =2 and d.paystate=4 then 1 else 0 end as hiscstate,
- case when a.ordertype =2 then 1 else 0 end as channelcstate,
- case when a.ordertype =1 and c.paystate=2 then b.price*0.01 else 0 end as hisprice,
- case when a.ordertype =1 then a.transactions else 0 end as channelprice,
- case when a.ordertype =2 and d.paystate=4 then b.price*0.01 else 0 end as hiscanprice,
- case when a.ordertype =2 then a.transactions else 0 end as channelcanprice
- from (
- select
- businessorderid orderid,ordertype,sum(transactions) as transactions,max(transtime) as transtime
- from P_BILL group by businessorderid,ordertype
- ) a left join O_ORDER b on a.orderid=b.orderid
- left join O_PAYORDER c on a.orderid=c.orderid and c.paystate<>1
- left join O_CANCELORDER d on a.orderid=d.orderid and d.paystate<>3
- where 1=1 @b
-
- ) s group by date_format(s.transtime,'%Y-%m-%d')
- ) r
- ]]></Sql>
- <Sql name='O_CountOrderBySelect'><![CDATA[
- select @a from o_order_view t,P_BILL p where @b
- ]]></Sql>
- <Sql name='O_GetCompareBillFormsList'><![CDATA[
- select
- channel,orderno,orderid,cardno,transactions,price,
- case when transSum=price then '1' else '2' end as checkThrough,
- ordertype,payFlag,state,transTime,beginDate,
- case when orderstatus<>0 then orderstatus when orderstatus=0 and transSum<>price then 0 else 1 end as dealState
- from (
- select
- b.OPERATORNAME as channel,a.orderno,a.orderid,b.cardno,a.transactions,
- b.price*0.01 as price,
- (select sum(q.transactions) from P_BILL q where q.orderid=a.orderid and q.ordertype=a.ordertype group by q.orderid,q.ordertype) as transSum,
- a.ordertype,
- case when a.ordertype=1 and c.paystate is not null then '1' when a.ordertype=2 and d.paystate is not null then '2' else '' end payFlag,
- case when a.ordertype=1 then to_char(c.paystate) when a.ordertype=2 then to_char(d.paystate) else '0' end state,
- to_char(a.transtime,'yyyy-mm-dd hh:mm:ss') transTime,to_char(b.begin,'yyyy-mm-dd hh:mm:ss') beginDate,a.orderstatus,
- c.paystate,d.paystate
- from P_BILL a
- left join O_ORDER b on a.orderid=b.orderid
- left join O_PAYORDER c on a.orderid=c.orderid
- left join O_CANCELORDER d on a.orderid=d.orderid
- where 1=1 @p
- order by a.orderid,a.ordertype ) tt where 1=1 @d
- ]]></Sql>
- <Sql name='O_GetCompareBillFormsCount'><![CDATA[
- select count(1) from (
- select
- b.OPERATORNAME as channel,a.orderno,a.orderid,b.cardno,a.transactions,
- b.price*0.01 as price,
- (select sum(q.transactions) from p_bill q where q.orderid=a.orderid and q.ordertype=a.ordertype group by q.orderid,q.ordertype) as transSum,
- a.ordertype,
- case when a.ordertype=1 and c.paystate is not null then '1' when a.ordertype=2 and d.paystate is not null then '2' else '' end payFlag,
- case when a.ordertype=1 then to_char(c.paystate) when a.ordertype=2 then to_char(d.paystate) else '0' end state,
- to_char(a.transtime,'yyyy-mm-dd hh:mm:ss') transTime,to_char(b.begin,'yyyy-mm-dd hh:mm:ss') beginDate,a.orderstatus,
- c.paystate,d.paystate
- from P_BILL a
- left join O_ORDER b on a.orderid=b.orderid
- left join O_PAYORDER c on a.orderid=c.orderid
- left join O_CANCELORDER d on a.orderid=d.orderid
- where 1=1 @p
- ) tt where 1=1 @d
-
- ]]></Sql>
- </Sqls>
- </das-client>
|