|
|
unit u_op_seae_huanhuo;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, ExtCtrls, bsSkinCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl,
|
|
|
dxDBGrid, DB, ADODB, dxDBTLCl, dxGrClms, wwdblook, RxLookup,
|
|
|
wwdbdatetimepicker, StdCtrls, Mask, wwdbedit, Wwdotdot, Wwdbcomb, Menus,
|
|
|
XPMenu;
|
|
|
|
|
|
type
|
|
|
Tfrm_op_seae_huanhuo = class(TForm)
|
|
|
Panel1: TPanel;
|
|
|
dxDBGrid2: TdxDBGrid;
|
|
|
p_huanhuo: TADOStoredProc;
|
|
|
p_huanhuo1: TDataSource;
|
|
|
p_huanhuo_sum1: TDataSource;
|
|
|
p_huanhuo_sum: TADOStoredProc;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column4: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column5: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column6: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column7: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column8: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column14: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column15: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column16: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column19: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column20: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column37: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column38: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column39: TdxDBGridColumn;
|
|
|
dxDBGrid1Column40: TdxDBGridColumn;
|
|
|
dxDBGrid1Column64: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column65: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column66: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column67: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column21: TdxDBGridColumn;
|
|
|
dxDBGrid1Column22: TdxDBGridColumn;
|
|
|
dxDBGrid1Column23: TdxDBGridColumn;
|
|
|
dxDBGrid1Column24: TdxDBGridColumn;
|
|
|
dxDBGrid2Column1: TdxDBGridColumn;
|
|
|
dxDBGrid2Column2: TdxDBGridColumn;
|
|
|
dxDBGrid2Column3: TdxDBGridColumn;
|
|
|
dxDBGrid2Column4: TdxDBGridColumn;
|
|
|
Panel2: TPanel;
|
|
|
PopupMenu2: TPopupMenu;
|
|
|
N10: TMenuItem;
|
|
|
N11: TMenuItem;
|
|
|
N14: TMenuItem;
|
|
|
N13: TMenuItem;
|
|
|
N12: TMenuItem;
|
|
|
N15: TMenuItem;
|
|
|
N16: TMenuItem;
|
|
|
XPMenu1: TXPMenu;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
Label3: TLabel;
|
|
|
Label10: TLabel;
|
|
|
wwDBDateTimePicker1: TwwDBDateTimePicker;
|
|
|
Edit4: TEdit;
|
|
|
Label1: TLabel;
|
|
|
Label5: TLabel;
|
|
|
Edit2: TEdit;
|
|
|
wwDBDateTimePicker2: TwwDBDateTimePicker;
|
|
|
Label2: TLabel;
|
|
|
Label4: TLabel;
|
|
|
Edit3: TEdit;
|
|
|
RxDBLookupCombo1: TRxDBLookupCombo;
|
|
|
Label16: TLabel;
|
|
|
Label7: TLabel;
|
|
|
wwDBComboBox1: TwwDBComboBox;
|
|
|
RxDBLookupCombo6: TRxDBLookupCombo;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
procedure N10Click(Sender: TObject);
|
|
|
procedure N14Click(Sender: TObject);
|
|
|
procedure N12Click(Sender: TObject);
|
|
|
procedure N16Click(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure RxDBLookupCombo6Exit(Sender: TObject);
|
|
|
procedure RxDBLookupCombo6Enter(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_op_seae_huanhuo: Tfrm_op_seae_huanhuo;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, u_data_share, my_sys_function;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
savereggrid(dxdbgrid1,caption);
|
|
|
frm_op_seae_huanhuo.Hide;
|
|
|
frm_op_seae_huanhuo.ManualFloat(frm_op_seae_huanhuo.BoundsRect );
|
|
|
frm_main.freeTabs('frm_op_seae_huanhuo');
|
|
|
action:=cafree;
|
|
|
frm_op_seae_huanhuo:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.bsSkinButton10Click(Sender: TObject);
|
|
|
var
|
|
|
str,str_detail,str_sum,str_jiezhuan:widestring;
|
|
|
begin
|
|
|
str:='where '+open_data('0001','t_op_seae.¼<><C2BC><EFBFBD><EFBFBD>','t_op_seae.<2E><><EFBFBD><EFBFBD>Ա','t_op_seae.<2E>ͷ<EFBFBD>Ա','t_op_seae.<2E><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
if Edit4.text<>''then
|
|
|
str:=str+' and t_op_seae.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''';
|
|
|
if Edit2.text<>''then
|
|
|
str:=str+' and t_op_seae.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
|
|
|
if Edit3.text<>''then
|
|
|
str:=str+' and t_op_seae.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit3.text+'%'+'''';
|
|
|
if wwDBDateTimePicker2.text<>''then
|
|
|
str:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
|
|
|
if RxDBLookupCombo6.DisplayValues[1]<>''then
|
|
|
str:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD>Ա='+''''+RxDBLookupCombo6.DisplayValues[1]+'''';
|
|
|
if RxDBLookupCombo1.DisplayValues[1]<>''then
|
|
|
str:=str+' and t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>='+''''+RxDBLookupCombo1.DisplayValues[1]+'''';
|
|
|
if wwDBComboBox1.text<>''then
|
|
|
str:=str+' and t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ='+''''+wwDBComboBox1.text+'''';
|
|
|
if wwDBDateTimePicker1.text<>''then
|
|
|
begin
|
|
|
str_jiezhuan:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><'+''''+wwDBDateTimePicker1.text+'''';
|
|
|
str:=str+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
|
|
|
end;
|
|
|
|
|
|
str_detail:='SELECT t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD>, t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>,'
|
|
|
+'t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ, t_op_seae_huanhuo.¼<><C2BC><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_seae_huanhuo.¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.ҵ<><D2B5>״̬, t_op_seae.<2E><><EFBFBD><EFBFBD>״̬,'
|
|
|
+'t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, t_op_seae.<2E>ܴ<EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, t_op_seae.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, t_op_seae.ί<>б<EFBFBD><D0B1><EFBFBD>,'
|
|
|
+'t_op_seae.ί<>е<EFBFBD>λ, t_op_seae.װ<>˷<EFBFBD>ʽ, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_seae.<2E>ջ<EFBFBD><D5BB><EFBFBD>, t_op_seae.֪ͨ<CDA8><D6AA>, t_op_seae.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_seae.<2E><>վ, t_op_seae.<2E><><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD>˸<EFBFBD>, t_op_seae.װ<><D7B0><EFBFBD><EFBFBD>, t_op_seae.ж<><D0B6><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD≯ۿ<CCB8>, t_op_seae.<2E><><EFBFBD>̴<EFBFBD><CCB4><EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD>̺<EFBFBD><CCBA><EFBFBD>, t_op_seae.Ŀ<>ĵ<EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>,'
|
|
|
+'t_op_seae.<2E>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>, t_op_seae.ǩ<><C7A9><EFBFBD><EFBFBD>ʽ, t_op_seae.ǩ<><C7A9><EFBFBD>ص<EFBFBD>,'
|
|
|
+'t_op_seae.ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD>ѷ<EFBFBD>ʽ, t_op_seae.Ԥ<><D4A4><EFBFBD>ص<EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_seae.<2E><>װ, t_op_seae.<2E><><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E>ͷ<EFBFBD>Ա, t_op_seae.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD><EFBFBD>˾, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>, t_op_seae.<2E><><EFBFBD>ط<EFBFBD><D8B7><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_seae.Ѭ<><D1AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD>Ա, t_op_seae.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E>ֲ<EFBFBD><D6B2><EFBFBD>, t_op_seae.<2E><>Ӫ<EFBFBD><D3AA>λ,'
|
|
|
+'t_op_seae.<2E><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>, t_op_seae.<2E><>ͬ<EFBFBD><CDAC>, t_op_seae.<2E><><EFBFBD>ر<EFBFBD>ע,'
|
|
|
+'t_op_seae.<2E>Ƿ<EFBFBD><C7B7><EFBFBD>˰, t_op_seae.<2E><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>, t_op_seae.<2E>Ƿ<EFBFBD>ͨ<EFBFBD><CDA8>,'
|
|
|
+'t_op_seae.ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>, t_op_seae.Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>, t_op_seae.<2E>¶ȵ<C2B6>λ, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ,'
|
|
|
+'t_op_seae.<2E><>Ʊ<EFBFBD><C6B1>, t_op_seae.<2E><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>,'
|
|
|
+'t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ,'
|
|
|
+'(CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 ELSE '
|
|
|
+'<27><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 ELSE '
|
|
|
+'<27><><EFBFBD><EFBFBD> END) ELSE 1 END) else 0 end) AS <20><><EFBFBD><EFBFBD><EFBFBD>ƷѶ<C6B7>,'
|
|
|
|
|
|
+'(CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 ELSE '
|
|
|
+'<27><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 ELSE '
|
|
|
+'<27><><EFBFBD><EFBFBD> END) else 1 end) else 0 end) AS <20><><EFBFBD><EFBFBD><EFBFBD>ƷѶ<C6B7> '
|
|
|
+'FROM t_op_seae_huanhuo INNER JOIN '
|
|
|
+'t_op_seae ON t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD> = t_op_seae.<2E><><EFBFBD><EFBFBD> '
|
|
|
+str
|
|
|
+default_sort(53,'t_op_seae','','');
|
|
|
if str_jiezhuan=''then
|
|
|
begin
|
|
|
str_sum:='SELECT t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>,'
|
|
|
+'SUM(CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END) else 1 end) else 0 end) AS <20><><EFBFBD><EFBFBD>,'
|
|
|
|
|
|
+'SUM(CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END) else 1 end) else 0 end) AS <20><><EFBFBD><EFBFBD>,'
|
|
|
|
|
|
+'SUM((CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END) else 1 end) else 0 end) '
|
|
|
+'- (CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+' ELSE <20><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+' ELSE <20><><EFBFBD><EFBFBD> END) ELSE 0 END) else 0 end)) AS <20><><EFBFBD><EFBFBD> '
|
|
|
+'FROM t_op_seae_huanhuo INNER JOIN '
|
|
|
+'t_op_seae ON t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD> = t_op_seae.<2E><><EFBFBD><EFBFBD> '
|
|
|
+str
|
|
|
+' GROUP BY t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD> '
|
|
|
+' order by <20><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str_sum:='SELECT t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>,'
|
|
|
+'SUM(CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END) else 1 end) ELSE 0 END) AS <20><><EFBFBD><EFBFBD>,'
|
|
|
|
|
|
+'SUM(CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END) else 1 end) ELSE 0 END) AS <20><><EFBFBD><EFBFBD>,'
|
|
|
|
|
|
+'SUM((CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END) else 1 end) ELSE 0 END) '
|
|
|
|
|
|
+'- (CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END) else 1 end) ELSE 0 END)) AS <20><><EFBFBD><EFBFBD> '
|
|
|
+'FROM t_op_seae_huanhuo INNER JOIN '
|
|
|
+'t_op_seae ON t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD> = t_op_seae.<2E><><EFBFBD><EFBFBD> '
|
|
|
+str
|
|
|
+' GROUP BY t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD> '
|
|
|
|
|
|
+'union SELECT t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>,'
|
|
|
+'SUM(CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END) else 1 end) ELSE 0 END) AS <20><><EFBFBD><EFBFBD>,'
|
|
|
|
|
|
+'SUM(CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END) else 1 end) ELSE 0 END) AS <20><><EFBFBD><EFBFBD>,'
|
|
|
|
|
|
+'SUM((CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END) else 1 end) ELSE 0 END) '
|
|
|
|
|
|
+'- (CASE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ WHEN '
|
|
|
+''''+'<27><><EFBFBD><EFBFBD>'+''''+' THEN (case when (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END)>1 then (CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 '
|
|
|
+'ELSE <20><><EFBFBD><EFBFBD> END) else 1 end) ELSE 0 END)) AS <20><><EFBFBD><EFBFBD> '
|
|
|
|
|
|
+'FROM t_op_seae_huanhuo INNER JOIN '
|
|
|
+'t_op_seae ON t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD> = t_op_seae.<2E><><EFBFBD><EFBFBD> '
|
|
|
+str_jiezhuan
|
|
|
+' GROUP BY t_op_seae_huanhuo.<2E><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD> ' ;
|
|
|
end;
|
|
|
p_huanhuo.close;
|
|
|
p_huanhuo.Parameters.ParamByName('SQLStr').value:=str_detail;
|
|
|
p_huanhuo.open;
|
|
|
|
|
|
p_huanhuo_sum.close;
|
|
|
p_huanhuo_sum.Parameters.ParamByName('SQLStr').value:=str_sum;
|
|
|
p_huanhuo_sum.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.bsSkinButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
Edit4.text:='';
|
|
|
Edit2.text:='';
|
|
|
Edit3.text:='';
|
|
|
wwDBDateTimePicker1.text:='';
|
|
|
wwDBDateTimePicker2.text:='';
|
|
|
RxDBLookupCombo6.ClearValue;
|
|
|
RxDBLookupCombo1.ClearValue;
|
|
|
wwDBComboBox1.text:='';
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
begin
|
|
|
Column_sort_pro(Column,p_huanhuo,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.N10Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid_view_no(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.N14Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid_view_all(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.N12Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid(dxdbgrid1,96);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.N16Click(Sender: TObject);
|
|
|
begin
|
|
|
grid_save_xls(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
loadreggrid(dxdbgrid1,false,caption);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.bsSkinButton9Click(Sender: TObject);
|
|
|
begin
|
|
|
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>ƴ<EFBFBD>任<EFBFBD><E4BBBB>',2,nil,nil,nil,nil,p_huanhuo1,p_huanhuo_sum1,nil,nil,nil,nil,nil);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.Edit1KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
if key=#13 then
|
|
|
begin
|
|
|
key:=#0;
|
|
|
frm_op_seae_huanhuo.bsSkinButton10Click(Sender);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.RxDBLookupCombo6Exit(Sender: TObject);
|
|
|
begin
|
|
|
TRxDBLookupCombo(Sender).LookupDisplay:='<27><><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_huanhuo.RxDBLookupCombo6Enter(Sender: TObject);
|
|
|
begin
|
|
|
TRxDBLookupCombo(Sender).LookupDisplay:='<27><><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
end.
|