if aa.ActivePage.Caption='ί<>е<EFBFBD>λ' then begin
if (Pos('<27><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>',str)>0 ) then begin
p_sum.close;
p_sum.Parameters.ParamByName('SQLStr').Value:=
'SELECT COUNT(t_op_seae.<2E><><EFBFBD><EFBFBD>) as Ʊ<><C6B1>, sum(case t_op_seae.װ<>˷<EFBFBD>ʽ when ''ƴ<>䵥Ʊ'' THEN (case when isnull((CASE WHEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 > t_op_seae.<2E><><EFBFBD><EFBFBD> THEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 ELSE t_op_seae.<2E><><EFBFBD><EFBFBD> END), 0)>1 then '
+' case t_op_seae.װ<>˷<EFBFBD>ʽ when ''ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ'' THEN (case when isnull((CASE WHEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 > t_op_seae.<2E><><EFBFBD><EFBFBD> THEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 ELSE t_op_seae.<2E><><EFBFBD><EFBFBD> END), 0)>1 then '
+' isnull((CASE WHEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 > t_op_seae.<2E><><EFBFBD><EFBFBD> THEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 ELSE t_op_seae.<2E><><EFBFBD><EFBFBD> END), 0) else 1 end) ELSE 0 END END) '
+'AS <20>ƷѶ<C6B7>,sum(t_op_seae.<2E><><EFBFBD><EFBFBD>1) as <20><><EFBFBD><EFBFBD>1, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>2) as <20><><EFBFBD><EFBFBD>2'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>3) as <20><><EFBFBD><EFBFBD>3, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>4) as <20><><EFBFBD><EFBFBD>4, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>5) as <20><><EFBFBD><EFBFBD>5'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>6) as <20><><EFBFBD><EFBFBD>6, sum( t_op_seae.<2E><><EFBFBD><EFBFBD>7) as <20><><EFBFBD><EFBFBD>7, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>8) as <20><><EFBFBD><EFBFBD>8'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>9) as <20><><EFBFBD><EFBFBD>9, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>10) as <20><><EFBFBD><EFBFBD>10'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, sum( t_op_seae.<2E><>TEU) as <20><>TEU, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>, sum( t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>, sum(v_op_gain.<2E><><EFBFBD><EFBFBD>USD) as <20><><EFBFBD><EFBFBD>USD'
+', sum(v_op_gain.Ӧ<><D3A6>USD) as Ӧ<><D3A6>USD, sum( v_op_gain.Ӧ<><D3A6>USD) as Ӧ<><D3A6>USD, sum(v_op_gain.<2E><><EFBFBD><EFBFBD>RMB) as <20><><EFBFBD><EFBFBD>RMB'
+', sum(v_op_gain.Ӧ<><D3A6>RMB) as Ӧ<><D3A6>RMB, sum( v_op_gain.Ӧ<><D3A6>RMB) as Ӧ<><D3A6>RMB, sum(v_op_gain.ë<><C3AB><EFBFBD><EFBFBD>) as ë<><C3AB><EFBFBD><EFBFBD>'
+', sum(v_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>, sum( v_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>'
+',(case when isnull(sum(v_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>),0)=0 then '+''''+'<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'+''''+' else '
+'ltrim(str(sum(v_op_gain.ë<><C3AB><EFBFBD><EFBFBD>)/sum(v_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>)*100,10,2))+'+''''+'%'+''''+' end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' ,CAST(CASE WHEN sum( t_op_seae.<2E><>TEU)=0 THEN 0 ELSE sum(v_op_gain.ë<><C3AB><EFBFBD><EFBFBD>)/sum( t_op_seae.<2E><>TEU) END AS decimal(10,2)) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+',t_op_seae.'+aa.ActivePage.Caption+' as base,t_crm_client_class.<2E>ͻ<EFBFBD><CDBB>ȼ<EFBFBD>,(select top 1 <20>ͻ<EFBFBD>ȫ<EFBFBD><C8AB> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_op_seae.ί<>е<EFBFBD>λ) ί<>е<EFBFBD>λȫ<CEBB><C8AB> '
+','+''''+aa.ActivePage.Caption+''''+' as ͳ<>Ʊ<EFBFBD>'
+' FROM t_op_seae LEFT JOIN'
+' v_op_gain ON t_op_seae.<2E><><EFBFBD><EFBFBD> = v_op_gain.<2E><><EFBFBD><EFBFBD> '
+' left join t_crm_client_class on t_op_seae.ί<>е<EFBFBD>λ=t_crm_client_class.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> and t_crm_client_class.<2E><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><=t_op_seae.Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and convert(varchar(100),t_op_seae.Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,23)<=t_crm_client_class.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and t_crm_client_class.״̬=''<27><><EFBFBD><EFBFBD>'' '
+str+' group by '+'t_op_seae.'+aa.ActivePage.Caption+',t_crm_client_class.<2E>ͻ<EFBFBD><CDBB>ȼ<EFBFBD>'
+' order by '+'t_op_seae.'+aa.ActivePage.Caption;
p_sum.open;
end else begin
p_sum.close;
p_sum.Parameters.ParamByName('SQLStr').Value:=
'SELECT COUNT(t_op_seae.<2E><><EFBFBD><EFBFBD>) as Ʊ<><C6B1>, sum(case t_op_seae.װ<>˷<EFBFBD>ʽ when ''ƴ<>䵥Ʊ'' THEN (case when isnull((CASE WHEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 > t_op_seae.<2E><><EFBFBD><EFBFBD> THEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 ELSE t_op_seae.<2E><><EFBFBD><EFBFBD> END), 0)>1 then '
+' case t_op_seae.װ<>˷<EFBFBD>ʽ when ''ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ'' THEN (case when isnull((CASE WHEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 > t_op_seae.<2E><><EFBFBD><EFBFBD> THEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 ELSE t_op_seae.<2E><><EFBFBD><EFBFBD> END), 0)>1 then '
+' isnull((CASE WHEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 > t_op_seae.<2E><><EFBFBD><EFBFBD> THEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 ELSE t_op_seae.<2E><><EFBFBD><EFBFBD> END), 0) else 1 end) ELSE 0 END END) '
+'AS <20>ƷѶ<C6B7>,sum(t_op_seae.<2E><><EFBFBD><EFBFBD>1) as <20><><EFBFBD><EFBFBD>1, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>2) as <20><><EFBFBD><EFBFBD>2'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>3) as <20><><EFBFBD><EFBFBD>3, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>4) as <20><><EFBFBD><EFBFBD>4, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>5) as <20><><EFBFBD><EFBFBD>5'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>6) as <20><><EFBFBD><EFBFBD>6, sum( t_op_seae.<2E><><EFBFBD><EFBFBD>7) as <20><><EFBFBD><EFBFBD>7, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>8) as <20><><EFBFBD><EFBFBD>8'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>9) as <20><><EFBFBD><EFBFBD>9, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>10) as <20><><EFBFBD><EFBFBD>10'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, sum( t_op_seae.<2E><>TEU) as <20><>TEU, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>, sum( t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>, sum(t_op_gain.<2E><><EFBFBD><EFBFBD>USD) as <20><><EFBFBD><EFBFBD>USD'
+', sum(t_op_gain.Ӧ<><D3A6>USD) as Ӧ<><D3A6>USD, sum( t_op_gain.Ӧ<><D3A6>USD) as Ӧ<><D3A6>USD, sum(t_op_gain.<2E><><EFBFBD><EFBFBD>RMB) as <20><><EFBFBD><EFBFBD>RMB'
+', sum(t_op_gain.Ӧ<><D3A6>RMB) as Ӧ<><D3A6>RMB, sum( t_op_gain.Ӧ<><D3A6>RMB) as Ӧ<><D3A6>RMB, sum(t_op_gain.ë<><C3AB><EFBFBD><EFBFBD>) as ë<><C3AB><EFBFBD><EFBFBD>'
+', sum(t_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>, sum( t_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>'
+',(case when isnull(sum(t_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>),0)=0 then '+''''+'<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'+''''+' else '
+'ltrim(str(sum(t_op_gain.ë<><C3AB><EFBFBD><EFBFBD>)/sum(t_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>)*100,10,2))+'+''''+'%'+''''+' end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' ,CAST(CASE WHEN sum( t_op_seae.<2E><>TEU)=0 THEN 0 ELSE sum(t_op_gain.ë<><C3AB><EFBFBD><EFBFBD>)/sum( t_op_seae.<2E><>TEU) END AS decimal(10,2)) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+',t_op_seae.'+aa.ActivePage.Caption+' as base,t_crm_client_class.<2E>ͻ<EFBFBD><CDBB>ȼ<EFBFBD>,(select top 1 <20>ͻ<EFBFBD>ȫ<EFBFBD><C8AB> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=t_op_seae.ί<>е<EFBFBD>λ) ί<>е<EFBFBD>λȫ<CEBB><C8AB> '
+','+''''+aa.ActivePage.Caption+''''+' as ͳ<>Ʊ<EFBFBD>'
+' FROM t_op_seae LEFT JOIN'
+' t_op_gain ON t_op_seae.<2E><><EFBFBD><EFBFBD> = t_op_gain.<2E><><EFBFBD><EFBFBD> '
+' left join t_crm_client_class on t_op_seae.ί<>е<EFBFBD>λ=t_crm_client_class.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> and t_crm_client_class.<2E><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><=t_op_seae.Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and convert(varchar(100),t_op_seae.Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,23)<=t_crm_client_class.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and t_crm_client_class.״̬=''<27><><EFBFBD><EFBFBD>'' '
+str+' group by '+'t_op_seae.'+aa.ActivePage.Caption+',t_crm_client_class.<2E>ͻ<EFBFBD><CDBB>ȼ<EFBFBD>'
+' order by '+'t_op_seae.'+aa.ActivePage.Caption;
p_sum.open;
end;
dxDBGrid2Column39.Visible:=True;
end else begin
sumfield:=aa.ActivePage.Caption;
if (sumfield='<27><><EFBFBD>մ<EFBFBD><D5B4><EFBFBD>') then sumfield:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾';
p_sum.close;
if (Pos('<27><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>',str)>0 ) then begin
p_sum.Parameters.ParamByName('SQLStr').Value:=
'SELECT COUNT(t_op_seae.<2E><><EFBFBD><EFBFBD>) as Ʊ<><C6B1>, sum(case t_op_seae.װ<>˷<EFBFBD>ʽ when ''ƴ<>䵥Ʊ'' THEN (case when isnull((CASE WHEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 > t_op_seae.<2E><><EFBFBD><EFBFBD> THEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 ELSE t_op_seae.<2E><><EFBFBD><EFBFBD> END), 0)>1 then '
+' case t_op_seae.װ<>˷<EFBFBD>ʽ when ''ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ'' THEN (case when isnull((CASE WHEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 > t_op_seae.<2E><><EFBFBD><EFBFBD> THEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 ELSE t_op_seae.<2E><><EFBFBD><EFBFBD> END), 0)>1 then '
+' isnull((CASE WHEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 > t_op_seae.<2E><><EFBFBD><EFBFBD> THEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 ELSE t_op_seae.<2E><><EFBFBD><EFBFBD> END), 0) else 1 end) ELSE 0 END END) '
+'AS <20>ƷѶ<C6B7>,sum(t_op_seae.<2E><><EFBFBD><EFBFBD>1) as <20><><EFBFBD><EFBFBD>1, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>2) as <20><><EFBFBD><EFBFBD>2'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>3) as <20><><EFBFBD><EFBFBD>3, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>4) as <20><><EFBFBD><EFBFBD>4, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>5) as <20><><EFBFBD><EFBFBD>5'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>6) as <20><><EFBFBD><EFBFBD>6, sum( t_op_seae.<2E><><EFBFBD><EFBFBD>7) as <20><><EFBFBD><EFBFBD>7, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>8) as <20><><EFBFBD><EFBFBD>8'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>9) as <20><><EFBFBD><EFBFBD>9, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>10) as <20><><EFBFBD><EFBFBD>10'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, sum( t_op_seae.<2E><>TEU) as <20><>TEU, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>, sum( t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>, sum(v_op_gain.<2E><><EFBFBD><EFBFBD>USD) as <20><><EFBFBD><EFBFBD>USD'
+', sum(v_op_gain.Ӧ<><D3A6>USD) as Ӧ<><D3A6>USD, sum( v_op_gain.Ӧ<><D3A6>USD) as Ӧ<><D3A6>USD, sum(v_op_gain.<2E><><EFBFBD><EFBFBD>RMB) as <20><><EFBFBD><EFBFBD>RMB'
+', sum(v_op_gain.Ӧ<><D3A6>RMB) as Ӧ<><D3A6>RMB, sum( v_op_gain.Ӧ<><D3A6>RMB) as Ӧ<><D3A6>RMB, sum(v_op_gain.ë<><C3AB><EFBFBD><EFBFBD>) as ë<><C3AB><EFBFBD><EFBFBD>'
+', sum(v_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>, sum( v_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>'
+',(case when isnull(sum(v_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>),0)=0 then '+''''+'<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'+''''+' else '
+'ltrim(str(sum(v_op_gain.ë<><C3AB><EFBFBD><EFBFBD>)/sum(v_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>)*100,10,2))+'+''''+'%'+''''+' end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' ,CAST(CASE WHEN sum( t_op_seae.<2E><>TEU)=0 THEN 0 ELSE sum(v_op_gain.ë<><C3AB><EFBFBD><EFBFBD>)/sum( t_op_seae.<2E><>TEU) END AS decimal(10,2)) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' v_op_gain ON t_op_seae.<2E><><EFBFBD><EFBFBD> = v_op_gain.<2E><><EFBFBD><EFBFBD> '
+str+' group by '+'t_op_seae.'+sumfield
+' order by '+'t_op_seae.'+sumfield;
p_sum.open;
end else begin
p_sum.Parameters.ParamByName('SQLStr').Value:=
'SELECT COUNT(t_op_seae.<2E><><EFBFBD><EFBFBD>) as Ʊ<><C6B1>, sum(case t_op_seae.װ<>˷<EFBFBD>ʽ when ''ƴ<>䵥Ʊ'' THEN (case when isnull((CASE WHEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 > t_op_seae.<2E><><EFBFBD><EFBFBD> THEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 ELSE t_op_seae.<2E><><EFBFBD><EFBFBD> END), 0)>1 then '
+' case t_op_seae.װ<>˷<EFBFBD>ʽ when ''ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ'' THEN (case when isnull((CASE WHEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 > t_op_seae.<2E><><EFBFBD><EFBFBD> THEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 ELSE t_op_seae.<2E><><EFBFBD><EFBFBD> END), 0)>1 then '
+' isnull((CASE WHEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 > t_op_seae.<2E><><EFBFBD><EFBFBD> THEN t_op_seae.<2E><><EFBFBD><EFBFBD> / 1000 ELSE t_op_seae.<2E><><EFBFBD><EFBFBD> END), 0) else 1 end) ELSE 0 END END) '
+'AS <20>ƷѶ<C6B7>,sum(t_op_seae.<2E><><EFBFBD><EFBFBD>1) as <20><><EFBFBD><EFBFBD>1, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>2) as <20><><EFBFBD><EFBFBD>2'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>3) as <20><><EFBFBD><EFBFBD>3, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>4) as <20><><EFBFBD><EFBFBD>4, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>5) as <20><><EFBFBD><EFBFBD>5'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>6) as <20><><EFBFBD><EFBFBD>6, sum( t_op_seae.<2E><><EFBFBD><EFBFBD>7) as <20><><EFBFBD><EFBFBD>7, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>8) as <20><><EFBFBD><EFBFBD>8'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>9) as <20><><EFBFBD><EFBFBD>9, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>10) as <20><><EFBFBD><EFBFBD>10'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, sum( t_op_seae.<2E><>TEU) as <20><>TEU, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>'
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>, sum( t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>, sum(t_op_gain.<2E><><EFBFBD><EFBFBD>USD) as <20><><EFBFBD><EFBFBD>USD'
+', sum(t_op_gain.Ӧ<><D3A6>USD) as Ӧ<><D3A6>USD, sum( t_op_gain.Ӧ<><D3A6>USD) as Ӧ<><D3A6>USD, sum(t_op_gain.<2E><><EFBFBD><EFBFBD>RMB) as <20><><EFBFBD><EFBFBD>RMB'
+', sum(t_op_gain.Ӧ<><D3A6>RMB) as Ӧ<><D3A6>RMB, sum( t_op_gain.Ӧ<><D3A6>RMB) as Ӧ<><D3A6>RMB, sum(t_op_gain.ë<><C3AB><EFBFBD><EFBFBD>) as ë<><C3AB><EFBFBD><EFBFBD>'
+', sum(t_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>, sum( t_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>'
+',(case when isnull(sum(t_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>),0)=0 then '+''''+'<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'+''''+' else '
+'ltrim(str(sum(t_op_gain.ë<><C3AB><EFBFBD><EFBFBD>)/sum(t_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>)*100,10,2))+'+''''+'%'+''''+' end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+' ,CAST(CASE WHEN sum( t_op_seae.<2E><>TEU)=0 THEN 0 ELSE sum(t_op_gain.ë<><C3AB><EFBFBD><EFBFBD>)/sum( t_op_seae.<2E><>TEU) END AS decimal(10,2)) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
if aa.ActivePage.Caption='<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>' then begin
aQuery:=CreateAdoQuery;
try
memtblrpt_total.First;
while not memtblrpt_total.Eof do begin
if memtblrpt_total.FieldByName('base').AsString='<27><><EFBFBD>ⲿ' then begin
with aQuery do begin
Close;SQL.Clear;
SQL.Add('select sum(<28><><EFBFBD><EFBFBD>*<2A><><EFBFBD><EFBFBD>) as <20>ڲ<EFBFBD>Ӧ<EFBFBD><D3A6> from t_ch_fee where <20><><EFBFBD><EFBFBD>=''<27><>'' AND <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+memtblrpt_total.FieldByName('base').AsString+''' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_seae '+Str+')');
Open;
if FieldByName('<27>ڲ<EFBFBD>Ӧ<EFBFBD><D3A6>').AsFloat<>0 then begin