|
|
//{$DEFINE NXIANCHENG }
|
|
|
unit u_rp_no_seae_query;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, BusinessSkinForm, RxLookup, wwdbdatetimepicker, StdCtrls, Mask,comobj,
|
|
|
wwdbedit, Wwdotdot, Wwdbcomb, bsSkinCtrls, ComCtrls,inifiles, DB, ADODB,
|
|
|
wwdblook, bsSkinTabs, dxExEdtr, dxDBCtrl, dxDBGrid, dxTL, dxDBTLCl,
|
|
|
dxGrClms, dxCntner;
|
|
|
|
|
|
type
|
|
|
Tfrm_rp_no_seae_query = class(TForm)
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
bsSkinPageControl1: TbsSkinPageControl;
|
|
|
bsSkinTabSheet1: TbsSkinTabSheet;
|
|
|
bsSkinTabSheet2: TbsSkinTabSheet;
|
|
|
bsSkinGroupBox1: TbsSkinGroupBox;
|
|
|
Label10: TLabel;
|
|
|
Label5: TLabel;
|
|
|
Label8: TLabel;
|
|
|
Label11: TLabel;
|
|
|
Label9: TLabel;
|
|
|
Label22: TLabel;
|
|
|
Label23: TLabel;
|
|
|
Label14: TLabel;
|
|
|
Label16: TLabel;
|
|
|
Label15: TLabel;
|
|
|
Label1: TLabel;
|
|
|
Label32: TLabel;
|
|
|
Label39: TLabel;
|
|
|
Label40: TLabel;
|
|
|
Label6: TLabel;
|
|
|
Label7: TLabel;
|
|
|
Label12: TLabel;
|
|
|
Label17: TLabel;
|
|
|
Label125: TLabel;
|
|
|
Label30: TLabel;
|
|
|
Label19: TLabel;
|
|
|
Label20: TLabel;
|
|
|
Label21: TLabel;
|
|
|
Label47: TLabel;
|
|
|
Label24: TLabel;
|
|
|
Label124: TLabel;
|
|
|
Label26: TLabel;
|
|
|
Label28: TLabel;
|
|
|
Label29: TLabel;
|
|
|
Label44: TLabel;
|
|
|
Label31: TLabel;
|
|
|
wwDBComboBox18: TwwDBComboBox;
|
|
|
wwDBDateTimePicker1: TwwDBDateTimePicker;
|
|
|
wwDBComboBox6: TwwDBComboBox;
|
|
|
wwDBDateTimePicker2: TwwDBDateTimePicker;
|
|
|
wwDBComboBox19: TwwDBComboBox;
|
|
|
wwDBDateTimePicker3: TwwDBDateTimePicker;
|
|
|
wwDBComboBox11: TwwDBComboBox;
|
|
|
wwDBDateTimePicker4: TwwDBDateTimePicker;
|
|
|
wwDBComboBox21: TwwDBComboBox;
|
|
|
RxDBLookupCombo2: TRxDBLookupCombo;
|
|
|
wwDBComboBox28: TwwDBComboBox;
|
|
|
RxDBLookupCombo10: TRxDBLookupCombo;
|
|
|
RxDBLookupCombo12: TRxDBLookupCombo;
|
|
|
wwDBComboBox29: TwwDBComboBox;
|
|
|
wwDBComboBox14: TwwDBComboBox;
|
|
|
RxDBLookupCombo3: TRxDBLookupCombo;
|
|
|
wwDBComboBox25: TwwDBComboBox;
|
|
|
RxDBLookupCombo6: TRxDBLookupCombo;
|
|
|
wwDBComboBox24: TwwDBComboBox;
|
|
|
RxDBLookupCombo4: TRxDBLookupCombo;
|
|
|
wwDBComboBox3: TwwDBComboBox;
|
|
|
Edit1: TEdit;
|
|
|
wwDBComboBox38: TwwDBComboBox;
|
|
|
Edit9: TEdit;
|
|
|
wwDBComboBox43: TwwDBComboBox;
|
|
|
wwDBComboBox44: TwwDBComboBox;
|
|
|
wwDBComboBox45: TwwDBComboBox;
|
|
|
RxDBLookupCombo15: TRxDBLookupCombo;
|
|
|
wwDBComboBox15: TwwDBComboBox;
|
|
|
Edit2: TEdit;
|
|
|
Edit3: TEdit;
|
|
|
wwDBComboBox16: TwwDBComboBox;
|
|
|
wwDBComboBox7: TwwDBComboBox;
|
|
|
Edit4: TEdit;
|
|
|
Edit5: TEdit;
|
|
|
wwDBComboBox8: TwwDBComboBox;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
Label18: TLabel;
|
|
|
wwDBComboBox36: TwwDBComboBox;
|
|
|
wwDBLookupCombo49: TwwDBLookupCombo;
|
|
|
wwDBComboBox35: TwwDBComboBox;
|
|
|
Edit7: TEdit;
|
|
|
wwDBComboBox17: TwwDBComboBox;
|
|
|
wwDBComboBox9: TwwDBComboBox;
|
|
|
wwDBComboBox10: TwwDBComboBox;
|
|
|
wwDBComboBox12: TwwDBComboBox;
|
|
|
wwDBComboBox20: TwwDBComboBox;
|
|
|
wwDBComboBox22: TwwDBComboBox;
|
|
|
wwDBComboBox52: TwwDBComboBox;
|
|
|
wwDBComboBox23: TwwDBComboBox;
|
|
|
wwDBComboBox26: TwwDBComboBox;
|
|
|
RxDBLookupCombo7: TRxDBLookupCombo;
|
|
|
wwDBLookupCombo52: TwwDBLookupCombo;
|
|
|
wwDBComboBox27: TwwDBComboBox;
|
|
|
wwDBComboBox32: TwwDBComboBox;
|
|
|
RxDBLookupCombo8: TRxDBLookupCombo;
|
|
|
wwDBComboBox34: TwwDBComboBox;
|
|
|
wwDBComboBox37: TwwDBComboBox;
|
|
|
wwDBComboBox39: TwwDBComboBox;
|
|
|
RxDBLookupCombo11: TRxDBLookupCombo;
|
|
|
wwDBComboBox40: TwwDBComboBox;
|
|
|
RxDBLookupCombo13: TRxDBLookupCombo;
|
|
|
Edit8: TEdit;
|
|
|
wwDBComboBox46: TwwDBComboBox;
|
|
|
bsSkinGroupBox4: TbsSkinGroupBox;
|
|
|
Label13: TLabel;
|
|
|
Label25: TLabel;
|
|
|
Label37: TLabel;
|
|
|
Label38: TLabel;
|
|
|
Label43: TLabel;
|
|
|
Label46: TLabel;
|
|
|
Label3: TLabel;
|
|
|
Label4: TLabel;
|
|
|
Label27: TLabel;
|
|
|
wwDBComboBox13: TwwDBComboBox;
|
|
|
RxDBLookupCombo5: TRxDBLookupCombo;
|
|
|
wwDBComboBox30: TwwDBComboBox;
|
|
|
wwDBComboBox31: TwwDBComboBox;
|
|
|
RxDBLookupCombo1: TRxDBLookupCombo;
|
|
|
wwDBComboBox41: TwwDBComboBox;
|
|
|
wwDBComboBox42: TwwDBComboBox;
|
|
|
RxDBLookupCombo16: TRxDBLookupCombo;
|
|
|
wwDBComboBox48: TwwDBComboBox;
|
|
|
wwDBComboBox49: TwwDBComboBox;
|
|
|
wwDBComboBox53: TwwDBComboBox;
|
|
|
RxDBLookupCombo19: TRxDBLookupCombo;
|
|
|
wwDBComboBox4: TwwDBComboBox;
|
|
|
wwDBDateTimePicker5: TwwDBDateTimePicker;
|
|
|
wwDBComboBox5: TwwDBComboBox;
|
|
|
wwDBDateTimePicker6: TwwDBDateTimePicker;
|
|
|
wwDBComboBox33: TwwDBComboBox;
|
|
|
Edit6: TEdit;
|
|
|
bsSkinGroupBox2: TbsSkinGroupBox;
|
|
|
Label2: TLabel;
|
|
|
wwDBComboBox1: TwwDBComboBox;
|
|
|
wwDBComboBox2: TwwDBComboBox;
|
|
|
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
|
|
|
bsSkinGroupBox3: TbsSkinGroupBox;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
Label33: TLabel;
|
|
|
Label34: TLabel;
|
|
|
Label35: TLabel;
|
|
|
Label36: TLabel;
|
|
|
RxDBLookupCombo14: TRxDBLookupCombo;
|
|
|
wwDBComboBox47: TwwDBComboBox;
|
|
|
wwDBComboBox50: TwwDBComboBox;
|
|
|
query_bit: TwwDBComboBox;
|
|
|
query_str_int: TEdit;
|
|
|
query_date: TwwDBDateTimePicker;
|
|
|
RxDBLookupList1: TRxDBLookupList;
|
|
|
bsSkinGroupBox5: TbsSkinGroupBox;
|
|
|
bsSkinPanel4: TbsSkinPanel;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
dxDBGrid1Column1: TdxDBGridPickColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column3: TdxDBGridPickColumn;
|
|
|
dxDBGrid1Column4: TdxDBGridMaskColumn;
|
|
|
dxDBGrid2: TdxDBGrid;
|
|
|
dxDBGrid2SQ_ID: TdxDBGridMaskColumn;
|
|
|
t_sys_query: TADOQuery;
|
|
|
t_sys_query_detail: TADOQuery;
|
|
|
t_sys_queryfields: TADOQuery;
|
|
|
t_sys_query_detail1: TDataSource;
|
|
|
t_sys_query1: TDataSource;
|
|
|
t_sys_queryfields1: TDataSource;
|
|
|
Label41: TLabel;
|
|
|
wwDBComboBox51: TwwDBComboBox;
|
|
|
wwDBComboBox54: TwwDBComboBox;
|
|
|
bsSkinCheckRadioBox3: TbsSkinCheckRadioBox;
|
|
|
bsSkinCheckRadioBox4: TbsSkinCheckRadioBox;
|
|
|
bsSkinCheckRadioBox5: TbsSkinCheckRadioBox;
|
|
|
Label42: TLabel;
|
|
|
wwDBComboBox55: TwwDBComboBox;
|
|
|
wwDBLookupCombo3: TwwDBLookupCombo;
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
function get_no_str(table_str:string;date_query:string):widestring;
|
|
|
procedure do_10(str_bill:widestring);
|
|
|
procedure wwDBComboBox18KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure RxDBLookupCombo14Change(Sender: TObject);
|
|
|
procedure t_sys_queryAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_sys_query_detailAfterScroll(DataSet: TDataSet);
|
|
|
procedure t_sys_query_detailBeforePost(DataSet: TDataSet);
|
|
|
private
|
|
|
|
|
|
procedure loadFindIni ;
|
|
|
procedure writeFindIni ;
|
|
|
procedure noDrShen;
|
|
|
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
rp_seae_query_str:string;
|
|
|
s_private:string;
|
|
|
|
|
|
procedure InitmemtableinvData;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
frm_rp_no_seae_query: Tfrm_rp_no_seae_query;
|
|
|
no_seae_query_bs:integer;
|
|
|
no_seae_query_limited:string;
|
|
|
no_seae_query_fee:integer;
|
|
|
no_seae_query_table:string;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses my_sys_function, u_rp_no_seae_accept, u_rp_no_total, u_rp_in_seae,
|
|
|
u_rp_no_seai, u_rp_in_seai, u_rp_no_aire, u_rp_no_airi, u_rp_in_aire,
|
|
|
u_rp_in_airi, u_rp_in_total, u_data_share, u_main;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.do_10(str_bill:widestring);
|
|
|
begin
|
|
|
|
|
|
frm_rp_in_total.p_bill.close;
|
|
|
frm_rp_in_total.p_bill.Parameters.ParamByName('SQLStr').value:=
|
|
|
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as <20>ѿ<EFBFBD>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as δ<><CEB4>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as Ӧ<><D3A6>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as <20>ѿ<EFBFBD>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then 0'
|
|
|
+' else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as δ<><CEB4>RMB,sum(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+' sum(t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20>ѿ<EFBFBD><D1BF>ϼ<EFBFBD>,'
|
|
|
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'RMB'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+' sum(t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20>ѿ<EFBFBD>δ<EFBFBD><CEB4>USD,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20>ѿ<EFBFBD>δ<EFBFBD><CEB4>RMB,'
|
|
|
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' as <20>ѿ<EFBFBD>δ<EFBFBD>պϼ<D5BA>,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB,'
|
|
|
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
|
|
|
|
|
|
+'v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_no.<2E>ܴ<EFBFBD>, v_op_no.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_no.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_no.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_no.ί<>б<EFBFBD><D0B1><EFBFBD>, '
|
|
|
+'v_op_no.ί<>е<EFBFBD>λ,v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD>Դ,v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
|
|
|
+'v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_no.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_no.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_no.<2E>ͷ<EFBFBD>Ա'
|
|
|
+' FROM t_ch_fee inner join v_op_no on v_op_no.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_no.<2E>ܴ<EFBFBD>, v_op_no.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_no.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_no.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_no.ί<>б<EFBFBD><D0B1><EFBFBD>, '
|
|
|
+'v_op_no.ί<>е<EFBFBD>λ, v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD>Դ,v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_no.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_no.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_no.<2E>ͷ<EFBFBD>Ա'
|
|
|
+' order by v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
frm_rp_in_total.p_bill.open;
|
|
|
|
|
|
frm_rp_in_total.p_total.close;
|
|
|
frm_rp_in_total.p_total.Parameters.ParamByName('SQLStr').value:=
|
|
|
'SELECT SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as <20>ѿ<EFBFBD>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as δ<><CEB4>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as Ӧ<><D3A6>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as <20>ѿ<EFBFBD>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then 0'
|
|
|
+' else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as δ<><CEB4>RMB,sum(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+' sum(t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20>ѿ<EFBFBD><D1BF>ϼ<EFBFBD>,'
|
|
|
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'RMB'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+' sum(t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20>ѿ<EFBFBD>δ<EFBFBD><CEB4>USD,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20>ѿ<EFBFBD>δ<EFBFBD><CEB4>RMB,'
|
|
|
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' as <20>ѿ<EFBFBD>δ<EFBFBD>պϼ<D5BA>,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB,'
|
|
|
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join v_op_no on v_op_no.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
+' GROUP BY v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' order by v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
frm_rp_in_total.p_total.open;
|
|
|
|
|
|
frm_rp_in_total.p_client.close;
|
|
|
frm_rp_in_total.p_client.Parameters.ParamByName('SQLStr').value:=
|
|
|
'SELECT t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as <20>ѿ<EFBFBD>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as δ<><CEB4>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as Ӧ<><D3A6>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as <20>ѿ<EFBFBD>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then 0'
|
|
|
+' else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as δ<><CEB4>RMB,sum(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+' sum(t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20>ѿ<EFBFBD><D1BF>ϼ<EFBFBD>,'
|
|
|
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'RMB'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+' sum(t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20>ѿ<EFBFBD>δ<EFBFBD><CEB4>USD,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20>ѿ<EFBFBD>δ<EFBFBD><CEB4>RMB,'
|
|
|
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' as <20>ѿ<EFBFBD>δ<EFBFBD>պϼ<D5BA>,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB,'
|
|
|
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join v_op_no on v_op_no.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' inner join t_crm_client on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' order by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
frm_rp_in_total.p_client.open;
|
|
|
|
|
|
frm_rp_in_total.p_sales.close;
|
|
|
frm_rp_in_total.p_sales.Parameters.ParamByName('SQLStr').value:=
|
|
|
'SELECT v_op_no.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as <20>ѿ<EFBFBD>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as δ<><CEB4>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as Ӧ<><D3A6>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as <20>ѿ<EFBFBD>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then 0'
|
|
|
+' else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as δ<><CEB4>RMB,sum(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+' sum(t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20>ѿ<EFBFBD><D1BF>ϼ<EFBFBD>,'
|
|
|
+' sum((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'RMB'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+' sum(t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20>ѿ<EFBFBD>δ<EFBFBD><CEB4>USD,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20>ѿ<EFBFBD>δ<EFBFBD><CEB4>RMB,'
|
|
|
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> then (t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' as <20>ѿ<EFBFBD>δ<EFBFBD>պϼ<D5BA>,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>USD,'
|
|
|
|
|
|
+' SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' else 0 end) as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>RMB,'
|
|
|
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end)'
|
|
|
+' else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> then (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) else 0 end) end)'
|
|
|
+' as <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join v_op_no on v_op_no.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' inner join t_crm_client on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
+' GROUP BY v_op_no.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' order by v_op_no.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_no.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
frm_rp_in_total.p_sales.open;
|
|
|
end;
|
|
|
|
|
|
function Tfrm_rp_no_seae_query.get_no_str(table_str:string;date_query:string):widestring;
|
|
|
var
|
|
|
str_bill:widestring;
|
|
|
mblno,hblno:string;
|
|
|
begin
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>',wwDBComboBox19.text,wwDBDateTimePicker3.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>',wwDBComboBox11.text,wwDBDateTimePicker4.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'<27>ͷ<EFBFBD>Ա',wwDBComboBox24.text,RxDBLookupCombo4.DisplayValue);
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox14.text,RxDBLookupCombo3.DisplayValue);
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD><EFBFBD>Ա',wwDBComboBox25.text,RxDBLookupCombo6.DisplayValue);
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>',wwDBComboBox28.text,RxDBLookupCombo10.DisplayValue);
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox29.text,RxDBLookupCombo12.DisplayValue);
|
|
|
str_bill:=query_tiaojian(2,str_bill,table_str+'<27>ܴ<EFBFBD>',wwDBComboBox3.text,Edit1.text);
|
|
|
str_bill:=query_tiaojian(2,str_bill,table_str+'<27>ܴ<EFBFBD>',wwDBComboBox38.text,Edit9.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox45.text,RxDBLookupCombo15.DisplayValue);
|
|
|
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'ҵ<><D2B5>״̬',wwDBComboBox17.text,wwDBComboBox9.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD><EFBFBD>״̬',wwDBComboBox10.text,wwDBComboBox12.text);
|
|
|
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox15.text,Edit2.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'ί<>б<EFBFBD><D0B1><EFBFBD>',wwDBComboBox7.text,Edit4.text);
|
|
|
|
|
|
if (table_str='t_op_aire.') or (table_str='t_op_airi.') then begin
|
|
|
mblno:='<27><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>';
|
|
|
hblno:='<27><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>';
|
|
|
end else if (table_str='t_op_Seae.') or (table_str='t_op_Seai.') or (table_str='t_op_airtruck.') then begin
|
|
|
mblno:='<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>';
|
|
|
hblno:='<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>';
|
|
|
end else if (table_str='t_op_railway.') then begin
|
|
|
mblno:='<27><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>';
|
|
|
hblno:='<27><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>';
|
|
|
end else begin
|
|
|
mblno:='<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>';
|
|
|
hblno:='<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>';
|
|
|
end;
|
|
|
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+mblno,wwDBComboBox16.text,Edit3.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+hblno,wwDBComboBox8.text,Edit5.text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////?
|
|
|
if no_seae_query_limited<>'no'then
|
|
|
begin
|
|
|
if trim(str_bill)='' then
|
|
|
begin
|
|
|
str_bill:='where '+open_data(no_seae_query_limited,table_str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',table_str+'<27><><EFBFBD><EFBFBD>Ա',table_str+'<27>ͷ<EFBFBD>Ա','no','no');
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str_bill:=str_bill+' and '+open_data(no_seae_query_limited,table_str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',table_str+'<27><><EFBFBD><EFBFBD>Ա',table_str+'<27>ͷ<EFBFBD>Ա','no','no');
|
|
|
end;
|
|
|
end;
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+date_query,wwDBComboBox18.text,wwDBDateTimePicker1.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+date_query,wwDBComboBox6.text,wwDBDateTimePicker2.text);
|
|
|
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'ί<>е<EFBFBD>λ',wwDBComboBox21.text,RxDBLookupCombo2.DisplayValues[1]);
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'<27>ջ<EFBFBD><D5BB><EFBFBD>',wwDBComboBox26.text,RxDBLookupCombo7.DisplayValues[1]);
|
|
|
|
|
|
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD><EFBFBD>',wwDBComboBox32.text,RxDBLookupCombo8.DisplayValues[1]);
|
|
|
|
|
|
|
|
|
str_bill:=query_tiaojian(1,str_bill,'t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox13.text,RxDBLookupCombo5.DisplayValues[1]);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'t_ch_fee.<2E>ұ<EFBFBD>',wwDBComboBox41.text,RxDBLookupCombo1.DisplayValues[0]);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox42.text,RxDBLookupCombo16.DisplayValues[1]);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'t_ch_fee.<2E><><EFBFBD><EFBFBD>',wwDBComboBox30.text,wwDBComboBox31.text);
|
|
|
str_bill:=query_tiaojian(3,str_bill,'t_ch_fee.<2E>Ƿ<EFBFBD><C7B7>渶',wwDBComboBox48.text,wwDBComboBox49.text);
|
|
|
|
|
|
str_bill:=query_tiaojian(2,str_bill,'t_ch_fee.<2E><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>',wwDBComboBox33.text,Edit6.text);
|
|
|
|
|
|
str_bill:=query_tiaojian(1,str_bill,'t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox53.text,RxDBLookupCombo19.DisplayValues[1]);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox4.text,wwDBDateTimePicker5.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox5.text,wwDBDateTimePicker6.text);
|
|
|
|
|
|
if wwDBComboBox2.Text<>'' then begin
|
|
|
if wwDBComboBox1.Text='<27><><EFBFBD><EFBFBD>' then begin
|
|
|
if str_bill='' then begin
|
|
|
str_bill:=' where t_crm_client.'+wwDBComboBox2.Text+'=1 '
|
|
|
end else begin
|
|
|
str_bill:=str_bill+' and t_crm_client.'+wwDBComboBox2.Text+'=1 '
|
|
|
end;
|
|
|
end else if wwDBComboBox1.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then begin
|
|
|
if str_bill='' then begin
|
|
|
str_bill:=' where (t_crm_client.'+wwDBComboBox2.Text+'<>1 or (t_crm_client.'+wwDBComboBox2.Text+' is null))';
|
|
|
end else begin
|
|
|
str_bill:=str_bill+' and (t_crm_client.'+wwDBComboBox2.Text+'<>1 or (t_crm_client.'+wwDBComboBox2.Text+' is null))';
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
case no_seae_query_fee of
|
|
|
1:
|
|
|
begin
|
|
|
if str_bill='' then
|
|
|
str_bill:='where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
else
|
|
|
str_bill:=str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
2:
|
|
|
begin
|
|
|
if str_bill='' then
|
|
|
str_bill:='where t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>0'
|
|
|
else
|
|
|
str_bill:=str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>0';
|
|
|
end;
|
|
|
4:
|
|
|
begin
|
|
|
if str_bill='' then
|
|
|
str_bill:='where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD>=''<27><>'' '
|
|
|
else
|
|
|
str_bill:=str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD>=''<27><>'' ';
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
result:=str_bill;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.bsSkinButton10Click(Sender: TObject);
|
|
|
begin
|
|
|
wwDBDateTimePicker1.Clear;
|
|
|
wwDBDateTimePicker2.Clear;
|
|
|
wwDBDateTimePicker3.Clear;
|
|
|
wwDBDateTimePicker4.Clear;
|
|
|
wwDBDateTimePicker5.clear;
|
|
|
wwDBDateTimePicker6.clear;
|
|
|
RxDBLookupCombo4.ClearValue;
|
|
|
RxDBLookupCombo3.ClearValue;
|
|
|
RxDBLookupCombo6.ClearValue;
|
|
|
RxDBLookupCombo2.ClearValue;
|
|
|
RxDBLookupCombo7.ClearValue;
|
|
|
RxDBLookupCombo10.ClearValue;
|
|
|
RxDBLookupCombo12.ClearValue;
|
|
|
RxDBLookupCombo15.ClearValue;
|
|
|
|
|
|
RxDBLookupCombo8.ClearValue;
|
|
|
RxDBLookupCombo11.ClearValue;
|
|
|
RxDBLookupCombo13.ClearValue;
|
|
|
|
|
|
|
|
|
RxDBLookupCombo5.ClearValue;
|
|
|
RxDBLookupCombo1.ClearValue;
|
|
|
RxDBLookupCombo16.ClearValue;
|
|
|
RxDBLookupCombo19.ClearValue;
|
|
|
Edit1.text:='';
|
|
|
Edit9.text:='';
|
|
|
wwDBComboBox44.text:='';
|
|
|
wwDBComboBox31.text:='';
|
|
|
wwDBComboBox2.text:='';
|
|
|
wwDBComboBox49.text:='';
|
|
|
wwDBComboBox9.text:='';
|
|
|
wwDBComboBox12.text:='';
|
|
|
wwDBComboBox20.text:='';
|
|
|
|
|
|
wwDBComboBox39.text:='';
|
|
|
wwDBComboBox40.text:='';
|
|
|
|
|
|
Edit2.text:='';
|
|
|
Edit3.text:='';
|
|
|
Edit4.text:='';
|
|
|
Edit5.text:='';
|
|
|
Edit6.text:='';
|
|
|
Edit8.text:='';
|
|
|
wwDBLookupCombo49.text:='';
|
|
|
Edit7.text:='';
|
|
|
wwDBComboBox53.text:='';
|
|
|
wwDBComboBox54.text:='';
|
|
|
|
|
|
wwDBLookupCombo52.text:='';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
loadFindIni;
|
|
|
|
|
|
frm_data_share.t_crm_client_all.requery;
|
|
|
frm_data_share.t_sys_employee.requery;
|
|
|
frm_data_share.t_sys_department.requery;
|
|
|
|
|
|
t_sys_queryfields.open;
|
|
|
|
|
|
t_sys_query.Parameters.ParamByName('<27><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>').Value:=rp_seae_query_str;
|
|
|
t_sys_query.Parameters.ParamByName('¼<><C2BC><EFBFBD><EFBFBD>').Value:=employee;
|
|
|
t_sys_query.open;
|
|
|
t_sys_query_detail.open;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.bsSkinButton1Click(Sender: TObject);
|
|
|
var
|
|
|
str_bill,str_seae,str_seai,str_aire,str_airi,str_airtruck,str_railway
|
|
|
,sqltext,sqlInv,constr
|
|
|
,tempstr,clientstr,tempstr2,str_feesum:widestring;
|
|
|
sl:tstrings;
|
|
|
DBQueryThread2,DBQueryThread3,DBQueryThread4,DBQueryThread5,DBQueryThread6,DBQueryThread7:TDBQueryThread;
|
|
|
DBQueryThread1:TDBADOQueryThread;
|
|
|
W: DWord;
|
|
|
H: THandle;
|
|
|
str_zr,str_seaezr:WideString;
|
|
|
|
|
|
begin
|
|
|
if bsSkinCheckRadioBox3.Checked then str_zr:='';
|
|
|
if bsSkinCheckRadioBox4.Checked then str_zr:=' and v_op_bscard_all.<2E>Ƿ<EFBFBD>ֱ<EFBFBD><D6B1>=''<27><>'' ' ;
|
|
|
if bsSkinCheckRadioBox5.Checked then str_zr:=' and v_op_bscard_all.<2E>Ƿ<EFBFBD>ֱ<EFBFBD><D6B1>=''<27><>'' ' ;
|
|
|
if bsSkinCheckRadioBox3.Checked then str_seaezr:='';
|
|
|
if bsSkinCheckRadioBox4.Checked then str_seaezr:=' and t_op_seae.<2E>Ƿ<EFBFBD>ֱ<EFBFBD><D6B1>=''<27><>'' ' ;
|
|
|
if bsSkinCheckRadioBox5.Checked then str_seaezr:=' and t_op_seae.<2E>Ƿ<EFBFBD>ֱ<EFBFBD><D6B1>=''<27><>'' ' ;
|
|
|
writeFindIni;
|
|
|
tempstr2:='';
|
|
|
|
|
|
s_private:='';
|
|
|
str_feesum:='';
|
|
|
|
|
|
str_feesum:=
|
|
|
'SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD'
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD'
|
|
|
+',SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+') as δ<><CEB4>USD'
|
|
|
//<2F><>RMB
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN ('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end)'
|
|
|
+'ELSE 0 '
|
|
|
+'END'
|
|
|
+') as Ӧ<><D3A6>RMB'
|
|
|
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN ('
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD> '
|
|
|
+' when '+''''+'RMB'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end'
|
|
|
+') ELSE 0 '
|
|
|
+'END'
|
|
|
+') as <20><><EFBFBD><EFBFBD>RMB'
|
|
|
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN ('
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'RMB'+''''
|
|
|
+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) '
|
|
|
+' ELSE 0 END'
|
|
|
+' ) as δ<><CEB4>RMB'
|
|
|
// <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN ('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' when '+''''+'USD'+''''+' then 0'
|
|
|
+' else t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' end)'
|
|
|
+'ELSE 0 '
|
|
|
+'END'
|
|
|
+') as Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN ('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' when '+''''+'USD'+''''+' then 0'
|
|
|
+' else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' end)'
|
|
|
+' ELSE 0 '
|
|
|
+'END'
|
|
|
+') as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN ('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' when '+''''+'USD'+''''+' then 0'
|
|
|
+' else t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' end)'
|
|
|
+' ELSE 0 END'
|
|
|
+' ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN ('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' when '+''''+'USD'+''''+' then 0'
|
|
|
+' else t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' end)'
|
|
|
+'ELSE 0 '
|
|
|
+'END'
|
|
|
+') as Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN ('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' when '+''''+'USD'+''''+' then 0'
|
|
|
+' else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' end)'
|
|
|
+' ELSE 0 '
|
|
|
+'END'
|
|
|
+') as <20>Ѹ<EFBFBD><D1B8><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN ('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' when '+''''+'USD'+''''+' then 0'
|
|
|
+' else t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' end)'
|
|
|
+' ELSE 0 END'
|
|
|
+' ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//<2F>պϼ<D5BA>
|
|
|
+',SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>'
|
|
|
+',SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>'
|
|
|
//<2F><> USD
|
|
|
+',SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD'
|
|
|
+',SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD'
|
|
|
+',SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD'
|
|
|
|
|
|
|
|
|
//<2F><>RMB
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN ('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end)'
|
|
|
+'ELSE 0 '
|
|
|
+'END'
|
|
|
+') as Ӧ<><D3A6>RMB'
|
|
|
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN ('
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD> '
|
|
|
+' when '+''''+'RMB'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end'
|
|
|
+') ELSE 0 '
|
|
|
+'END'
|
|
|
+') as <20>Ѹ<EFBFBD>RMB'
|
|
|
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN ('
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'RMB'+''''
|
|
|
+' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) '
|
|
|
+' ELSE 0 END'
|
|
|
+' ) as δ<><CEB4>RMB'
|
|
|
|
|
|
{
|
|
|
//<2F><> RMB
|
|
|
+',SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB'
|
|
|
+',SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB'
|
|
|
+',SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB'
|
|
|
}
|
|
|
//<2F><><EFBFBD>ϼ<EFBFBD>
|
|
|
|
|
|
+',SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>'
|
|
|
+',SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>'
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD> USD
|
|
|
+',SUM('
|
|
|
+' CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+') as <20><><EFBFBD><EFBFBD>USD'
|
|
|
//<2F><><EFBFBD><EFBFBD> RMB
|
|
|
+',SUM('
|
|
|
+'CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+' ) as <20><><EFBFBD><EFBFBD>RMB'
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD> <20>ϼ<EFBFBD>
|
|
|
|
|
|
+',SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>';
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (strtobool(get_parameters_value(64,'false'))=true)
|
|
|
and (if_open('206')=false and if_open('207')=false and if_open('208')=false and if_open('209')=false and if_open('351')=false )
|
|
|
then
|
|
|
begin
|
|
|
s_private:=' and t_ch_fee.<2E><><EFBFBD><EFBFBD><>1 ';
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if no_seae_query_bs=5 then
|
|
|
begin
|
|
|
|
|
|
if bsSkinTabSheet2.Showing then
|
|
|
begin
|
|
|
str_seae:=frm_rp_no_seae_query.get_no_str('t_op_seae.','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
str_seai:=frm_rp_no_seae_query.get_no_str('t_op_seai.','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
str_aire:=frm_rp_no_seae_query.get_no_str('t_op_aire.','һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
str_airi:=frm_rp_no_seae_query.get_no_str('t_op_airi.','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
str_airtruck:=frm_rp_no_seae_query.get_no_str('t_op_airtruck.','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
str_railway:=frm_rp_no_seae_query.get_no_str('t_op_railway.','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
str_bill:=frm_rp_no_seae_query.get_no_str('v_op_bscard_all.','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
|
|
|
if (wwDBComboBox22.text<>'') and (wwDBComboBox20.text<>'') then
|
|
|
begin
|
|
|
if wwDBComboBox22.text='<27><><EFBFBD><EFBFBD>' then
|
|
|
begin
|
|
|
if wwDBComboBox20.text='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>' then
|
|
|
begin
|
|
|
str_seai:=str_seai+' and 1=2 ';
|
|
|
str_aire:=str_aire+' and 1=2 ';
|
|
|
str_airi:=str_airi+' and 1=2 ';
|
|
|
str_airtruck:=str_airtruck+' and 1=2 ';
|
|
|
str_railway:=str_railway+' and 1=2 ';
|
|
|
end;
|
|
|
if wwDBComboBox20.text='<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>' then
|
|
|
begin
|
|
|
str_seae:=str_seae+' and 1=2 ';
|
|
|
str_aire:=str_aire+' and 1=2 ';
|
|
|
str_airi:=str_airi+' and 1=2 ';
|
|
|
str_airtruck:=str_airtruck+' and 1=2 ';
|
|
|
str_railway:=str_railway+' and 1=2 ';
|
|
|
end;
|
|
|
if wwDBComboBox20.text='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>' then begin
|
|
|
str_seai:=str_seai+' and 1=2 ';
|
|
|
str_seae:=str_seae+' and 1=2 ';
|
|
|
str_airi:=str_airi+' and 1=2 ';
|
|
|
str_airtruck:=str_airtruck+' and 1=2 ';
|
|
|
str_railway:=str_railway+' and 1=2 ';
|
|
|
end;
|
|
|
if wwDBComboBox20.text='<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>' then begin
|
|
|
str_seai:=str_seai+' and 1=2 ';
|
|
|
str_aire:=str_aire+' and 1=2 ';
|
|
|
str_seae:=str_seae+' and 1=2 ';
|
|
|
str_airtruck:=str_airtruck+' and 1=2 ';
|
|
|
str_railway:=str_railway+' and 1=2 ';
|
|
|
end;
|
|
|
if wwDBComboBox20.text='<27><><EFBFBD>ܳ<EFBFBD>' then begin
|
|
|
str_seai:=str_seai+' and 1=2 ';
|
|
|
str_aire:=str_aire+' and 1=2 ';
|
|
|
str_airi:=str_airi+' and 1=2 ';
|
|
|
str_seae:=str_seae+' and 1=2 ';
|
|
|
str_railway:=str_railway+' and 1=2 ';
|
|
|
end;
|
|
|
if wwDBComboBox20.text='<27><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>' then begin
|
|
|
str_seai:=str_seai+' and 1=2 ';
|
|
|
str_aire:=str_aire+' and 1=2 ';
|
|
|
str_airi:=str_airi+' and 1=2 ';
|
|
|
str_seae:=str_seae+' and 1=2 ';
|
|
|
str_airtruck:=str_airtruck+' and 1=2 ';
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if wwDBComboBox22.text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then begin
|
|
|
if wwDBComboBox20.text='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>' then begin
|
|
|
str_seae:=str_seae+' and 1=2 ';
|
|
|
end;
|
|
|
if wwDBComboBox20.text='<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>' then begin
|
|
|
str_seai:=str_seai+' and 1=2 ';
|
|
|
end;
|
|
|
if wwDBComboBox20.text='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>' then begin
|
|
|
str_aire:=str_aire+' and 1=2 ';
|
|
|
end;
|
|
|
if wwDBComboBox20.text='<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>' then begin
|
|
|
str_airi:=str_airi+' and 1=2 ';
|
|
|
end;
|
|
|
if wwDBComboBox20.text='<27><><EFBFBD>ܳ<EFBFBD>' then begin
|
|
|
str_airtruck:=str_airtruck+' and 1=2 ';
|
|
|
end;
|
|
|
|
|
|
if wwDBComboBox20.text='<27><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>' then begin
|
|
|
str_railway:=str_railway+' and 1=2 ';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if wwDBComboBox23.ItemIndex=1 then
|
|
|
begin
|
|
|
str_seai:=str_seai+' and 1=2 ';
|
|
|
str_aire:=str_aire+' and 1=2 ';
|
|
|
str_airi:=str_airi+' and 1=2 ';
|
|
|
str_airtruck:=str_airtruck+' and 1=2 ';
|
|
|
str_railway:=str_railway+' and 1=2 ';
|
|
|
end;
|
|
|
if bsSkinCheckRadioBox4.Checked then str_seae:=query_tiaojian(1,str_seae,'t_op_seae.<2E>Ƿ<EFBFBD>ֱ<EFBFBD><D6B1>','<27><><EFBFBD><EFBFBD>','<27><>');
|
|
|
if bsSkinCheckRadioBox5.Checked then str_seae:=query_tiaojian(1,str_seae,'t_op_seae.<2E>Ƿ<EFBFBD>ֱ<EFBFBD><D6B1>','<27><><EFBFBD><EFBFBD>','<27><>');
|
|
|
|
|
|
|
|
|
str_seae:=query_tiaojian(1,str_seae,'t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
str_seai:=query_tiaojian(1,str_seai,'t_op_seai.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
|
|
|
str_seae:=query_tiaojian(1,str_seae,'t_op_seae.<2E><><EFBFBD><EFBFBD>',wwDBComboBox36.text,wwDBLookupCombo49.text);
|
|
|
str_seae:=query_tiaojian(1,str_seae,'t_op_seae.<2E><><EFBFBD><EFBFBD>',wwDBComboBox35.text,Edit7.text);
|
|
|
str_seae:=query_tiaojian(3,str_seae,'t_op_seae.<2E>Ƿ<EFBFBD><C7B7>˲<EFBFBD>',wwDBComboBox52.text,wwDBComboBox23.text);
|
|
|
|
|
|
|
|
|
str_seae:=query_tiaojian(1,str_seae,'t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ',wwDBComboBox39.text,RxDBLookupCombo11.DisplayValue);
|
|
|
str_seae:=query_tiaojian(1,str_seae,'t_op_seae.<2E><>Դ<EFBFBD><D4B4>ϸ',wwDBComboBox40.text,RxDBLookupCombo13.DisplayValue);
|
|
|
|
|
|
|
|
|
str_seae:=query_tiaojian(1,str_seae,'t_op_seae.<2E><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD>',wwDBComboBox46.text,Edit8.text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
str_seae:=query_tiaojian(3,str_seae,'t_op_seae.<2E><><EFBFBD>۸<EFBFBD><DBB8><EFBFBD>',wwDBComboBox34.text,wwDBComboBox37.text);
|
|
|
|
|
|
str_seai:=query_tiaojian(1,str_seai,'t_op_seai.<2E><><EFBFBD><EFBFBD>',wwDBComboBox36.text,wwDBLookupCombo49.text);
|
|
|
str_seai:=query_tiaojian(1,str_seai,'t_op_seai.<2E><><EFBFBD><EFBFBD>',wwDBComboBox35.text,Edit7.text);
|
|
|
|
|
|
str_seai:=query_tiaojian(1,str_seai,'t_op_seai.ҵ<><D2B5><EFBFBD><EFBFBD>Դ',wwDBComboBox39.text,RxDBLookupCombo11.DisplayValue);
|
|
|
|
|
|
str_seai:=query_tiaojian(1,str_seai,'t_op_seai.<2E><>Դ<EFBFBD><D4B4>ϸ',wwDBComboBox40.text,RxDBLookupCombo13.DisplayValue);
|
|
|
|
|
|
|
|
|
str_aire:=query_tiaojian(1,str_aire,'t_op_aire.һ<>̺<EFBFBD><CCBA><EFBFBD>',wwDBComboBox35.text,Edit7.text);
|
|
|
str_airi:=query_tiaojian(1,str_airi,'t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox35.text,Edit7.text);
|
|
|
|
|
|
|
|
|
str_aire:=query_tiaojian(1,str_aire,'t_op_aire.ҵ<><D2B5><EFBFBD><EFBFBD>Դ',wwDBComboBox39.text,RxDBLookupCombo11.DisplayValue);
|
|
|
str_aire:=query_tiaojian(1,str_aire,'t_op_aire.<2E><>Դ<EFBFBD><D4B4>ϸ',wwDBComboBox40.text,RxDBLookupCombo13.DisplayValue);
|
|
|
|
|
|
|
|
|
str_airi:=query_tiaojian(1,str_airi,'t_op_airi.ҵ<><D2B5><EFBFBD><EFBFBD>Դ',wwDBComboBox39.text,RxDBLookupCombo11.DisplayValue);
|
|
|
str_airi:=query_tiaojian(1,str_airi,'t_op_airi.<2E><>Դ<EFBFBD><D4B4>ϸ',wwDBComboBox40.text,RxDBLookupCombo13.DisplayValue);
|
|
|
|
|
|
str_airtruck:=query_tiaojian(1,str_airtruck,'t_op_airtruck.SA<53><41><EFBFBD><EFBFBD>',wwDBComboBox35.text,Edit7.text);
|
|
|
str_railway:=query_tiaojian(1,str_railway,'t_op_railway.<2E><><EFBFBD><EFBFBD>',wwDBComboBox35.text,Edit7.text);
|
|
|
str_railway:=query_tiaojian(1,str_railway,'t_op_railway.<2E>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox51.text,wwDBComboBox54.text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>',wwDBComboBox36.text,wwDBLookupCombo49.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>',wwDBComboBox35.text,Edit7.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox22.text,wwDBComboBox20.text);
|
|
|
str_bill:=query_tiaojian(3,str_bill,'v_op_bscard_all.<2E>Ƿ<EFBFBD><C7B7>˲<EFBFBD>',wwDBComboBox52.text,wwDBComboBox23.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard_all.<2E>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox51.text,wwDBComboBox54.text);
|
|
|
|
|
|
str_bill:=query_tiaojian(3,str_bill,'v_op_bscard_all.<2E><><EFBFBD>۸<EFBFBD><DBB8><EFBFBD>',wwDBComboBox34.text,wwDBComboBox37.text);
|
|
|
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>',wwDBComboBox27.text,wwDBLookupCombo52.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>',wwDBComboBox55.text,wwDBLookupCombo3.text);
|
|
|
|
|
|
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD>Դ',wwDBComboBox39.text,RxDBLookupCombo11.DisplayValue);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard_all.<2E><>Դ<EFBFBD><D4B4>ϸ',wwDBComboBox40.text,RxDBLookupCombo13.DisplayValue);
|
|
|
|
|
|
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard_all.<2E><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD>',wwDBComboBox46.text,Edit8.text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
str_aire:=query_tiaojian(1,str_aire,'t_op_aire.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
str_airi:=query_tiaojian(1,str_airi,'t_op_airi.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
str_airtruck:=query_tiaojian(1,str_airtruck,'t_op_airtruck.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
bsSkinPanel1.Visible:=true;
|
|
|
if no_seae_query_fee=4 then
|
|
|
begin
|
|
|
tempstr:=' and isnull(DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
str_seae:=str_seae+' and isnull(DATEDIFF([day],t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
str_seai:=str_seai+' and isnull(DATEDIFF([day],t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
str_aire:=str_aire+' and isnull(DATEDIFF([day],t_op_aire.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],t_op_aire.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_aire.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],t_op_aire.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
|
|
|
str_airi:=str_airi+' and isnull(DATEDIFF([day],t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
str_airtruck:=str_airtruck+' and isnull(DATEDIFF([day],t_op_airtruck.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],t_op_airtruck.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_airtruck.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],t_op_airtruck.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
clientstr:=' left join t_crm_client on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> ';
|
|
|
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
//tempstr:=' and 1=1 ';
|
|
|
end;
|
|
|
|
|
|
if no_seae_query_fee=5 then
|
|
|
begin
|
|
|
tempstr:=' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_gain where <20>ϼ<EFBFBD><CFBC>Ѹ<EFBFBD><>0 and ((<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>=0) or (<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6><><3E>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD>))) ';
|
|
|
str_seae:=str_seae+' and t_op_seae.<2E><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_gain where <20>ϼ<EFBFBD><CFBC>Ѹ<EFBFBD><>0 and ((<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>=0) or (<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6><><3E>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD>)))';
|
|
|
str_seai:=str_seai+' and t_op_seai.<2E><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_gain where <20>ϼ<EFBFBD><CFBC>Ѹ<EFBFBD><>0 and ((<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>=0) or (<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6><><3E>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD>)))';
|
|
|
str_aire:=str_aire+' and t_op_aire.<2E><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_gain where <20>ϼ<EFBFBD><CFBC>Ѹ<EFBFBD><>0 and ((<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>=0) or (<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6><><3E>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD>)))';
|
|
|
str_airi:=str_airi+' and t_op_airi.<2E><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_gain where <20>ϼ<EFBFBD><CFBC>Ѹ<EFBFBD><>0 and ((<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>=0) or (<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6><><3E>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD>)))';
|
|
|
str_airtruck:=str_airtruck+' and t_op_airtruck.<2E><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_gain where <20>ϼ<EFBFBD><CFBC>Ѹ<EFBFBD><>0 and ((<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>=0) or (<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6><><3E>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD>)))';
|
|
|
end;
|
|
|
|
|
|
if no_seae_query_fee=6 then
|
|
|
begin
|
|
|
tempstr:=' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_gain where <20>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD><>0 and ((<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>=0) or (<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6><><3E>ϼ<EFBFBD><CFBC>Ѹ<EFBFBD>))) ';
|
|
|
str_seae:=str_seae+' and t_op_seae.<2E><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_gain where <20>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD><>0 and ((<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>=0) or (<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6><><3E>ϼ<EFBFBD><CFBC>Ѹ<EFBFBD>)))';
|
|
|
str_seai:=str_seai+' and t_op_seai.<2E><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_gain where <20>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD><>0 and ((<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>=0) or (<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6><><3E>ϼ<EFBFBD><CFBC>Ѹ<EFBFBD>)))';
|
|
|
str_aire:=str_aire+' and t_op_aire.<2E><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_gain where <20>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD><>0 and ((<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>=0) or (<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6><><3E>ϼ<EFBFBD><CFBC>Ѹ<EFBFBD>)))';
|
|
|
str_airi:=str_airi+' and t_op_airi.<2E><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_gain where <20>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD><>0 and ((<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>=0) or (<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6><><3E>ϼ<EFBFBD><CFBC>Ѹ<EFBFBD>)))';
|
|
|
str_airtruck:=str_airtruck+' and t_op_airtruck.<2E><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_gain where <20>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD><>0 and ((<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>=0) or (<28>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6><><3E>ϼ<EFBFBD><CFBC>Ѹ<EFBFBD>)))';
|
|
|
end;
|
|
|
|
|
|
|
|
|
if wwDBComboBox2.Text<>'' then
|
|
|
begin
|
|
|
clientstr:=' left join t_crm_client on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> ';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
clientstr:=' ';
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
|
|
|
if query_wanneng_error(t_sys_query_detail)then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><F2A1AFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><CFA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
str_bill:=query_wanneng(t_sys_query_detail);
|
|
|
end;
|
|
|
|
|
|
if strtobool(get_parameters_value(191,'false')) then
|
|
|
tempstr2:=' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> and t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and t_crm_client_sales.<2E><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><=v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
else
|
|
|
tempstr2:=' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> and t_crm_client_sales.<2E><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><=v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ';
|
|
|
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_accept_bill.close;
|
|
|
frm_rp_no_total.p_accept_bill.Connection:=frm_main.db;
|
|
|
frm_rp_no_total.p_accept_bill1.DataSet:=frm_rp_no_total.p_accept_bill;
|
|
|
{$ELSE}
|
|
|
sqltext:=
|
|
|
{$ENDIF}
|
|
|
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+',SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end'
|
|
|
+') as Ӧ<><D3A6>USD,'
|
|
|
+'SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end'
|
|
|
+') as <20><><EFBFBD><EFBFBD>USD'
|
|
|
+',SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end'
|
|
|
+') as δ<><CEB4>USD'
|
|
|
|
|
|
+',SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then ROUND(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)'
|
|
|
+' else 0'
|
|
|
+' end'
|
|
|
+') as Ӧ<><D3A6>RMB'
|
|
|
+',SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then ROUND(t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)'
|
|
|
+' else 0'
|
|
|
+' end'
|
|
|
+') as <20><><EFBFBD><EFBFBD>RMB'
|
|
|
+',SUM('
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'RMB'+''''+' then '
|
|
|
+' ROUND((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)'
|
|
|
+' else 0'
|
|
|
+' end'
|
|
|
+') as δ<><CEB4>RMB'
|
|
|
//
|
|
|
+',SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' else ROUND(t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)'
|
|
|
+' end'
|
|
|
+') as Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+',SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' else ROUND(t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,2)'
|
|
|
+' end'
|
|
|
+') as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+',SUM('
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+'''' +' then 0'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' else ROUND((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),2)'
|
|
|
+' end'
|
|
|
+') as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
//
|
|
|
+',sum(ROUND(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)) as Ӧ<>պϼ<D5BA>,'
|
|
|
+' sum(ROUND(t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+' sum(ROUND((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)) as δ<>պϼ<D5BA>,'
|
|
|
+'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard_all.װ<>˷<EFBFBD>ʽ,'
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E>ջ<EFBFBD><D5BB><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5>״̬, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬, v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>, v_op_bscard_all.Ŀ<>ĵ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>1, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>2, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>3,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>4, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>5, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>6,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>7, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>8, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>9,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><>TEU, v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E>ͷ<EFBFBD>Ա, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><>վ,v_op_bscard_all.<2E>ᵥǩ<E1B5A5><C7A9>״̬, t_op_gain.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>'
|
|
|
+',v_op_bscard_all.<2E>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>յ<EFBFBD><D5B5><EFBFBD>,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD>Դ,'
|
|
|
|
|
|
+'DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()) AS ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'isnull(DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(Day,-Day(v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+1,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))))) else 0 end) end)'
|
|
|
+',DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
|
|
|
+'(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0) '
|
|
|
+' when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int)*30+isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0) '
|
|
|
+' else 0 '
|
|
|
+' end) as Э<><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
|
|
|
|
|
|
+'(case when round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 '
|
|
|
+'else v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
|
|
|
+'round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 else '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4) else '
|
|
|
+'1 end) as <20>ƷѶ<C6B7> '//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// +',icUsd.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>,icUsd.ʵ<>ʽ<EFBFBD><CABD><EFBFBD> usd<73><64>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>,icRMB.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>,icRMB.ʵ<>ʽ<EFBFBD><CABD><EFBFBD> RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join v_op_bscard_all on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> ' +str_zr
|
|
|
|
|
|
+tempstr2
|
|
|
|
|
|
+' left join t_op_gain on t_ch_fee.<2E><><EFBFBD><EFBFBD>=t_op_gain.<2E><><EFBFBD><EFBFBD> '
|
|
|
|
|
|
// +' LEFT OUTER JOIN t_ch_invoice icUsd ON (V_op_bscard_All.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> = icUsd.<2E>ᵥ<EFBFBD><E1B5A5> and icUsd.<2E>ᵥ<EFBFBD><E1B5A5><>'''' and not icUsd.<2E>ᵥ<EFBFBD><E1B5A5> is null and icUsd.<2E>ұ<EFBFBD>=''USD'' and icUsd.<2E>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=icUsd.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>)'
|
|
|
// +' LEFT OUTER JOIN t_ch_invoice icRMB ON (V_op_bscard_All.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> = icRMB.<2E>ᵥ<EFBFBD><E1B5A5> and icRMB.<2E>ᵥ<EFBFBD><E1B5A5><>'''' and not icRMB.<2E>ᵥ<EFBFBD><E1B5A5> is null and icRMB.<2E>ұ<EFBFBD>=''RMB'' and icRMB.<2E>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=icRMB.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>) '
|
|
|
|
|
|
|
|
|
+clientstr
|
|
|
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
|
|
|
+s_private
|
|
|
|
|
|
+tempstr
|
|
|
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard_all.װ<>˷<EFBFBD>ʽ,'
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E>ջ<EFBFBD><D5BB><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>, v_op_bscard_all.Ŀ<>ĵ<EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>1, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>2, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>3,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>4, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>5, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>6,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>7, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>8, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>9,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><>TEU, v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E>ͷ<EFBFBD>Ա, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><>վ,v_op_bscard_all.<2E>ᵥǩ<E1B5A5><C7A9>״̬,t_op_gain.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>'
|
|
|
+',v_op_bscard_all.<2E>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>յ<EFBFBD><D5B5><EFBFBD>,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD>Դ,'
|
|
|
+'DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()),'
|
|
|
+'isnull(DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, DATEADD(Day,-Day(v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+1,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) )))) else 0 end) end)'
|
|
|
+',DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())),'
|
|
|
|
|
|
+'(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0) '
|
|
|
+' when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int)*30+isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0) '
|
|
|
+' else 0'
|
|
|
+' end),'
|
|
|
|
|
|
|
|
|
+'(case when round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 '
|
|
|
+'else v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
|
|
|
+'round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 else '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4) else '
|
|
|
+'1 end)'
|
|
|
// +',icUsd.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>,icUsd.ʵ<>ʽ<EFBFBD><CABD><EFBFBD>,icRMB.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>,icRMB.ʵ<>ʽ<EFBFBD><CABD><EFBFBD>'
|
|
|
+default_sort_two(53,'v_op_bscard_all','t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>','','');
|
|
|
|
|
|
|
|
|
|
|
|
/// showmessage(sqltext);
|
|
|
|
|
|
|
|
|
// showmessage(sqltext);
|
|
|
if no_seae_query_fee<>4 then
|
|
|
begin
|
|
|
sqlInv:=
|
|
|
|
|
|
' SELECT DISTINCT t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, V_op_bscard_All.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,t_ch_invoice.<2E>ұ<EFBFBD>,'
|
|
|
+' CASE WHEN t_ch_invoice.<2E>ұ<EFBFBD> = ''USD'' THEN ʵ<>ʽ<EFBFBD><CABD><EFBFBD> ELSE 0 END AS USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>, '
|
|
|
+' CASE WHEN t_ch_invoice.<2E>ұ<EFBFBD> = ''RMB'' THEN ʵ<>ʽ<EFBFBD><CABD><EFBFBD> ELSE 0 END AS RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>, '
|
|
|
+' CASE WHEN t_ch_invoice.<2E>ұ<EFBFBD> = ''USD'' THEN <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE '''' END AS USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>, '
|
|
|
+' CASE WHEN t_ch_invoice.<2E>ұ<EFBFBD> = ''RMB'' THEN <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE '''' END AS RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+' FROM t_ch_fee '
|
|
|
+' INNER JOIN V_op_bscard_All ON V_op_bscard_All.<2E><><EFBFBD><EFBFBD> = t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' LEFT OUTER JOIN t_ch_invoice ON (V_op_bscard_All.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> = t_ch_invoice.<2E>ᵥ<EFBFBD><E1B5A5> and t_ch_invoice.<2E>ᵥ<EFBFBD><E1B5A5><>'''' and not t_ch_invoice.<2E>ᵥ<EFBFBD><E1B5A5> is null and t_ch_invoice.<2E>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_ch_invoice.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>)'
|
|
|
|
|
|
+clientstr
|
|
|
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
+tempstr;
|
|
|
frm_rp_no_total.ADOQueryINV.sql.TEXT:=sqlInv;
|
|
|
frm_rp_no_total.ADOQueryINV.Open;
|
|
|
|
|
|
|
|
|
// showmessage(frm_rp_no_total.ADOQueryINV.sql.TEXT);
|
|
|
InitmemtableinvData;
|
|
|
end;
|
|
|
|
|
|
//showmessage(sqltext);
|
|
|
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
{$ELSE}
|
|
|
constr:=connect_string('main.ini');
|
|
|
frm_rp_no_total.p_accept_bill.ConnectionString:=constr;
|
|
|
DBQueryThread1:=TDBADOQueryThread.Create(frm_rp_no_total.p_accept_bill,sqltext,frm_rp_no_total.p_accept_bill1);
|
|
|
|
|
|
// ShowMessage(sqltext);
|
|
|
{$ENDIF}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if no_seae_query_fee=4 then begin
|
|
|
tempstr:=' and isnull(DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
end else begin
|
|
|
// tempstr:=' and 1=1 ';
|
|
|
end;
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_accept_fee.close;
|
|
|
frm_rp_no_total.p_accept_fee.Connection:=frm_main.db;
|
|
|
frm_rp_no_total.p_accept_fee1.DataSet:=frm_rp_no_total.p_accept_fee;
|
|
|
frm_rp_no_total.p_accept_fee.Parameters.ParamByName('SQLStr').value:=
|
|
|
{$ELSE}
|
|
|
sqltext:=
|
|
|
{$ENDIF}
|
|
|
'SELECT t_ch_fee.ch_id,t_ch_fee.<2E><><EFBFBD><EFBFBD>,t_ch_fee.<2E><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_ch_fee.˰<><CBB0>,t_ch_fee.<2E><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>,t_ch_fee.˰<><CBB0>,t_ch_fee.<2E><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,t_ch_fee.<2E><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,t_ch_fee.<2E><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+','
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end'
|
|
|
+' as Ӧ<><D3A6>USD'
|
|
|
+','
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end'
|
|
|
+' as <20><><EFBFBD><EFBFBD>USD'
|
|
|
+','
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end'
|
|
|
+' as δ<><CEB4>USD'
|
|
|
+','
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end'
|
|
|
+' as Ӧ<><D3A6>RMB'
|
|
|
+','
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end'
|
|
|
+' as <20><><EFBFBD><EFBFBD>RMB'
|
|
|
+','
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end'
|
|
|
+' as δ<><CEB4>RMB'
|
|
|
|
|
|
+','
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+'''' +' then 0'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' else ROUND((t_ch_fee.<2E><><EFBFBD><EFBFBD>),2)'
|
|
|
+' end'
|
|
|
+' as Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
+','
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+'''' +' then 0'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' else ROUND((t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),2)'
|
|
|
+' end'
|
|
|
+' as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
+','
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+'''' +' then 0'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' else ROUND((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),2)'
|
|
|
+' end'
|
|
|
+' as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+',t_ch_fee.<2E><><EFBFBD><EFBFBD> as Ӧ<>ս<EFBFBD><D5BD><EFBFBD>,'
|
|
|
+'t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> as <20><><EFBFBD>ս<EFBFBD><D5BD><EFBFBD>,(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) as δ<>ս<EFBFBD><D5BD><EFBFBD>,'
|
|
|
+'t_ch_fee.<2E><> as <20><>,t_ch_fee.<2E><><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD>,t_ch_fee.<2E><><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD>,t_ch_fee.<2E><>ע as <20><><EFBFBD>ñ<EFBFBD>ע,'
|
|
|
+'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard_all.װ<>˷<EFBFBD>ʽ,'
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E>ջ<EFBFBD><D5BB><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>, v_op_bscard_all.Ŀ<>ĵ<EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>1, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>2, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>3,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>4, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>5, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>6,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>7, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>8, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>9,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><>TEU, v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E>ͷ<EFBFBD>Ա, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><>վ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>,'
|
|
|
+'(case when round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 '
|
|
|
+'else v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
|
|
|
+'round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 else '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4) else '
|
|
|
+'1 end) as <20>ƷѶ<C6B7> '
|
|
|
+'FROM t_ch_fee inner join v_op_bscard_all on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> ' +str_zr
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> and t_crm_client_sales.<2E><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><=v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
|
|
|
+clientstr
|
|
|
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
+s_private
|
|
|
|
|
|
+tempstr
|
|
|
+default_sort_two(53,'v_op_bscard_all','t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>','','');
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
|
|
|
|
|
|
frm_rp_no_total.p_accept_fee.Open;
|
|
|
{$ELSE}
|
|
|
frm_rp_no_total.p_accept_fee.ConnectionString:=constr;
|
|
|
DBQueryThread2:=TDBQueryThread.Create(frm_rp_no_total.p_accept_fee,sqltext,frm_rp_no_total.p_accept_fee1);
|
|
|
{$ENDIF}
|
|
|
|
|
|
|
|
|
if not bsSkinCheckRadioBox2.Checked then
|
|
|
begin
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_pay_bill.close;
|
|
|
frm_rp_no_total.p_pay_bill.Connection:=frm_main.db;
|
|
|
frm_rp_no_total.p_pay_bill1.DataSet:=frm_rp_no_total.p_pay_bill;
|
|
|
frm_rp_no_total.p_pay_bill.Parameters.ParamByName('SQLStr').value:=
|
|
|
{$ELSE}
|
|
|
sqltext:=
|
|
|
{$ENDIF}
|
|
|
|
|
|
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+',SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end'
|
|
|
+') as Ӧ<><D3A6>USD,'
|
|
|
+'SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end'
|
|
|
+') as <20>Ѹ<EFBFBD>USD'
|
|
|
+',SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' else 0 end'
|
|
|
+') as δ<><CEB4>USD'
|
|
|
|
|
|
+',SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then ROUND(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)'
|
|
|
+' else 0'
|
|
|
+' end'
|
|
|
+') as Ӧ<><D3A6>RMB'
|
|
|
+',SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then ROUND(t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)'
|
|
|
+' else 0'
|
|
|
+' end'
|
|
|
+') as <20>Ѹ<EFBFBD>RMB'
|
|
|
+',SUM('
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'RMB'+''''+' then '
|
|
|
+' ROUND((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)'
|
|
|
+' else 0'
|
|
|
+' end'
|
|
|
+') as δ<><CEB4>RMB'
|
|
|
|
|
|
//
|
|
|
+',SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' else ROUND(t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)'
|
|
|
+' end'
|
|
|
+') as Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+',SUM('
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' else ROUND(t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,2)'
|
|
|
+' end'
|
|
|
+') as <20>Ѹ<EFBFBD><D1B8><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+',SUM('
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+'''' +' then 0'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' else ROUND((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),2)'
|
|
|
+' end'
|
|
|
+') as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
+',sum(ROUND(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+' sum(ROUND(t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+' sum(ROUND((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD>,2)) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard_all.װ<>˷<EFBFBD>ʽ,'
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E>ջ<EFBFBD><D5BB><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>, v_op_bscard_all.Ŀ<>ĵ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>1, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>2, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>3,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>4, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>5, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>6,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>7, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>8, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>9,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><>TEU, v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E>ͷ<EFBFBD>Ա, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><>վ,v_op_bscard_all.<2E>ᵥǩ<E1B5A5><C7A9>״̬, t_op_gain.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>,v_op_bscard_all.<2E>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
|
|
|
+'DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()) AS ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'isnull(DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(Day,-Day(v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+1,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))))) else 0 end) end)'
|
|
|
+',DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
|
|
|
+'(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0) '
|
|
|
+' when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int)*30+isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0) '
|
|
|
+' else 0 '
|
|
|
+' end) as Э<><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
|
|
|
|
|
|
+'(case when round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 '
|
|
|
+'else v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
|
|
|
+'round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 else '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4) else '
|
|
|
+'1 end) as <20>ƷѶ<C6B7>'
|
|
|
+' FROM t_ch_fee inner join v_op_bscard_all on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> ' +str_zr
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' left join t_op_gain on t_ch_fee.<2E><><EFBFBD><EFBFBD>=t_op_gain.<2E><><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
+tempstr
|
|
|
+s_private
|
|
|
|
|
|
|
|
|
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard_all.װ<>˷<EFBFBD>ʽ,'
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E>ջ<EFBFBD><D5BB><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>, v_op_bscard_all.Ŀ<>ĵ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>1, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>2, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>3,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>4, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>5, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>6,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>7, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>8, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>9,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><>TEU, v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E>ͷ<EFBFBD>Ա, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><>վ, v_op_bscard_all.<2E>ᵥǩ<E1B5A5><C7A9>״̬,t_op_gain.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>,v_op_bscard_all.<2E>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
|
|
|
+'DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()),'
|
|
|
+'isnull(DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, DATEADD(Day,-Day(v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+1,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) )))) else 0 end) end)'
|
|
|
+',DATEDIFF([day],v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())),'
|
|
|
|
|
|
+'(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0) '
|
|
|
+' when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int)*30+isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0) '
|
|
|
+' else 0'
|
|
|
+' end),'
|
|
|
|
|
|
|
|
|
+'(case when round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 '
|
|
|
+'else v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
|
|
|
+'round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 else '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4) else '
|
|
|
+'1 end)'
|
|
|
+default_sort_two(53,'v_op_bscard_all','t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>','','');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// showmessage(tempstr);
|
|
|
// showmessage(sqltext);
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_pay_bill.Open;
|
|
|
|
|
|
|
|
|
|
|
|
{$ELSE}
|
|
|
frm_rp_no_total.p_pay_bill.ConnectionString:=constr;
|
|
|
DBQueryThread3:=TDBQueryThread.Create(frm_rp_no_total.p_pay_bill,sqltext,frm_rp_no_total.p_pay_bill1);
|
|
|
{$ENDIF}
|
|
|
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_pay_fee.close;
|
|
|
frm_rp_no_total.p_pay_fee.Connection:=frm_main.db;
|
|
|
frm_rp_no_total.p_pay_fee.DataSet:=frm_rp_no_total.p_pay_fee;
|
|
|
frm_rp_no_total.p_pay_fee.Parameters.ParamByName('SQLStr').value:=
|
|
|
{$ELSE}
|
|
|
sqltext:=
|
|
|
{$ENDIF}
|
|
|
'SELECT t_ch_fee.ch_id,t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_ch_fee.˰<><CBB0>,t_ch_fee.<2E><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>,t_ch_fee.˰<><CBB0>,t_ch_fee.<2E><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,t_ch_fee.<2E><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,t_ch_fee.<2E><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>,t_ch_fee.<2E>ұ<EFBFBD>,t_ch_fee.<2E><><EFBFBD><EFBFBD> as Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+','
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end'
|
|
|
+' as Ӧ<><D3A6>USD'
|
|
|
+','
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end'
|
|
|
+' as <20>Ѹ<EFBFBD>USD'
|
|
|
+','
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end'
|
|
|
+' as δ<><CEB4>USD'
|
|
|
+','
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end'
|
|
|
+' as Ӧ<><D3A6>RMB'
|
|
|
+','
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end'
|
|
|
+' as <20>Ѹ<EFBFBD>RMB'
|
|
|
+','
|
|
|
+'case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'RMB'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end'
|
|
|
+' as δ<><CEB4>RMB'
|
|
|
|
|
|
+','
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+'''' +' then 0'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' else ROUND((t_ch_fee.<2E><><EFBFBD><EFBFBD>),2)'
|
|
|
+' end'
|
|
|
+' as Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
+','
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+'''' +' then 0'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' else ROUND((t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),2)'
|
|
|
+' end'
|
|
|
+' as <20>Ѹ<EFBFBD><D1B8><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
+','
|
|
|
+' case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+'''' +' then 0'
|
|
|
+' when '+''''+'RMB'+''''+' then 0'
|
|
|
+' else ROUND((t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),2)'
|
|
|
+' end'
|
|
|
+' as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
|
+',t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> as <20>Ѹ<EFBFBD><D1B8><EFBFBD><EFBFBD><EFBFBD>,(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'t_ch_fee.<2E><> as <20><>,t_ch_fee.<2E><><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD>,t_ch_fee.<2E><><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD>,t_ch_fee.<2E><>ע as <20><><EFBFBD>ñ<EFBFBD>ע,'
|
|
|
+'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard_all.װ<>˷<EFBFBD>ʽ,'
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E>ջ<EFBFBD><D5BB><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>, v_op_bscard_all.Ŀ<>ĵ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>1, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>2, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>3,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>4, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>5, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>6,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>7, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>8, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>9,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><>TEU, v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E>ͷ<EFBFBD>Ա, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><>վ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>,'
|
|
|
+'(case when round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 '
|
|
|
+'else v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
|
|
|
+'round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 else '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4) else '
|
|
|
+'1 end) as <20>ƷѶ<C6B7>'
|
|
|
+' FROM t_ch_fee inner join v_op_bscard_all on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> ' +str_zr
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+tempstr
|
|
|
|
|
|
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
+s_private
|
|
|
+default_sort_two(53,'v_op_bscard_all','t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>','','');
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_pay_fee.Open;
|
|
|
{$ELSE}
|
|
|
frm_rp_no_total.p_pay_fee.ConnectionString:=constr;
|
|
|
// showmessage(sqltext);
|
|
|
DBQueryThread4:=TDBQueryThread.Create(frm_rp_no_total.p_pay_fee,sqltext,frm_rp_no_total.p_pay_fee1);
|
|
|
{$ENDIF}
|
|
|
|
|
|
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_total_client.close;
|
|
|
frm_rp_no_total.p_total_client.Connection:=frm_main.db;
|
|
|
frm_rp_no_total.p_total_client.DataSet:=frm_rp_no_total.p_total_client;
|
|
|
frm_rp_no_total.p_total_client.Parameters.ParamByName('SQLStr').value:=
|
|
|
{$ELSE}
|
|
|
sqltext:=
|
|
|
{$ENDIF}
|
|
|
|
|
|
'SELECT '+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_seae on t_op_seae.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> ' +str_seaezr
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
|
|
|
+str_seae
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_seai on t_op_seai.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
|
|
|
+str_seai
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_aire on t_op_aire.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
|
|
|
+str_aire
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_airi on t_op_airi.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
|
|
|
+str_airi
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_railway on t_op_railway.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
|
|
|
+str_railway
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>ܳ<EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_airtruck on t_op_airtruck.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
|
|
|
+str_airtruck
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> ';
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_total_client.Open;
|
|
|
{$ELSE}
|
|
|
frm_rp_no_total.p_total_client.ConnectionString:=constr;
|
|
|
// showmessage(sqltext);
|
|
|
DBQueryThread5:=TDBQueryThread.Create(frm_rp_no_total.p_total_client,sqltext,frm_rp_no_total.p_total_client1);
|
|
|
{$ENDIF}
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_total_sales.close;
|
|
|
frm_rp_no_total.p_total_sales.Parameters.ParamByName('SQLStr').value:=
|
|
|
{$ELSE}
|
|
|
sqltext:=
|
|
|
{$ENDIF}
|
|
|
'SELECT '+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_seae on t_op_seae.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '+ str_seaezr
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
|
|
|
+str_seae
|
|
|
+s_private
|
|
|
+' GROUP BY t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_seai on t_op_seai.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_seai
|
|
|
+s_private
|
|
|
+' GROUP BY t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_op_aire.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_aire on t_op_aire.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_aire
|
|
|
+s_private
|
|
|
+' GROUP BY t_op_aire.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_airi on t_op_airi.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_airi+' GROUP BY t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_railway on t_op_railway.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_railway
|
|
|
+s_private
|
|
|
+' GROUP BY t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>ܳ<EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_op_airtruck.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_airtruck on t_op_airtruck.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_airtruck
|
|
|
+s_private
|
|
|
+' GROUP BY t_op_airtruck.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ';
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_total_sales.Open;
|
|
|
{$ELSE}
|
|
|
frm_rp_no_total.p_total_sales.ConnectionString:=constr;
|
|
|
DBQueryThread6:=TDBQueryThread.Create(frm_rp_no_total.p_total_sales,sqltext,frm_rp_no_total.p_total_sales1);
|
|
|
{$ENDIF}
|
|
|
// ShowMessage(sqltext);
|
|
|
|
|
|
frm_rp_no_total.p_total.close;
|
|
|
frm_rp_no_total.p_total.Parameters.ParamByName('SQLStr').value:=
|
|
|
//sqltext:=
|
|
|
'SELECT '+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_seae on t_op_seae.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '+str_seaezr
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_seae
|
|
|
+s_private
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_seai on t_op_seai.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_seai
|
|
|
+s_private
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_aire on t_op_aire.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_aire
|
|
|
+s_private
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_airi on t_op_airi.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_airi
|
|
|
+s_private
|
|
|
+' union SELECT '+''''+'<27><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_railway on t_op_railway.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_railway
|
|
|
+s_private
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>ܳ<EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,'
|
|
|
+str_feesum
|
|
|
+' FROM t_ch_fee inner join t_op_airtruck on t_op_airtruck.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_airtruck
|
|
|
+s_private;
|
|
|
frm_rp_no_total.p_total.Open;
|
|
|
|
|
|
end else begin
|
|
|
noDrShen;
|
|
|
end;
|
|
|
close;
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
case no_seae_query_bs of
|
|
|
10:
|
|
|
begin
|
|
|
str_bill:=frm_rp_no_seae_query.get_no_str(no_seae_query_table,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
case no_seae_query_bs of
|
|
|
10:
|
|
|
begin
|
|
|
frm_rp_in_total.instr_type:=str_bill;
|
|
|
end;
|
|
|
end;
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.wwDBComboBox18KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
if key=#13 then
|
|
|
begin
|
|
|
key:=#0;
|
|
|
frm_rp_no_seae_query.bsSkinButton1Click(Sender);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.loadFindIni;
|
|
|
var
|
|
|
findini:tinifile ;
|
|
|
mysec,tmpname:string;
|
|
|
canload:boolean ; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
i:integer ;
|
|
|
begin
|
|
|
mysec:=inttostr(no_seae_query_bs) ;
|
|
|
findini:=Tinifile.Create(ExtractFilePath(application.ExeName)+'seaerpnoquery.ini');
|
|
|
try
|
|
|
canload:=findini.ReadBool(mysec,mysec,false);
|
|
|
bsSkinCheckRadioBox1.Checked:=canload ;
|
|
|
if canload then
|
|
|
begin
|
|
|
with bsSkinGroupBox1 do
|
|
|
for i:=0 to ControlCount-1 do
|
|
|
begin
|
|
|
tmpname:=Controls[i].Name ;
|
|
|
if Controls[i] is TwwDBComboBox then
|
|
|
(Controls[i] as TwwDBComboBox).Text:=findini.ReadString(mysec,TmpName,'') else
|
|
|
|
|
|
if Controls[i] is TEdit then
|
|
|
(Controls[i] as TEdit).Text:=findini.ReadString(mysec,TmpName,'') else
|
|
|
if Controls[i] is TwwDBDateTimePicker then
|
|
|
(Controls[i] as TwwDBDateTimePicker).Date:=strtodate(findini.ReadString(mysec,TmpName,'')) else
|
|
|
if Controls[i] is TRxDBLookupCombo then
|
|
|
(Controls[i] as TRxDBLookupCombo).Value:=findini.ReadString(mysec,TmpName,'') ;
|
|
|
end ;
|
|
|
|
|
|
with bsSkinGroupBox4 do
|
|
|
for i:=0 to ControlCount-1 do
|
|
|
begin
|
|
|
tmpname:=Controls[i].Name ;
|
|
|
if Controls[i] is TwwDBComboBox then
|
|
|
(Controls[i] as TwwDBComboBox).Text:=findini.ReadString(mysec,TmpName,'') else
|
|
|
|
|
|
if Controls[i] is TEdit then
|
|
|
(Controls[i] as TEdit).Text:=findini.ReadString(mysec,TmpName,'') else
|
|
|
if Controls[i] is TwwDBDateTimePicker then
|
|
|
(Controls[i] as TwwDBDateTimePicker).Date:=strtodate(findini.ReadString(mysec,TmpName,'')) else
|
|
|
if Controls[i] is TRxDBLookupCombo then
|
|
|
(Controls[i] as TRxDBLookupCombo).Value:=findini.ReadString(mysec,TmpName,'') ;
|
|
|
end ;
|
|
|
|
|
|
with bsSkinGroupBox2 do
|
|
|
for i:=0 to ControlCount-1 do
|
|
|
begin
|
|
|
tmpname:=Controls[i].Name ;
|
|
|
if Controls[i] is TwwDBComboBox then
|
|
|
(Controls[i] as TwwDBComboBox).Text:=findini.ReadString(mysec,TmpName,'') else
|
|
|
|
|
|
if Controls[i] is TEdit then
|
|
|
(Controls[i] as TEdit).Text:=findini.ReadString(mysec,TmpName,'') else
|
|
|
if Controls[i] is TwwDBDateTimePicker then
|
|
|
(Controls[i] as TwwDBDateTimePicker).Date:=strtodate(findini.ReadString(mysec,TmpName,'')) else
|
|
|
if Controls[i] is TRxDBLookupCombo then
|
|
|
(Controls[i] as TRxDBLookupCombo).Value:=findini.ReadString(mysec,TmpName,'') ;
|
|
|
end ;
|
|
|
|
|
|
end else
|
|
|
begin
|
|
|
wwDBComboBox18.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox6.text:='С<><D0A1>';
|
|
|
wwDBComboBox11.text:='С<><D0A1>';
|
|
|
wwDBComboBox19.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox21.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox26.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox24.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox25.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox28.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox29.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox14.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox3.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox38.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
|
wwDBComboBox7.text:='ģ<><C4A3>';
|
|
|
wwDBComboBox8.text:='ģ<><C4A3>';
|
|
|
wwDBComboBox15.text:='ģ<><C4A3>';
|
|
|
wwDBComboBox16.text:='ģ<><C4A3>';
|
|
|
wwDBComboBox35.text:='ģ<><C4A3>';
|
|
|
wwDBComboBox36.text:='ģ<><C4A3>';
|
|
|
|
|
|
wwDBComboBox27.text:='ģ<><C4A3>';
|
|
|
|
|
|
|
|
|
|
|
|
wwDBComboBox13.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox30.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox41.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox42.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox48.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox33.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox53.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox45.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox43.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox1.text:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox4.text:='С<><D0A1>';
|
|
|
wwDBComboBox5.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox17.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox10.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox22.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox52.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
|
wwDBComboBox34.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
|
|
|
|
end ;
|
|
|
finally
|
|
|
findini.free;
|
|
|
end ;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.writeFindIni;
|
|
|
var
|
|
|
findini:tinifile ;
|
|
|
mysec,tmpname:string;
|
|
|
canload:boolean ; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
i:integer ;
|
|
|
begin
|
|
|
canload:=bsSkinCheckRadioBox1.Checked ;
|
|
|
mysec:=inttostr(no_seae_query_bs) ;
|
|
|
findini:=Tinifile.Create(ExtractFilePath(application.ExeName)+'seaerpnoquery.ini');
|
|
|
try
|
|
|
findini.WriteBool(mysec,mysec,canload);
|
|
|
if canload then
|
|
|
begin
|
|
|
with bsSkinGroupBox1 do
|
|
|
for i:=0 to ControlCount-1 do
|
|
|
begin
|
|
|
tmpname:=Controls[i].Name ;
|
|
|
if Controls[i] is TwwDBComboBox then
|
|
|
findini.WriteString(mysec,TmpName,(Controls[i] as TwwDBComboBox).Text) else
|
|
|
|
|
|
if Controls[i] is TEdit then
|
|
|
findini.WriteString(mysec,TmpName,(Controls[i] as TEdit).Text) else
|
|
|
if Controls[i] is TwwDBDateTimePicker then
|
|
|
findini.WriteString(mysec,TmpName,datetostr((Controls[i] as TwwDBDateTimePicker).Date)) else
|
|
|
if Controls[i] is TRxDBLookupCombo then
|
|
|
findini.writeString(mysec,TmpName,(Controls[i] as TRxDBLookupCombo).Value) ;
|
|
|
end ;
|
|
|
with bsSkinGroupBox4 do
|
|
|
for i:=0 to ControlCount-1 do
|
|
|
begin
|
|
|
tmpname:=Controls[i].Name ;
|
|
|
if Controls[i] is TwwDBComboBox then
|
|
|
findini.WriteString(mysec,TmpName,(Controls[i] as TwwDBComboBox).Text) else
|
|
|
|
|
|
if Controls[i] is TEdit then
|
|
|
findini.WriteString(mysec,TmpName,(Controls[i] as TEdit).Text) else
|
|
|
if Controls[i] is TwwDBDateTimePicker then
|
|
|
findini.WriteString(mysec,TmpName,datetostr((Controls[i] as TwwDBDateTimePicker).Date)) else
|
|
|
if Controls[i] is TRxDBLookupCombo then
|
|
|
findini.writeString(mysec,TmpName,(Controls[i] as TRxDBLookupCombo).Value) ;
|
|
|
end ;
|
|
|
with bsSkinGroupBox2 do
|
|
|
for i:=0 to ControlCount-1 do
|
|
|
begin
|
|
|
tmpname:=Controls[i].Name ;
|
|
|
if Controls[i] is TwwDBComboBox then
|
|
|
findini.WriteString(mysec,TmpName,(Controls[i] as TwwDBComboBox).Text) else
|
|
|
|
|
|
if Controls[i] is TEdit then
|
|
|
findini.WriteString(mysec,TmpName,(Controls[i] as TEdit).Text) else
|
|
|
if Controls[i] is TwwDBDateTimePicker then
|
|
|
findini.WriteString(mysec,TmpName,datetostr((Controls[i] as TwwDBDateTimePicker).Date)) else
|
|
|
if Controls[i] is TRxDBLookupCombo then
|
|
|
findini.writeString(mysec,TmpName,(Controls[i] as TRxDBLookupCombo).Value) ;
|
|
|
end ;
|
|
|
|
|
|
|
|
|
end ;
|
|
|
finally
|
|
|
findini.free;
|
|
|
end ;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.InitmemtableinvData;
|
|
|
var corpsname, mblno:string;
|
|
|
begin
|
|
|
frm_rp_no_total.memtblDetail.EmptyTable;
|
|
|
if not frm_rp_no_total.memtblDetail.Active then
|
|
|
frm_rp_no_total.memtblDetail.Open;
|
|
|
with frm_rp_no_total.ADOQueryINV do
|
|
|
begin
|
|
|
First;
|
|
|
while not eof do
|
|
|
begin
|
|
|
corpsname:=trim(fieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
mblno:=trim(fieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring);
|
|
|
if frm_rp_no_total.memtblDetail.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD>ᵥ<EFBFBD><E1B5A5>', VarArrayOf([corpsname, mblno]), []) then
|
|
|
begin
|
|
|
frm_rp_no_total.memtblDetail.Edit;
|
|
|
if trim(fieldByName('USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring)<>'' then
|
|
|
begin
|
|
|
frm_rp_no_total.memtblDetail.FieldByName('USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value
|
|
|
:=frm_rp_no_total.memtblDetail.FieldByName('USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value+' '+fieldByName('USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
|
frm_rp_no_total.memtblDetail.FieldByName('USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value
|
|
|
:=frm_rp_no_total.memtblDetail.FieldByName('USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value+fieldByName('USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asFloat;
|
|
|
end;
|
|
|
|
|
|
if trim(fieldByName('RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring)<>'' then
|
|
|
begin
|
|
|
frm_rp_no_total.memtblDetail.FieldByName('RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value
|
|
|
:=frm_rp_no_total.memtblDetail.FieldByName('RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value+' '+fieldByName('RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
|
frm_rp_no_total.memtblDetail.FieldByName('RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value
|
|
|
:=frm_rp_no_total.memtblDetail.FieldByName('RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value+fieldByName('RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asFloat;
|
|
|
frm_rp_no_total.memtblDetail.Post;
|
|
|
end
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
frm_rp_no_total.memtblDetail.Insert;
|
|
|
|
|
|
frm_rp_no_total.memtblDetail.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=fieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
|
frm_rp_no_total.memtblDetail.FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').Value:=fieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring;
|
|
|
|
|
|
frm_rp_no_total.memtblDetail.FieldByName('USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value:=fieldByName('USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
|
frm_rp_no_total.memtblDetail.FieldByName('USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value:=fieldByName('USD<53><44>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asFloat;
|
|
|
|
|
|
frm_rp_no_total.memtblDetail.FieldByName('RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value:=fieldByName('RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
|
frm_rp_no_total.memtblDetail.FieldByName('RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value:=fieldByName('RMB<4D><42>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asFloat;
|
|
|
|
|
|
frm_rp_no_total.memtblDetail.Post;
|
|
|
|
|
|
end;
|
|
|
next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.noDrShen;
|
|
|
var
|
|
|
str_bill,str_seae,str_seai,str_aire,str_airi,str_airtruck,str_railway,sqltext,constr,clientstr:widestring;
|
|
|
sl:tstrings;
|
|
|
DBQueryThread3,DBQueryThread4,DBQueryThread5,DBQueryThread6,DBQueryThread7:TDBQueryThread;
|
|
|
W: DWord;
|
|
|
H: THandle;
|
|
|
|
|
|
begin
|
|
|
|
|
|
str_seae:=frm_rp_no_seae_query.get_no_str('t_op_seae.','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
str_seai:=frm_rp_no_seae_query.get_no_str('t_op_seai.','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
str_aire:=frm_rp_no_seae_query.get_no_str('t_op_aire.','һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
str_airi:=frm_rp_no_seae_query.get_no_str('t_op_airi.','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
str_airtruck:=frm_rp_no_seae_query.get_no_str('t_op_airtruck.','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
str_railway:=frm_rp_no_seae_query.get_no_str('t_op_railway.','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
str_bill:=frm_rp_no_seae_query.get_no_str('v_op_bscard_all.','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
str_seae:=query_tiaojian(1,str_seae,'t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
str_seai:=query_tiaojian(1,str_seai,'t_op_seai.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
str_aire:=query_tiaojian(1,str_aire,'t_op_aire.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
str_airi:=query_tiaojian(1,str_airi,'t_op_airi.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
str_railway:=query_tiaojian(1,str_railway,'t_op_railway.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
str_airtruck:=query_tiaojian(1,str_airtruck,'t_op_airtruck.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
|
|
|
if wwDBComboBox2.Text<>'' then begin
|
|
|
clientstr:=' left join t_crm_client on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> ';
|
|
|
end else begin
|
|
|
clientstr:=' ';
|
|
|
end;
|
|
|
|
|
|
|
|
|
if no_seae_query_fee=4 then begin
|
|
|
str_seae:=str_seae+' and isnull(DATEDIFF([day],t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
str_seai:=str_seai+' and isnull(DATEDIFF([day],t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
str_aire:=str_aire+' and isnull(DATEDIFF([day],t_op_aire.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],t_op_aire.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_aire.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],t_op_aire.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
|
|
|
str_airi:=str_airi+' and isnull(DATEDIFF([day],t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
str_airtruck:=str_airtruck+' and isnull(DATEDIFF([day],t_op_airtruck.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],t_op_airtruck.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_airtruck.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],t_op_airtruck.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
|
|
|
str_railway:=str_railway+' and isnull(DATEDIFF([day],t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE())-(case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' then isnull(t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)'
|
|
|
+' else (case t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> when ''Լ<><D4BC>ʱ<EFBFBD><CAB1>'' then'
|
|
|
+' ( DATEDIFF([day],t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,DATEADD(month, CAST(t_crm_client_sales.<2E><><EFBFBD><EFBFBD>ģʽ AS int), DATEADD(day,t_crm_client_sales.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))) else 0 end) end),DATEDIFF([day],t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, GETDATE()))>0';
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_pay_bill.close;
|
|
|
frm_rp_no_total.p_pay_bill.Connection:=frm_main.db;
|
|
|
frm_rp_no_total.p_pay_bill1.DataSet:=frm_rp_no_total.p_pay_bill;
|
|
|
frm_rp_no_total.p_pay_bill.Parameters.ParamByName('SQLStr').value:=
|
|
|
{$ELSE}
|
|
|
sqltext:=
|
|
|
{$ENDIF}
|
|
|
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then '
|
|
|
+' (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) as <20>Ѹ<EFBFBD>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then '
|
|
|
+'(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) as δ<><CEB4>USD,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) as Ӧ<><D3A6>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD>'
|
|
|
+' when '+''''+'USD'+''''+' then 0 else '
|
|
|
+' (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' end) as <20>Ѹ<EFBFBD>RMB,SUM(case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''+' then 0'
|
|
|
+' else '
|
|
|
+'(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' end) as δ<><CEB4>RMB,sum(t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+' sum((case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'sum((case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard_all.װ<>˷<EFBFBD>ʽ,'
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E>ջ<EFBFBD><D5BB><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>1, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>2, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>3,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>4, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>5, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>6,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>7, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>8, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>9,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><>TEU, v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E>ͷ<EFBFBD>Ա, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><>վ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>,'
|
|
|
+'(case when round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 '
|
|
|
+'else v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
|
|
|
+'round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 else '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4) else '
|
|
|
+'1 end) as <20>ƷѶ<C6B7>'
|
|
|
+' FROM t_ch_fee inner join v_op_bscard_all on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard_all.װ<>˷<EFBFBD>ʽ,'
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E>ջ<EFBFBD><D5BB><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>1, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>2, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>3,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>4, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>5, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>6,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>7, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>8, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>9,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><>TEU, v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E>ͷ<EFBFBD>Ա, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><>վ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>,'
|
|
|
+'(case when round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 '
|
|
|
+'else v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
|
|
|
+'round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 else '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4) else '
|
|
|
+'1 end)'
|
|
|
+default_sort_two(53,'v_op_bscard_all','t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>','','');
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
{$ELSE}
|
|
|
constr:=connect_string('main.ini');
|
|
|
frm_rp_no_total.p_pay_bill.ConnectionString:=constr;
|
|
|
DBQueryThread3:=TDBQueryThread.Create(frm_rp_no_total.p_pay_bill,sqltext,frm_rp_no_total.p_pay_bill1);
|
|
|
{$ENDIF}
|
|
|
|
|
|
|
|
|
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_pay_fee.close;
|
|
|
frm_rp_no_total.p_pay_fee.Connection:=frm_main.db;
|
|
|
frm_rp_no_total.p_pay_fee.DataSet:=frm_rp_no_total.p_pay_fee;
|
|
|
frm_rp_no_total.p_pay_fee.Parameters.ParamByName('SQLStr').value:=
|
|
|
{$ELSE}
|
|
|
sqltext:=
|
|
|
{$ENDIF}
|
|
|
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_ch_fee.<2E>ұ<EFBFBD>,t_ch_fee.<2E><><EFBFBD><EFBFBD> as Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+' (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end) AS <20>Ѹ<EFBFBD><D1B8><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
// +'t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> as <20>Ѹ<EFBFBD><D1B8><EFBFBD><EFBFBD><EFBFBD>,(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'t_ch_fee.<2E><> as <20><>,t_ch_fee.<2E><><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD>,t_ch_fee.<2E><><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD>,t_ch_fee.<2E><>ע as <20><><EFBFBD>ñ<EFBFBD>ע,'
|
|
|
+'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard_all.װ<>˷<EFBFBD>ʽ,'
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E>ջ<EFBFBD><D5BB><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>1, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>2, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>3,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>4, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>5, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>6,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>7, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>8, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>9,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><>TEU, v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E>ͷ<EFBFBD>Ա, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><>վ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>,'
|
|
|
+'(case when round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 '
|
|
|
+'else v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
|
|
|
+'round((case when v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard_all.<2E><><EFBFBD><EFBFBD> then v_op_bscard_all.<2E><><EFBFBD><EFBFBD>/1000 else '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD> end),4) else '
|
|
|
+'1 end) as <20>ƷѶ<C6B7>'
|
|
|
+' FROM t_ch_fee inner join v_op_bscard_all on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
|
|
|
+s_private
|
|
|
+default_sort_two(53,'v_op_bscard_all','t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>','','');
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_pay_fee.Open;
|
|
|
{$ELSE}
|
|
|
frm_rp_no_total.p_pay_fee.ConnectionString:=constr;
|
|
|
DBQueryThread4:=TDBQueryThread.Create(frm_rp_no_total.p_pay_fee,sqltext,frm_rp_no_total.p_pay_fee1);
|
|
|
{$ENDIF}
|
|
|
|
|
|
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_total_client.close;
|
|
|
frm_rp_no_total.p_total_client.Connection:=frm_main.db;
|
|
|
frm_rp_no_total.p_total_client.DataSet:=frm_rp_no_total.p_total_client;
|
|
|
frm_rp_no_total.p_total_client.Parameters.ParamByName('SQLStr').value:=
|
|
|
{$ELSE}
|
|
|
sqltext:=
|
|
|
{$ENDIF}
|
|
|
'SELECT '+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
// +' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_seae on t_op_seae.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_seae
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_seai on t_op_seai.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_seai
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_aire on t_op_aire.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_aire
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_airi on t_op_airi.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_airi
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_railway on t_op_railway.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_railway
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>ܳ<EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_airtruck on t_op_airtruck.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_airtruck
|
|
|
+s_private
|
|
|
+' GROUP BY t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> ';
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_total_client.Open;
|
|
|
{$ELSE}
|
|
|
frm_rp_no_total.p_total_client.ConnectionString:=constr;
|
|
|
DBQueryThread5:=TDBQueryThread.Create(frm_rp_no_total.p_total_client,sqltext,frm_rp_no_total.p_total_client1);
|
|
|
{$ENDIF}
|
|
|
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_total_sales.close;
|
|
|
frm_rp_no_total.p_total_sales.Parameters.ParamByName('SQLStr').value:=
|
|
|
{$ELSE}
|
|
|
sqltext:=
|
|
|
{$ENDIF}
|
|
|
'SELECT '+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_seae on t_op_seae.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_seae
|
|
|
+s_private
|
|
|
+' GROUP BY t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_seai on t_op_seai.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_seai
|
|
|
+s_private
|
|
|
+' GROUP BY t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_op_aire.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_aire on t_op_aire.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_aire
|
|
|
+s_private
|
|
|
+' GROUP BY t_op_aire.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_airi on t_op_airi.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_airi
|
|
|
+s_private
|
|
|
+' GROUP BY t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' union SELECT '+''''+'<27><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_railway on t_op_railway.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_railway
|
|
|
+s_private
|
|
|
+' GROUP BY t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>ܳ<EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,t_op_airtruck.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_airtruck on t_op_airtruck.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_airtruck
|
|
|
+s_private
|
|
|
+' GROUP BY t_op_airtruck.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ';
|
|
|
|
|
|
{$IFDEF NXIANCHENG}
|
|
|
frm_rp_no_total.p_total_sales.Open;
|
|
|
{$ELSE}
|
|
|
frm_rp_no_total.p_total_sales.ConnectionString:=constr;
|
|
|
DBQueryThread6:=TDBQueryThread.Create(frm_rp_no_total.p_total_sales,sqltext,frm_rp_no_total.p_total_sales1);
|
|
|
{$ENDIF}
|
|
|
|
|
|
frm_rp_no_total.p_total.close;
|
|
|
frm_rp_no_total.p_total.Parameters.ParamByName('SQLStr').value:=
|
|
|
// sqltext:=
|
|
|
'SELECT '+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_seae on t_op_seae.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_seae
|
|
|
+s_private
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_seai on t_op_seai.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_seai
|
|
|
+s_private
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_aire on t_op_aire.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_aire
|
|
|
+s_private
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_airi on t_op_airi.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_airi
|
|
|
+s_private
|
|
|
+' union SELECT '+''''+'<27><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_railway on t_op_railway.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_railway
|
|
|
+s_private
|
|
|
|
|
|
+' union SELECT '+''''+'<27><><EFBFBD>ܳ<EFBFBD>'+''''+' as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)'
|
|
|
+' else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB, '
|
|
|
|
|
|
|
|
|
// +' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
// +' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+'ELSE t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> end) else (CASE WHEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> '
|
|
|
+'THEN t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ELSE t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>, '
|
|
|
// +' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' then (case when t_ch_fee.<2E><><EFBFBD><EFBFBD>>0 then '
|
|
|
+'(CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
|
|
|
+'THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end)*t_ch_fee.<2E><><EFBFBD><EFBFBD>'
|
|
|
+' ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
|
|
|
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END'
|
|
|
+'-CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
|
|
|
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*<2A><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join t_op_airtruck on t_op_airtruck.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+' left join t_crm_client_sales on t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_crm_client_sales.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+clientstr
|
|
|
+str_airtruck
|
|
|
+s_private ;
|
|
|
frm_rp_no_total.p_total.Open;
|
|
|
// frm_rp_no_total.p_total_client.Sort:='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
// frm_rp_no_total.p_total_sales.Sort:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
// frm_rp_no_total.p_total.ConnectionString:=constr;
|
|
|
// DBQueryThread7:=TDBQueryThread.Create(frm_rp_no_total.p_total,sqltext,frm_rp_no_total.p_total1);
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
{ TDBQueryThread }
|
|
|
{
|
|
|
procedure TDBQueryThread.ConnectDB;
|
|
|
begin
|
|
|
try
|
|
|
if ADOConnection=nil then
|
|
|
begin
|
|
|
ADOConnection:=TADOConnection.Create(nil);
|
|
|
ADOConnection.LoginPrompt:=False;
|
|
|
ADOConnection.ConnectionString:=frm_main.db.ConnectionString;
|
|
|
end;
|
|
|
|
|
|
if ADOConnection.Connected then exit;
|
|
|
|
|
|
ADOConnection.Open;
|
|
|
except
|
|
|
Self.Terminate;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
}
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
Action:=caFree;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.bsSkinButton2Click(Sender: TObject);
|
|
|
begin
|
|
|
if RxDBLookupCombo14.DisplayValue='' then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
if wwDBComboBox47.ItemIndex=-1 then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
if wwDBComboBox50.ItemIndex=-1 then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
if query_str_int.Visible then
|
|
|
begin
|
|
|
if query_str_int.text='' then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
if (t_sys_queryfields.FieldByName('<27><><EFBFBD><EFBFBD>').asstring='int') then
|
|
|
begin
|
|
|
try
|
|
|
strtoint(query_str_int.text);
|
|
|
except
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ֵֻ<D6B5><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
if query_bit.Visible then
|
|
|
begin
|
|
|
if query_bit.ItemIndex=-1 then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
if query_date.Visible then
|
|
|
begin
|
|
|
if query_date.text='' then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
if t_sys_query.IsEmpty then
|
|
|
begin
|
|
|
t_sys_query.Insert;
|
|
|
t_sys_query.post;
|
|
|
end;
|
|
|
t_sys_query_detail.Append;
|
|
|
t_sys_query_detail['<27><>']:=t_sys_queryfields['<27><>'];
|
|
|
t_sys_query_detail['<27>ֶ<EFBFBD><D6B6><EFBFBD>']:=t_sys_queryfields['<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>'];
|
|
|
if query_str_int.Visible then
|
|
|
begin
|
|
|
t_sys_query_detail['<27><><EFBFBD><EFBFBD>ֵ']:=query_str_int.text;
|
|
|
end;
|
|
|
if query_bit.Visible then
|
|
|
begin
|
|
|
t_sys_query_detail['<27><><EFBFBD><EFBFBD>ֵ']:=query_bit.text;
|
|
|
end;
|
|
|
if query_date.Visible then
|
|
|
begin
|
|
|
t_sys_query_detail['<27><><EFBFBD><EFBFBD>ֵ']:=query_date.text;
|
|
|
end;
|
|
|
t_sys_query_detail['<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_queryfields['<27><><EFBFBD><EFBFBD>'];
|
|
|
t_sys_query_detail['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ']:=wwDBComboBox47.text;
|
|
|
t_sys_query_detail['<27><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>']:=wwDBComboBox50.text;
|
|
|
t_sys_query_detail.post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
if not t_sys_query_detail.IsEmpty then
|
|
|
t_sys_query_detail.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.bsSkinButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
t_sys_query.Insert;
|
|
|
t_sys_query.post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.bsSkinButton9Click(Sender: TObject);
|
|
|
begin
|
|
|
while not t_sys_query_detail.eof do
|
|
|
begin
|
|
|
t_sys_query_detail.Delete;
|
|
|
end;
|
|
|
if not t_sys_query.Eof then
|
|
|
t_sys_query.delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.RxDBLookupCombo14Change(Sender: TObject);
|
|
|
begin
|
|
|
query_str_int.text:='';
|
|
|
query_bit.text:='';
|
|
|
query_date.text:='';
|
|
|
if t_sys_queryfields.Locate('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>',RxDBLookupCombo14.DisplayValue,[])then
|
|
|
begin
|
|
|
wwDBComboBox50.ItemIndex:=-1;
|
|
|
wwDBComboBox50.Items.Clear;
|
|
|
if (t_sys_queryfields.FieldByName('<27><><EFBFBD><EFBFBD>').asstring='varchar') then
|
|
|
begin
|
|
|
query_str_int.Visible:=true;
|
|
|
query_bit.Visible:=false;
|
|
|
query_date.Visible:=false;
|
|
|
wwDBComboBox50.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
wwDBComboBox50.Items.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
wwDBComboBox50.Items.Add('ģ<><C4A3>');
|
|
|
wwDBComboBox50.ItemIndex:=2;
|
|
|
end;
|
|
|
if (t_sys_queryfields.FieldByName('<27><><EFBFBD><EFBFBD>').asstring='int') then
|
|
|
begin
|
|
|
query_str_int.Visible:=true;
|
|
|
query_bit.Visible:=false;
|
|
|
query_date.Visible:=false;
|
|
|
wwDBComboBox50.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
wwDBComboBox50.Items.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
wwDBComboBox50.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
wwDBComboBox50.Items.Add('С<><D0A1>');
|
|
|
wwDBComboBox50.ItemIndex:=0;
|
|
|
end;
|
|
|
if (t_sys_queryfields.FieldByName('<27><><EFBFBD><EFBFBD>').asstring='bit') then
|
|
|
begin
|
|
|
query_str_int.Visible:=false;
|
|
|
query_bit.Visible:=true;
|
|
|
query_date.Visible:=false;
|
|
|
wwDBComboBox50.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
wwDBComboBox50.Items.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
wwDBComboBox50.ItemIndex:=0;
|
|
|
end;
|
|
|
if (t_sys_queryfields.FieldByName('<27><><EFBFBD><EFBFBD>').asstring='date') then
|
|
|
begin
|
|
|
query_str_int.Visible:=false;
|
|
|
query_bit.Visible:=false;
|
|
|
query_date.Visible:=true;
|
|
|
wwDBComboBox50.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
wwDBComboBox50.Items.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
wwDBComboBox50.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
wwDBComboBox50.Items.Add('С<><D0A1>');
|
|
|
wwDBComboBox50.ItemIndex:=0;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
query_str_int.Visible:=false;
|
|
|
query_bit.Visible:=false;
|
|
|
query_date.Visible:=false;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.t_sys_queryAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_sys_query['<27><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>']:=rp_seae_query_str;
|
|
|
t_sys_query['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
|
|
|
t_sys_query['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.t_sys_query_detailAfterScroll(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if (t_sys_query_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring='varchar') then
|
|
|
begin
|
|
|
dxDBGrid1Column3.Items.Clear;
|
|
|
dxDBGrid1Column3.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
dxDBGrid1Column3.Items.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
dxDBGrid1Column3.Items.Add('ģ<><C4A3>');
|
|
|
dxDBGrid1Column3.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
dxDBGrid1Column3.Items.Add('С<><D0A1>');
|
|
|
end;
|
|
|
if (t_sys_query_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring='int') then
|
|
|
begin
|
|
|
dxDBGrid1Column3.Items.Clear;
|
|
|
dxDBGrid1Column3.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
dxDBGrid1Column3.Items.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
dxDBGrid1Column3.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
dxDBGrid1Column3.Items.Add('С<><D0A1>');
|
|
|
end;
|
|
|
if (t_sys_query_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring='bit') then
|
|
|
begin
|
|
|
dxDBGrid1Column3.Items.Clear;
|
|
|
dxDBGrid1Column3.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
dxDBGrid1Column3.Items.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
if (t_sys_query_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring='date') then
|
|
|
begin
|
|
|
dxDBGrid1Column3.Items.Clear;
|
|
|
dxDBGrid1Column3.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
dxDBGrid1Column3.Items.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
dxDBGrid1Column3.Items.Add('<27><><EFBFBD><EFBFBD>');
|
|
|
dxDBGrid1Column3.Items.Add('С<><D0A1>');
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_no_seae_query.t_sys_query_detailBeforePost(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_sys_query_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring='int' then
|
|
|
begin
|
|
|
try
|
|
|
strtoint(t_sys_query_detail.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring);
|
|
|
except
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ֵֻ<D6B5><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
end;
|
|
|
if t_sys_query_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring='date' then
|
|
|
begin
|
|
|
try
|
|
|
strtodate(t_sys_query_detail.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring);
|
|
|
except
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ֵֻ<D6B5><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
end;
|
|
|
if t_sys_query_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring='bit' then
|
|
|
begin
|
|
|
if (t_sys_query_detail.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring<>'<27><>')
|
|
|
and(t_sys_query_detail.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring<>'<27><>')then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ֵֻ<D6B5><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\<5C><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if (t_sys_query_detail.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ').asstring<>'<27><>')
|
|
|
and(t_sys_query_detail.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ').asstring<>'<27><>')then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵֻ<CFB5><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\<5C><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
|
|
|
if (dxDBGrid1Column3.Items.IndexOf(t_sys_query_detail.fieldbyname('<27><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>').asstring)=-1)
|
|
|
and (t_sys_query_detail.state<>dsinsert) then
|
|
|
begin
|
|
|
showmessage('<27><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+dxDBGrid1Column3.Items.text+'<27><><EFBFBD><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end.
|
|
|
|