⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qiqiufind.pas

📁 气象信息服务(delphi) 气象信息服务(delphi)
💻 PAS
字号:
unit qiqiufind;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DB, ADODB, Grids, DBGrids;

type
  TqiqiufindForm = class(TForm)
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    Edit1: TEdit;
    Label2: TLabel;
    Edit2: TEdit;
    Label3: TLabel;
    Edit3: TEdit;
    Button1: TButton;
    Button2: TButton;
    ADOQuery1: TADOQuery;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    CheckBox1: TCheckBox;
    GroupBox4: TGroupBox;
    Label4: TLabel;
    Edit4: TEdit;
    ComboBox1: TComboBox;
    Label5: TLabel;
    Label6: TLabel;
    Edit5: TEdit;
    Button3: TButton;
    GroupBox5: TGroupBox;
    GroupBox6: TGroupBox;
    Label7: TLabel;
    ComboBox2: TComboBox;
    Edit6: TEdit;
    Label8: TLabel;
    Label9: TLabel;
    Edit7: TEdit;
    Button4: TButton;
    Label10: TLabel;
    ComboBox3: TComboBox;
    Edit8: TEdit;
    Label11: TLabel;
    Label12: TLabel;
    Edit9: TEdit;
    Button5: TButton;
    GroupBox7: TGroupBox;
    Label13: TLabel;
    Label14: TLabel;
    Edit10: TEdit;
    Label15: TLabel;
    Edit11: TEdit;
    Button6: TButton;
    Edit12: TEdit;
    Label18: TLabel;
    Edit14: TEdit;
    Label1: TLabel;
    Label17: TLabel;
    Edit15: TEdit;
    Label16: TLabel;
    Edit13: TEdit;
    Label19: TLabel;
    Edit16: TEdit;
    Label20: TLabel;
    Edit17: TEdit;
    Label21: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    Label24: TLabel;
    Label25: TLabel;
    Label26: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  qiqiufindForm: TqiqiufindForm;
  con,con1,con2,con3,con5,con4,con6,con7,con8,con9,con10,con11,con13,con14,con15,con17,con19:string;
  con12,con16,con18:integer;

implementation

{$R *.dfm}

procedure TqiqiufindForm.Button1Click(Sender: TObject);
begin
con1:=edit1.Text;
con2:=edit2.Text;
con3:=edit3.Text;
con4:=edit13.Text;
con5:=edit14.Text;
con6:=edit15.Text;
con7:=edit16.Text;
con8:=edit17.Text;


  if checkbox1.checked then
  con1:='%'+con1+'%';
  con2:='%'+con2+'%';
  con3:='%'+con3+'%';
  con4:='%'+con4+'%';
  con5:='%'+con5+'%';
  con6:='%'+con6+'%';
  con7:='%'+con7+'%';
  con8:='%'+con8+'%';

begin
  adoquery1.Close;
  adoquery1.SQL.Clear;
  adoquery1.SQL.Text:=('select * from qqfw where qqfw.yy>=:con1 and qqfw.yy<=:con4  and qqfw.mm>=:con5 and qqfw.mm<=:con7 and qqfw.dd>=:con6 and qqfw.dd<=:con8 and ysje like:ysje and ysk like:ysk');
  adoquery1.Parameters.ParamByName('con1').value :=edit1.text;
  adoquery1.Parameters.ParamByName('con4').value :=edit13.text;
  adoquery1.Parameters.ParamByName('con5').value :=edit14.text;
  adoquery1.Parameters.ParamByName('con7').value :=edit16.text;
  adoquery1.Parameters.ParamByName('con6').value :=edit15.text;
  adoquery1.Parameters.ParamByName('con8').value :=edit17.text;
  //adoquery1.SQL.Text:='select * from qqfw where ysje like:ysje and ysk like:ysk ';
 adoquery1.Parameters.ParamByName('ysje').Value:=con2;
 adoquery1.Parameters.ParamByName('ysk').Value:=con3;
  adoquery1.Open;
end;
end;

procedure TqiqiufindForm.Button2Click(Sender: TObject);
begin
close();
end;

procedure TqiqiufindForm.Button3Click(Sender: TObject);
begin
con9:=ComboBox1.Text;
 begin
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as mycount from qqfw where mm=:con9 and yy=:con19');
 adoquery1.Parameters.ParamByName('con9').value :=ComboBox1.Text;
 adoquery1.Parameters.ParamByName('con19').value :=edit1.Text;
 adoquery1.open;
 edit4.Text:=adoquery1.fieldbyname('mycount').asstring;
 con16:=strtoint(edit4.Text);
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as mycount from qqfw where mm=:con9 and yy=:con17');
 adoquery1.Parameters.ParamByName('con9').value :=ComboBox1.Text;
 adoquery1.Parameters.ParamByName('con17').value :=strtoint(edit1.Text)-1;
 adoquery1.open;
 con18:=strtoint(adoquery1.fieldbyname('mycount').asstring);
 if con18<>0 then
 edit5.Text:=floattostr(con16*100/con18)
 else
 showmessage('请输入年份');
 

end;
end;


procedure TqiqiufindForm.Button5Click(Sender: TObject);
begin
con10:=ComboBox3.Text;
 begin
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as mycount from qqfw where yy=:con10');
 adoquery1.Parameters.ParamByName('con10').value :=ComboBox3.Text;
 adoquery1.open;
 edit8.Text:=adoquery1.fieldbyname('mycount').asstring;
end;
end;

procedure TqiqiufindForm.Button4Click(Sender: TObject);
 begin
case strtoint(ComboBox2.Text) of

1:
begin
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as my3count from qqfw where mm=:con14');
 adoquery1.Parameters.ParamByName('con14').value :=1;
 adoquery1.open;
 con12:=strtoint(adoquery1.fieldbyname('my3count').asstring);
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as mycount from qqfw where mm=:con11');
 adoquery1.Parameters.ParamByName('con11').value :=2;
 adoquery1.open;
 con12:=strtoint(adoquery1.fieldbyname('mycount').asstring)+con12;
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as my2count from qqfw where mm=:con13');
 adoquery1.Parameters.ParamByName('con13').value :=3;
 adoquery1.open;
 edit6.Text:=inttostr(strtoint(adoquery1.fieldbyname('my2count').asstring)+con12);
 end;
2:
 begin
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as my3count from qqfw where mm=:con14');
 adoquery1.Parameters.ParamByName('con14').value :=4;
 adoquery1.open;
 con12:=strtoint(adoquery1.fieldbyname('my3count').asstring);
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as mycount from qqfw where mm=:con11');
 adoquery1.Parameters.ParamByName('con11').value :=5;
 adoquery1.open;
 con12:=strtoint(adoquery1.fieldbyname('mycount').asstring)+con12;
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as my2count from qqfw where mm=:con13');
 adoquery1.Parameters.ParamByName('con13').value :=6;
 adoquery1.open;
 edit6.Text:=inttostr(strtoint(adoquery1.fieldbyname('my2count').asstring)+con12);
  end;
3:

begin
adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as my3count from qqfw where mm=:con14');
 adoquery1.Parameters.ParamByName('con14').value :=7;
 adoquery1.open;
 con12:=strtoint(adoquery1.fieldbyname('my3count').asstring);
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as mycount from qqfw where mm=:con11');
 adoquery1.Parameters.ParamByName('con11').value :=8;
 adoquery1.open;
 con12:=strtoint(adoquery1.fieldbyname('mycount').asstring)+con12;
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as my2count from qqfw where mm=:con13');
 adoquery1.Parameters.ParamByName('con13').value :=9;
 adoquery1.open;
 edit6.Text:=inttostr(strtoint(adoquery1.fieldbyname('my2count').asstring)+con12);
 end;
 4:

begin
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as my3count from qqfw where mm=:con14');
 adoquery1.Parameters.ParamByName('con14').value :=10;
 adoquery1.open;
 con12:=strtoint(adoquery1.fieldbyname('my3count').asstring);
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as mycount from qqfw where mm=:con11');
 adoquery1.Parameters.ParamByName('con11').value :=11;
 adoquery1.open;
 con12:=strtoint(adoquery1.fieldbyname('mycount').asstring)+con12;
 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as my2count from qqfw where mm=:con13');
 adoquery1.Parameters.ParamByName('con13').value :=12;
 adoquery1.open;
 edit6.Text:=inttostr(strtoint(adoquery1.fieldbyname('my2count').asstring)+con12);

end;


end;
end;


procedure TqiqiufindForm.Button6Click(Sender: TObject);
begin

 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select sum(ysk) as sun from qqfw');
 adoquery1.open;
 Edit12.Text:=adoquery1.FieldByName('sun').AsString;

 adoquery1.Close;
 adoquery1.SQL.Clear;
 adoquery1.SQL.Text:=('select count(*) as mycount from qqfw where ysk<>0');
 adoquery1.open;
 edit10.Text:=adoquery1.fieldbyname('mycount').asstring;



end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -