123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591 |
- <?xml version="1.0" encoding="UTF-8"?>
- <das-client>
- <Sqls>
- <Sql name='RF_QueryWaterView'><![CDATA[
- select @a,
- sum(case when orderstate=1 then 1 else 0 end) as totle_num,
- sum(case when orderstate=1 and paystate=1 then price when ordertype=0 and orderstate=0 then -price else 0 end) as totle_price,
- sum(case when registerstate=0 and orderstate=1 then 1 else 0 end) as fail_num,
- sum(case when ordertype=0 and orderstate=1 then 1 else 0 end) as register_num,
- sum(case when ordertype=0 and orderstate=0 then 1 else 0 end) as cancle_num,
- sum(case when ordertype=1 and orderstate=1 then 1 else 0 end) as drug_num,
- sum(case when ordertype=2 and orderstate=1 then 1 else 0 end) as ndrug_num,
- sum(case when ordertype=0 and orderstate=1 and paystate=1 then price else 0 end) as register_price,
- sum(case when ordertype=0 and orderstate=0 and paystate=1 then price else 0 end) as cancle_price,
- sum(case when ordertype=1 and orderstate=1 and paystate=1 then price else 0 end) as drug_price,
- sum(case when ordertype=2 and orderstate=1 and paystate=1 then price else 0 end) as ndrug_price
- from RF_WATER where 1=1 @b
- ]]></Sql>
- <Sql name='RF_Query_Water_View_Count_Sql'><![CDATA[
- select count(*) from(
- select @a,
- sum(case when orderstate=1 then 1 when ordertype=0 and orderstate=0 then -1 else 0 end) as totle_num,
- sum(case when orderstate=1 and paystate=1 then price when ordertype=0 and orderstate=0 then -price else 0 end) as totle_price,
- sum(case when registerstate=0 and orderstate=1 then 1 else 0 end) as fail_num,
- sum(case when ordertype=0 and orderstate=1 then 1 else 0 end) as register_num,
- sum(case when ordertype=0 and orderstate=0 then 1 else 0 end) as cancle_num,
- sum(case when ordertype=1 and orderstate=1 then 1 else 0 end) as drug_num,
- sum(case when ordertype=2 and orderstate=1 then 1 else 0 end) as ndrug_num,
- sum(case when ordertype=0 and orderstate=1 and paystate=1 then price else 0 end) as register_price,
- sum(case when ordertype=0 and orderstate=0 then price else 0 end) as cancle_price,
- sum(case when ordertype=1 and orderstate=1 and paystate=1 then price else 0 end) as drug_price,
- sum(case when ordertype=2 and orderstate=1 and paystate=1 then price else 0 end) as ndrug_price
- from RF_WATER where 1=1 @b
- ) tab
- ]]></Sql>
- <Sql name='RF_Query_Water_View_Union_Sql'><![CDATA[
- select * from (
- select @a,
- sum(case when orderstate=1 then 1 when ordertype=0 and orderstate=0 then -1 else 0 end) as totle_num,
- sum(case when orderstate=1 and paystate=1 then price when ordertype=0 and orderstate=0 then -price else 0 end) as totle_price,
- sum(case when registerstate=0 and orderstate=1 then 1 else 0 end) as fail_num,
- sum(case when ordertype=0 and orderstate=1 then 1 else 0 end) as register_num,
- sum(case when ordertype=0 and orderstate=0 then 1 else 0 end) as cancle_num,
- sum(case when ordertype=1 and orderstate=1 then 1 else 0 end) as drug_num,
- sum(case when ordertype=2 and orderstate=1 then 1 else 0 end) as ndrug_num,
- sum(case when ordertype=0 and orderstate=1 and paystate=1 then price else 0 end) as register_price,
- sum(case when ordertype=0 and orderstate=0 then price else 0 end) as cancle_price,
- sum(case when ordertype=1 and orderstate=1 and paystate=1 then price else 0 end) as drug_price,
- sum(case when ordertype=2 and orderstate=1 and paystate=1 then price else 0 end) as ndrug_price
- from RF_WATER where 1=1 @b ) tab1 union select @c,
- sum(totle_num) totle_num,sum(totle_price) totle_price,sum(fail_num) fail_num,sum(register_num) register_num,sum(cancle_num) cancle_num,sum(drug_num) drug_num,sum(ndrug_num) ndrug_num,sum(register_price) register_price,sum(cancle_price) cancle_price,sum(drug_price) drug_price,sum(ndrug_price) ndrug_price
- from (select @d,
- sum(case when orderstate=1 then 1 when ordertype=0 and orderstate=0 then -1 else 0 end) as totle_num,
- sum(case when orderstate=1 and paystate=1 then price when ordertype=0 and orderstate=0 then -price else 0 end) as totle_price,
- sum(case when registerstate=0 and orderstate=1 then 1 else 0 end) as fail_num,
- sum(case when ordertype=0 and orderstate=1 then 1 else 0 end) as register_num,
- sum(case when ordertype=0 and orderstate=0 then 1 else 0 end) as cancle_num,
- sum(case when ordertype=1 and orderstate=1 then 1 else 0 end) as drug_num,
- sum(case when ordertype=2 and orderstate=1 then 1 else 0 end) as ndrug_num,
- sum(case when ordertype=0 and orderstate=1 and paystate=1 then price else 0 end) as register_price,
- sum(case when ordertype=0 and orderstate=0 then price else 0 end) as cancle_price,
- sum(case when ordertype=1 and orderstate=1 and paystate=1 then price else 0 end) as drug_price,
- sum(case when ordertype=2 and orderstate=1 and paystate=1 then price else 0 end) as ndrug_price
- from RF_WATER where 1=1 @e ) tab2
- ]]></Sql>
- <!--2015-06-03 新的逻辑-->
- <Sql name='RF_Query_Water_View_Count_Sql_Standard'><![CDATA[
- select count(*) from(
- select @a,
- sum(case when orderstate=1 and paystate=1 and (ordertype=0 or ordertype=1 or ordertype=2) then 1 else 0 end) as totle_num,
- sum(case when orderstate=1 and paystate=1 and (ordertype=0 or ordertype=1 or ordertype=2) then price else 0 end) as totle_price,
- sum(case when registerstate=0 and orderstate=1 and ordertype=0 and paystate=1 then 1 else 0 end) as fail_num,
- sum(case when ordertype=0 and orderstate=1 and paystate=1 then 1 else 0 end) as register_num,
- sum(case when ordertype=0 and orderstate=0 then 1 else 0 end) as cancle_num,
- sum(case when ordertype=1 and orderstate=1 and paystate=1 then 1 else 0 end) as drug_num,
- sum(case when ordertype=2 and orderstate=1 and paystate=1 then 1 else 0 end) as ndrug_num,
- sum(case when ordertype=0 and orderstate=1 and paystate=1 then price else 0 end) as register_price,
- sum(case when ordertype=0 and orderstate=0 then price else 0 end) as cancle_price,
- sum(case when ordertype=1 and orderstate=1 and paystate=1 then price else 0 end) as drug_price,
- sum(case when ordertype=2 and orderstate=1 and paystate=1 then price else 0 end) as ndrug_price
- from RF_WATER rw where 1=1 @b
- ) tab
- ]]></Sql>
- <!--2015-06-03 新的逻辑-->
- <Sql name='RF_Query_Water_View_Union_Sql_Standard'><![CDATA[
- select * from (
- select @a,
- sum(case when orderstate=1 and paystate=1 and (ordertype=0 or ordertype=1 or ordertype=2) then 1 else 0 end) as totle_num,
- sum(case when orderstate=1 and paystate=1 and (ordertype=0 or ordertype=1 or ordertype=2) then price else 0 end) as totle_price,
- sum(case when registerstate=0 and orderstate=1 and ordertype=0 and paystate=1 then 1 else 0 end) as fail_num,
- sum(case when ordertype=0 and orderstate=1 and paystate=1 then 1 else 0 end) as register_num,
- sum(case when ordertype=0 and orderstate=0 then 1 else 0 end) as cancle_num,
- sum(case when ordertype=1 and orderstate=1 and paystate=1 then 1 else 0 end) as drug_num,
- sum(case when ordertype=2 and orderstate=1 and paystate=1 then 1 else 0 end) as ndrug_num,
- sum(case when ordertype=0 and orderstate=1 and paystate=1 then price else 0 end) as register_price,
- sum(case when ordertype=0 and orderstate=0 then price else 0 end) as cancle_price,
- sum(case when ordertype=1 and orderstate=1 and paystate=1 then price else 0 end) as drug_price,
- sum(case when ordertype=2 and orderstate=1 and paystate=1 then price else 0 end) as ndrug_price
- from RF_WATER rw where 1=1 @b ) tab1 union select @c,
- sum(totle_num) totle_num,sum(totle_price) totle_price,sum(fail_num) fail_num,sum(register_num) register_num,sum(cancle_num) cancle_num,sum(drug_num) drug_num,sum(ndrug_num) ndrug_num,sum(register_price) register_price,sum(cancle_price) cancle_price,sum(drug_price) drug_price,sum(ndrug_price) ndrug_price
- from (select @d,
- sum(case when orderstate=1 and paystate=1 and (ordertype=0 or ordertype=1 or ordertype=2) then 1 else 0 end) as totle_num,
- sum(case when orderstate=1 and paystate=1 and (ordertype=0 or ordertype=1 or ordertype=2) then price else 0 end) as totle_price,
- sum(case when registerstate=0 and orderstate=1 and ordertype=0 and paystate=1 then 1 else 0 end) as fail_num,
- sum(case when ordertype=0 and orderstate=1 and paystate=1 then 1 else 0 end) as register_num,
- sum(case when ordertype=0 and orderstate=0 then 1 else 0 end) as cancle_num,
- sum(case when ordertype=1 and orderstate=1 and paystate=1 then 1 else 0 end) as drug_num,
- sum(case when ordertype=2 and orderstate=1 and paystate=1 then 1 else 0 end) as ndrug_num,
- sum(case when ordertype=0 and orderstate=1 and paystate=1 then price else 0 end) as register_price,
- sum(case when ordertype=0 and orderstate=0 then price else 0 end) as cancle_price,
- sum(case when ordertype=1 and orderstate=1 and paystate=1 then price else 0 end) as drug_price,
- sum(case when ordertype=2 and orderstate=1 and paystate=1 then price else 0 end) as ndrug_price
- from RF_WATER rw where 1=1 @e ) tab2
- ]]></Sql>
- <Sql name='RF_QueryDeptFromWater'><![CDATA[
- select distinct deptcode,deptname from RF_WATER
- ]]></Sql>
- <Sql name='RF_QueryOrderView'><![CDATA[
- select @a from o_order_view where 1=1 @b
- ]]></Sql>
- <!-- 查询就诊卡信息 -->
- <Sql name='CardPackageList'><![CDATA[
- select @a from C_CARDPACKAGE where @b
- ]]></Sql>
- <!-- 查询就诊卡信息2 -->
- <Sql name='View_TJ_REGISTER_JKZL'><![CDATA[
- SELECT deptname,
- deptcode,
- '' empl_code,
- '' empl_name,
- SUM(zgh) as zgh,
- SUM(xxgh) as xxgh,
- ((sum(tel) - SUM(telt)) + SUM(wx) + SUM(zfb) + SUM(jkzl)) xshj,
- (sum(tel) - SUM(telt)) as tel,
- SUM(sy) as sy,
- SUM(xxzf) as xxzf,
- sum(xszf) as xszf,
- SUM(zth) as zth,
- SUM(wx) as wx,
- SUM(zfb) as zfb,
- SUM(jkzl) as jkzl
- FROM (SELECT t2.deptname,
- t2.deptcode,
- days,
- zgh,
- xxgh,
- telt,
- tel,
- sy,
- xxzf,
- xszf,
- zth,
- 0 wx,
- 0 zfb,
- 0 jkzl
- FROM (SELECT dept_code AS deptcode,
- date_format(see_date, '%Y-%m-%d') days,
- zgh,
- xxgh,
- tel,
- telt,
- sy,
- xxzf,
- xszf,
- zth
- FROM (SELECT * from ychis.view_tj_register_jkzl@his)
- where 1 = 1 @Y
- ) t1
- LEFT JOIN b_dept t2
- ON t1.deptcode = t2.DEPTCODE
- UNION ALL
- SELECT t3.deptname,
- t3.deptcode,
- t2.days,
- 0 zgh,
- 0 xxgh,
- 0 tel,
- 0 telt,
- 0 sy,
- 0 xxzf,
- 0 xszf,
- 0 zth,
- con AS wx,
- 0 zfb,
- 0 jkzl
- FROM (SELECT days, deptcode, COUNT(*) AS con
- FROM (SELECT deptcode,
- date_format(registerdate, '%Y-%m-%d') days
- FROM rf_water
- WHERE channelid = '100123' @P1
- ) t1
- GROUP BY deptcode, days) t2
- LEFT JOIN b_dept t3
- ON t2.deptcode = t3.deptcode
- UNION ALL
-
- SELECT t3.deptname,
- t3.deptcode,
- t2.days,
- 0 zgh,
- 0 xxgh,
- 0 tel,
- 0 telt,
- 0 sy,
- 0 xxzf,
- 0 xszf,
- 0 zth,
- 0 wx,
- con AS zfb,
- 0 jkzl
- FROM (SELECT days, deptcode, COUNT(*) AS con
- FROM (SELECT deptcode,
- date_format(registerdate, '%Y-%m-%d') days
- FROM rf_water
- WHERE channelid = '100125' @P2
- ) t1
- GROUP BY deptcode, days) t2
- LEFT JOIN b_dept t3
- ON t2.deptcode = t3.deptcode
- UNION ALL
-
- SELECT t3.deptname,
- t3.deptcode,
- t2.days,
- 0 zgh,
- 0 xxgh,
- 0 tel,
- 0 telt,
- 0 sy,
- 0 xxzf,
- 0 xszf,
- 0 zth,
- 0 wx,
- 0 zfb,
- con AS jkzl
- FROM (SELECT days, deptcode, COUNT(*) AS con
- FROM (SELECT deptcode,
- date_format(registerdate, '%Y-%m-%d') days
- FROM rf_water
- WHERE channelid = '100127' @P3
- ) t1
- GROUP BY deptcode, days) t2
- LEFT JOIN b_dept t3
- ON t2.deptcode = t3.deptcode) ttt where @M
- GROUP BY deptname, deptcode
- order by deptname
- ]]></Sql>
- <Sql name='View_TJ_REGISTER_JKZL_MX'><![CDATA[
- SELECT dept_name ,
- deptcode ,
- empl_name,
- doctorcode,
- SUM(zgh) as zgh,
- SUM(xxgh)as xxgh,
- ((sum(tel)-SUM(telt))+SUM(wx)+SUM(zfb)+SUM(jkzl))xshj,
- (sum(tel)-SUM(telt))as tel,
- SUM(sy) as sy ,
- SUM(xxzf)as xxzf ,
- sum(xszf)as xszf,
- SUM(zth) as zth,
- SUM(wx) as wx,
- SUM(zfb) as zfb ,
- SUM(jkzl) as jkzl FROM (
- SELECT dept_name ,
- deptcode ,
- empl_name,
- doctorcode,
- days ,
- zgh ,
- xxgh ,
- telt ,
- tel,
- sy ,
- xxzf ,
- xszf,
- zth ,
- 0 wx ,
- 0 zfb ,
- 0 jkzl
- FROM ( SELECT dept_code AS deptcode ,
- enpl_code as doctorcode,
- CONVERT(CHAR(10), see_date, 120) AS days ,
- zgh ,
- xxgh ,
- tel,
- telt ,
- sy ,
- xxzf ,
- xszf,
- zth
- FROM OPENQUERY(YCHIS, 'SELECT * from ychis.view_tj_register_jkzl') where 1=1 @Y
- ) AS t1
- LEFT JOIN his_dept AS t2 ON t1.deptcode = t2.DEPT_CODE
- Left JOIN his_doctor as hd on t1.doctorcode =hd.empl_code
- UNION ALL
- SELECT dept_name ,
- deptcode ,
- empl_name,
- doctorcode,
- days ,
- 0 zgh ,
- 0 xxgh ,
- 0 tel,
- 0 telt ,
- 0 sy ,
- 0 xxzf ,
- 0 xszf,
- 0 zth ,
- con AS wx ,
- 0 zfb ,
- 0 jkzl
- FROM ( SELECT days ,
- deptcode ,
- doctorcode,
- COUNT(*) AS con
- FROM ( SELECT deptcode ,
- doctorcode,
- CONVERT(CHAR(10), insertdate, 120) AS days
- FROM dbo.Order_Info
- WHERE operator = '100123' @P
- ) AS t1
- GROUP BY deptcode ,doctorcode,
- days
- ) AS t2
- LEFT JOIN his_dept AS t3 ON t2.deptcode = t3.dept_code
- Left JOIN his_doctor as hd2 on t2.doctorcode =hd2.empl_code
- UNION ALL
- SELECT dept_name ,
- deptcode ,
- empl_name,
- doctorcode,
-
- days ,
- 0 zgh ,
- 0 xxgh ,
- 0 tel,
- 0 telt ,
- 0 sy ,
- 0 xxzf ,
- 0 xszf,
- 0 zth ,
- 0 wx ,
- con AS zfb ,
- 0 jkzl
- FROM ( SELECT days ,
- deptcode ,
- doctorcode,
- COUNT(*) AS con
- FROM ( SELECT deptcode ,
- doctorcode,
- CONVERT(CHAR(10), insertdate, 120) AS days
- FROM dbo.Order_Info
- WHERE operator = '100123' @P
- ) AS t1
- GROUP BY deptcode ,doctorcode,
- days
- ) AS t2
- LEFT JOIN his_dept AS t3 ON t2.deptcode = t3.dept_code
- Left JOIN his_doctor as hd3 on t2.doctorcode =hd3.empl_code
- UNION ALL
- SELECT dept_name ,
- deptcode ,
- empl_name,
- deptcode,
- days ,
- 0 zgh ,
- 0 xxgh ,
- 0 tel,
- 0 telt ,
- 0 sy ,
- 0 xxzf ,
- 0 xszf,
- 0 zth ,
- 0 wx ,
- 0 zfb ,
- con AS jkzl
- FROM ( SELECT days ,
- deptcode ,
- doctorcode,
- COUNT(*) AS con
- FROM ( SELECT deptcode ,
- doctorcode,
- CONVERT(CHAR(10), insertdate, 120) AS days
- FROM dbo.Order_Info
- WHERE operator = '100126' @P
- ) AS t1
- GROUP BY deptcode ,doctorcode,
- days
- ) AS t2
- LEFT JOIN his_dept AS t3 ON t2.deptcode = t3.dept_code
- Left JOIN his_doctor as hd4 on t2.doctorcode =hd4.empl_code
- ) ttt where @M
- GROUP BY dept_name,deptcode,empl_name,
- doctorcode
- order by dept_name,empl_name
- ]]></Sql>
- <!-- 费用统计报表sql -->
- <Sql name='RF_QueryFytjView'><![CDATA[
- select * from (
- select @a,
- sum(case when o.orderstate=1 then cast(o.price as decimal(10,2))/100 else 0 end) as totle_price,
- sum(case when o.serviceid='001' and o.serviceid='002' and o.serviceid='003' then 1 else 0 end) as yaop_num,
- sum(case when o.serviceid='004' then 1 else 0 end) as fyaop_num,
- sum(case when o.serviceid='0' and o.orderstate=2 then cast(o.price as decimal(10,2))/100 else 0 end) as gh_price,
- sum(case when o.orderstate=6 then cast(o.price as decimal(10,2))/100 else 0 end) as th_price,
- sum(case when o.serviceid='001' and o.serviceid='002' and o.serviceid='003' then cast(o.price as decimal(10,2))/100 else 0 end) as yaop_price,
- sum(case when o.serviceid='004' then cast(o.price as decimal(10,2))/100 else 0 end) as fyaop_price
- from o_order_view o where 1=1 @b ) tab1
- union select @c,
- sum(totle_price) totle_price,
- sum(yaop_num) yaop_num,
- sum(fyaop_num) fyaop_num,
- sum(gh_price) gh_price,
- sum(th_price) th_price,
- sum(yaop_price) yaop_price,sum(fyaop_price) fyaop_price
- from (select @d,
- sum(case when o.orderstate=1 then cast(o.price as decimal(10,2))/100 else 0 end) as totle_price,
- sum(case when o.serviceid='001' and o.serviceid='002' and o.serviceid='003' then 1 else 0 end) as yaop_num,
- sum(case when o.serviceid='004' then 1 else 0 end) as fyaop_num,
- sum(case when o.serviceid='0' and o.orderstate=2 then to_number(o.price)/100 else 0 end) as gh_price,
- sum(case when o.orderstate=6 then cast(o.price as decimal(10,2))/100 else 0 end) as th_price,
- sum(case when o.serviceid='001' and o.serviceid='002' and o.serviceid='003' then cast(o.price as decimal(10,2))/100 else 0 end) as yaop_price,
- sum(case when o.serviceid='004' then cast(o.price as decimal(10,2))/100 else 0 end) as fyaop_price
- from o_order_view o where 1=1 @e ) tab2
-
- ]]></Sql>
- <Sql name='RF_QueryCountFytjView'><![CDATA[
- select count(*) from (
- select @a,
- sum(case when o.orderstate=2 then cast(o.price as decimal(10,2)) else 0 end) as totle_price,
- sum(case when o.serviceid='001' and o.serviceid='002' and o.serviceid='003' then 1 else 0 end) as yaop_num,
- sum(case when o.serviceid='004' then 1 else 0 end) as fyaop_num,
- sum(case when o.serviceid='0'then cast(o.price as decimal(10,2)) else 0 end) as gh_price,
- sum(case when o.orderstate=4 then cast(o.price as decimal(10,2)) else 0 end) as th_price,
- sum(case when o.serviceid='001' and o.serviceid='002' and o.serviceid='003' then cast(o.price as decimal(10,2)) else 0 end) as yaop_price,
- sum(case when o.serviceid='004' then cast(o.price as decimal(10,2)) else 0 end) as fyaop_price
- from o_order_view o where 1=1 @b ) tab
- ]]></Sql>
-
- <Sql name='getDataCollectionSummary_Sql'><![CDATA[
- select datatype,sum(datavalue) as datavalue
- from RF_REPORT where 1=1
- @a
- group by datatype
- ]]></Sql>
- <Sql name='getDataCollectionGrid_Sql'><![CDATA[
- select date_format(opertime,'%Y-%m-%d') as opertime,
- sum(if(datatype=1, datavalue,0)) as type1,
- sum(if(datatype=2, datavalue,0)) as type2,
- sum(if(datatype=3, datavalue,0)) as type3,
- sum(if(datatype=4, datavalue,0)) as type4,
- sum(if(datatype=5, datavalue,0)) as type5,
- sum(if(datatype=6, datavalue,0)) as type6
- from RF_REPORT where 1=1
- and date_format(opertime,'%Y-%m-%d') between ? and ?
- group by date_format(opertime,'%Y-%m-%d')
- order by opertime desc
- ]]></Sql>
- <Sql name='getDataCollectionGridCount_Sql'><![CDATA[
- select date_format(opertime,'%Y-%m-%d') as opertime,
- sum(if(datatype=1, datavalue,0)) as type1,
- sum(if(datatype=2, datavalue,0)) as type2,
- sum(if(datatype=3, datavalue,0)) as type3,
- sum(if(datatype=4, datavalue,0)) as type4,
- sum(if(datatype=5, datavalue,0)) as type5,
- sum(if(datatype=6, datavalue,0)) as type6
- from RF_REPORT where 1=1
- and date_format(opertime,'%Y-%m-%d') between ? and ?
- group by date_format(opertime,'%Y-%m-%d')
- ]]></Sql>
- <Sql name='getDataCollectionLine_Sql'><![CDATA[
- select date_format(opertime,'%Y-%m-%d') as opertime,
- sum(if(channelid='100123', datavalue,0)) as wx,
- sum(if(channelid='100125', datavalue,0)) as zfb,
- sum(if(channelid='100126', datavalue,0)) as bd
- from RF_REPORT where 1=1
- and date_format(opertime,'%Y-%m-%d') between ? and ?
- and datatype = ?
- group by date_format(opertime,'%Y-%m-%d')
- order by opertime
- ]]></Sql>
- <Sql name='getDataCollectionLineAll_Sql'><![CDATA[
- select date_format(opertime,'%Y-%m-%d') as opertime,
- sum(datavalue) as alldata
- from RF_REPORT where 1=1
- and date_format(opertime,'%Y-%m-%d') between ? and ?
- and datatype = ?
- group by date_format(opertime,'%Y-%m-%d')
- order by opertime
- ]]></Sql>
- <Sql name='getDataCollectionBar_Sql'><![CDATA[
- select channelid, sum(datavalue) as datavalue
- from RF_REPORT where 1=1
- and date_format(opertime,'%Y-%m-%d') between ? and ?
- and datatype=?
- group by channelid
- ]]></Sql>
- <Sql name='getDataCollection4_Sql'><![CDATA[
- select distinct cardno, operator,operatorname from o_order_view where orderstate=4
- ]]></Sql>
- <!-- 用户统计报表sql -->
- <Sql name='RF_QueryYhtjView'><![CDATA[
- select
- adddate,
- sum(xnksl) xnksl,
- sum(stksl) stksl,
- sum(wxsl) wxsl,
- sum(bdsl) bdsl,
- sum(zfbsl) zfbsl
- from (select @a adddate,
-
- (case
- when to_number(c.cardid) >= 7000001 and
- to_number(c.cardid) <= 7050000 then
- 1
- else
- 0
- end) xnksl,
- (case
- when to_number(c.cardid) < 7000001 or
- to_number(c.cardid) > 7050000 then
- 1
- else
- 0
- end) stksl,
- 0 wxsl,
- 0 bdsl,
- 0 zfbsl
- from c_cardpackage c where 1=1 @b
-
- union all
- select @a adddate,
- 0 xnksl,
- 0 stksl,
- count(*) wxsl,
- 0 bdsl,
- 0 zfbsl
- from c_cardpackage c, c_weixin w
- where c.memberid = w.memberid and to_char(c.adddate,'yyyy-mm-dd')=to_char(w.adddate,'yyyy-mm-dd') @b
- group by @a
-
- union all
- select @a adddate,
-
- 0 xnksl,
- 0 stksl,
- 0 wxsl,
- 0 bdsl,
- count(*) zfbsl
- from c_cardpackage c, c_zhifubao z
- where c.memberid = z.memberid and to_char(c.adddate,'yyyy-mm-dd')=to_char(z.adddate,'yyyy-mm-dd') @b
- group by @a
-
- union all
- select @a adddate,
-
- 0 xnksl,
- 0 stksl,
- 0 wxsl,
- count(*) bdsl,
- 0 zfbsl
- from c_cardpackage c, c_baidu b
- where c.memberid = b.memberid and to_char(c.adddate,'yyyy-mm-dd')=to_char(b.adddate,'yyyy-mm-dd') @b
- group by @a
- )
- where 1=1 group by adddate order by adddate desc
- ]]></Sql>
- <Sql name='RF_GetAutoRefundList'><![CDATA[
- select
- a.orderid,date_format(a.operdate,'%Y-%m-%d %H:%i:%S') as operdate,reason,b.cancelUpdateKey,b.price,b.serviceId,
- b.cardno,b.channelid,b.ctype,b.OrderState
- from o_autocancelorder a
- left join o_order_view b on a.orderid=b.orderid
- where 1=1 @p
- ]]></Sql>
- <Sql name='RF_GetAutoRefundCount'><![CDATA[
- select
- count(1)
- from o_autocancelorder a
- left join o_order_view b on a.orderid=b.orderid
- where 1=1 @p
- ]]></Sql>
-
- </Sqls>
- </das-client>
|