|
|
|
|
unit u_info_plan_query;
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
Dialogs, wwdbdatetimepicker, wwdblook, StdCtrls, bsSkinCtrls,
|
|
|
|
|
BusinessSkinForm, Mask, wwdbedit, Wwdotdot, Wwdbcomb;
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
Tfrm_info_plan_query = class(TForm)
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
|
|
Edit1: TEdit;
|
|
|
|
|
wwDBLookupCombo1: TwwDBLookupCombo;
|
|
|
|
|
d1: TwwDBDateTimePicker;
|
|
|
|
|
d2: TwwDBDateTimePicker;
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
d3: TwwDBDateTimePicker;
|
|
|
|
|
Label7: TLabel;
|
|
|
|
|
d4: TwwDBDateTimePicker;
|
|
|
|
|
wwDBComboBox1: TwwDBComboBox;
|
|
|
|
|
Label17: TLabel;
|
|
|
|
|
wwDBComboBox2: TwwDBComboBox;
|
|
|
|
|
Label8: TLabel;
|
|
|
|
|
wwDBComboBox3: TwwDBComboBox;
|
|
|
|
|
Label9: TLabel;
|
|
|
|
|
wwDBLookupCombo2: TwwDBLookupCombo;
|
|
|
|
|
Label10: TLabel;
|
|
|
|
|
wwDBLookupCombo3: TwwDBLookupCombo;
|
|
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
|
|
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
private
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
public
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
frm_info_plan_query: Tfrm_info_plan_query;
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
uses u_info_plan_manage, my_sys_function, u_info_plan_individual;
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_info_plan_query.bsSkinButton5Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
close;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_info_plan_query.bsSkinButton10Click(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
str,str_deatal:widestring;
|
|
|
|
|
begin
|
|
|
|
|
if frm_info_plan_query.Hint='1' then
|
|
|
|
|
str:=' where '+open_data('9001','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no')
|
|
|
|
|
else
|
|
|
|
|
str:='';
|
|
|
|
|
str_deatal:='';
|
|
|
|
|
|
|
|
|
|
if Edit1.text<>''then
|
|
|
|
|
begin
|
|
|
|
|
if str='' then
|
|
|
|
|
str:=' where <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+edit1.text+'%'+''''
|
|
|
|
|
else
|
|
|
|
|
str:=str+' and <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+edit1.text+'%'+'''';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if wwDBLookupCombo1.text<>''then
|
|
|
|
|
begin
|
|
|
|
|
if str='' then
|
|
|
|
|
str:=' where ¼<><C2BC><EFBFBD><EFBFBD>='+''''+wwDBLookupCombo1.text+''''
|
|
|
|
|
else
|
|
|
|
|
str:=str+' and ¼<><C2BC><EFBFBD><EFBFBD>='+''''+wwDBLookupCombo1.text+'''';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if wwDBComboBox2.text<>'' then
|
|
|
|
|
begin
|
|
|
|
|
if str='' then
|
|
|
|
|
str:=' where <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox2.text+''''
|
|
|
|
|
else
|
|
|
|
|
str:=str+' and <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox2.text+'''';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if wwDBComboBox3.text<>'' then
|
|
|
|
|
begin
|
|
|
|
|
if str='' then
|
|
|
|
|
str:=' where <20>ƻ<EFBFBD>״̬='+''''+wwDBComboBox3.text+''''
|
|
|
|
|
else
|
|
|
|
|
str:=str+' and <20>ƻ<EFBFBD>״̬='+''''+wwDBComboBox3.text+'''';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if wwDBLookupCombo2.text<>''then
|
|
|
|
|
begin
|
|
|
|
|
if str='' then
|
|
|
|
|
str:=' where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBLookupCombo2.text+''''
|
|
|
|
|
else
|
|
|
|
|
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBLookupCombo2.text+'''';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if wwDBLookupCombo3.text<>''then
|
|
|
|
|
begin
|
|
|
|
|
if str='' then
|
|
|
|
|
str:=' where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBLookupCombo3.text+''''
|
|
|
|
|
else
|
|
|
|
|
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBLookupCombo3.text+'''';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if Edit1.text<>''then
|
|
|
|
|
begin
|
|
|
|
|
if str_deatal='' then
|
|
|
|
|
str_deatal:=' where <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+edit1.text+'%'+''''
|
|
|
|
|
else
|
|
|
|
|
str_deatal:=str_deatal+' and <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+edit1.text+'%'+'''';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if d1.text<>''then
|
|
|
|
|
begin
|
|
|
|
|
if str_deatal='' then
|
|
|
|
|
str_deatal:=' where ִ<><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+d1.text+''''
|
|
|
|
|
else
|
|
|
|
|
str_deatal:=str_deatal+' and ִ<><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+d1.text+'''';
|
|
|
|
|
end;
|
|
|
|
|
if d2.text<>''then
|
|
|
|
|
begin
|
|
|
|
|
if str_deatal='' then
|
|
|
|
|
str_deatal:=' where ִ<><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+d2.text+''''
|
|
|
|
|
else
|
|
|
|
|
str_deatal:=str+' and ִ<><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+d2.text+'''';
|
|
|
|
|
end;
|
|
|
|
|
if d3.text<>''then
|
|
|
|
|
begin
|
|
|
|
|
if str_deatal='' then
|
|
|
|
|
str_deatal:=' where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+d3.text+''''
|
|
|
|
|
else
|
|
|
|
|
str_deatal:=str_deatal+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+d3.text+'''';
|
|
|
|
|
end;
|
|
|
|
|
if d4.text<>''then
|
|
|
|
|
begin
|
|
|
|
|
if str_deatal='' then
|
|
|
|
|
str_deatal:=' where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+d4.text+''''
|
|
|
|
|
else
|
|
|
|
|
str_deatal:=str_deatal+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+d4.text+'''';
|
|
|
|
|
end;
|
|
|
|
|
if wwDBComboBox1.text<>''then
|
|
|
|
|
begin
|
|
|
|
|
if str_deatal='' then
|
|
|
|
|
str_deatal:=' where <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>='+inttostr(wwDBComboBox1.ItemIndex)
|
|
|
|
|
else
|
|
|
|
|
str_deatal:=str_deatal+' and <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>='+inttostr(wwDBComboBox1.ItemIndex);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if str_deatal<>''then
|
|
|
|
|
begin
|
|
|
|
|
if str='' then
|
|
|
|
|
str:=' where pl_id in (select pl_id from t_info_plan_detail '+str_deatal+')'
|
|
|
|
|
else
|
|
|
|
|
str:=str+' and pl_id in (select pl_id from t_info_plan_detail '+str_deatal+')';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
str:='select * from t_info_plan'+str+' order by ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
|
|
|
|
|
if frm_info_plan_query.Hint='1' then
|
|
|
|
|
begin
|
|
|
|
|
table_query(frm_info_plan_manage.t_info_plan,str);
|
|
|
|
|
if frm_info_plan_manage.t_info_plan.IsEmpty then
|
|
|
|
|
begin
|
|
|
|
|
showmessage('û<>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>');
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
table_query(frm_info_plan_individual.t_info_plan,str);
|
|
|
|
|
if frm_info_plan_individual.t_info_plan.IsEmpty then
|
|
|
|
|
begin
|
|
|
|
|
showmessage('û<>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>');
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
close;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_info_plan_query.Edit1KeyPress(Sender: TObject;
|
|
|
|
|
var Key: Char);
|
|
|
|
|
begin
|
|
|
|
|
if key=#13 then
|
|
|
|
|
begin
|
|
|
|
|
key:=#0;
|
|
|
|
|
frm_info_plan_query.bsSkinButton10Click(Sender);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|