📄 selectdata.~pas
字号:
if form3.CheckBox1.Checked=true then
begin
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and zfbm=:p3 and a.wfsj between :p1 and :p2 order by a.TZSHM ');
form1.query1.ParamByName('p3').AsString:=trim(form3.ComboBox2.Text);
form1.query1.ParamByName('p1').Value:=datetostr(form3.datetimepicker3.Date);
form1.query1.ParamByName('p2').Value:=datetostr(form3.datetimepicker4.Date);
form1.Query1.Prepare;
form1.query1.Open;
end
else
begin
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and zfbm=:p3 order by a.TZSHM ');
form1.query1.ParamByName('p3').AsString:=trim(form3.ComboBox2.Text);
form1.Query1.Prepare;
form1.query1.Open;
end;
end;
if (combobox1.Text='处理方式') then
begin
if form3.CheckBox2.Checked=true then
begin
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and cffs=:p3 and a.wfsj between :p1 and :p2 order by a.TZSHM ');
form1.query1.ParamByName('p3').AsString:=(form3.ComboBox3.Text);
form1.query1.ParamByName('p1').Value:=datetostr(form3.datetimepicker5.Date);
form1.query1.ParamByName('p2').Value:=datetostr(form3.datetimepicker6.Date);
form1.Query1.Prepare;
form1.query1.Open;
end
else
begin
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and cffs=:p3 order by a.TZSHM ');
form1.query1.ParamByName('p3').AsString:=(form3.ComboBox3.Text);
form1.Query1.Prepare;
form1.query1.Open;
end;
end;
if (combobox1.Text='材料情况') then
begin
if form3.CheckBox4.Checked=true then
begin
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and zlbc=:p3 and a.wfsj between :p1 and :p2 order by a.TZSHM ');
form1.query1.ParamByName('p3').AsString:=trim(form3.ComboBox4.Text);
form1.query1.ParamByName('p1').Value:=datetostr(form3.datetimepicker9.Date);
form1.query1.ParamByName('p2').Value:=datetostr(form3.datetimepicker10.Date);
form1.Query1.Prepare;
form1.query1.Open;
end
else
begin
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and zlbc=:p3 order by a.TZSHM ');
form1.query1.ParamByName('p3').AsString:=trim(form3.ComboBox4.Text);
form1.Query1.Prepare;
form1.query1.Open;
end;
end;
if (combobox1.Text='车牌号') then
begin
tmp:=trim(form3.ComboBox5.Text)+'-'+trim(form3.edit3.Text)+''''+' and b.cllx='''+trim(form3.ComboBox6.Text)+''''+' order by a.TZSHM ';
strsql:='select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and a.cphm='''+tmp;
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
form1.query1.SQL.Add(strsql);
form1.Query1.Prepare;
form1.query1.Open;
end ;
if (combobox1.Text='处罚情况') then
begin
if checkbox5.Checked=false then
begin
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and CFQR=:p3 order by a.TZSHM ');
if form3.RadioButton1.Checked=true then
form1.query1.ParamByName('p3').AsString:='Y';
if form3.RadioButton2.Checked=true then
form1.query1.ParamByName('p3').AsString:='N';
form1.Query1.Prepare;
form1.query1.Open;
end
else
begin
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and zfbm=:p4 and CFQR=:p3 order by a.TZSHM ');
if form3.RadioButton1.Checked=true then
form1.query1.ParamByName('p3').AsString:='Y';
if form3.RadioButton2.Checked=true then
form1.query1.ParamByName('p3').AsString:='N';
form1.Query1.ParamByName('p4').AsString:=combobox10.Text;
form1.Query1.Prepare;
form1.query1.Open;
end;
end ;
if (combobox1.Text='照片情况') then
begin
if checkbox6.Checked=false then
begin
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
if form3.ComboBox7.Text='有照片' then
begin
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and tpdz<>:p3 order by a.TZSHM ');
form1.query1.ParamByName('p3').AsString:='' ;
end
else
begin
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and tpdz=:p3 order by a.TZSHM ');
form1.query1.ParamByName('p3').AsString:='';
end;
form1.Query1.Prepare;
form1.query1.Open;
end
else
begin
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
if form3.ComboBox7.Text='有照片' then
begin
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and tpdz<>:p3 and a.wfsj between :p1 and :p2 order by a.TZSHM ');
form1.query1.ParamByName('p3').AsString:='';
end
else
begin
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and tpdz=:p3 and a.wfsj between :p1 and :p2 order by a.TZSHM ');
form1.query1.ParamByName('p3').AsString:='';
end ;
form1.query1.ParamByName('p1').Value:=datetostr(form3.datetimepicker11.Date);
form1.query1.ParamByName('p2').Value:=datetostr(form3.datetimepicker12.Date);
form1.Query1.Prepare;
form1.query1.Open;
end;
end ;
if (combobox1.Text='已启用司法程序') then
begin
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and sfbz=:p3 and a.wfsj between :p1 and :p2 order by a.TZSHM ');
form1.query1.ParamByName('p3').AsString:='Y';
form1.query1.ParamByName('p1').Value:=datetostr(form3.datetimepicker13.Date);
form1.query1.ParamByName('p2').Value:=datetostr(form3.datetimepicker14.Date);
form1.Query1.Prepare;
form1.query1.Open;
end;
if (combobox1.Text='未上报到法院') then
begin
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
form1.query1.SQL.Add('select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and cfqr='''+'N'+''''+' and sfbz='''+'N'+''''+' and zlbc='''+'完整'+''' and a.wfsj between :p1 and :p2 order by a.TZSHM ');
form1.query1.ParamByName('p1').Value:=datetostr(form3.datetimepicker13.Date);
form1.query1.ParamByName('p2').Value:=datetostr(form3.datetimepicker14.Date);
form1.Query1.Prepare;
form1.query1.Open;
end;
end;
procedure TForm3.CheckBox1Click(Sender: TObject);
begin
if form3.CheckBox1.Checked then
form3.GroupBox3.Visible:=true
else
form3.GroupBox3.Visible:=false;
end;
procedure TForm3.CheckBox2Click(Sender: TObject);
begin
if form3.CheckBox2.Checked then
form3.GroupBox4.Visible:=true
else
form3.GroupBox4.Visible:=false;
end;
procedure TForm3.Edit2KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
strsql:string;
begin
if edit2.Text='' then exit;
if form3.CheckBox3.Checked=true then
begin
strsql:='select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and WFDD like '''+'%'+trim(edit2.Text)+'%'+''' and a.wfsj between :p1 and :p2 order by a.TZSHM ';
end
else
begin
strsql:='select * from "wf_zl_info" a,"cl" b where a.clzl=b.clbm and WFDD like '''+'%'+trim(edit2.Text)+'%'+''' order by a.TZSHM ';
end;
form1.query1.Close;
form1.query1.SQL.Clear;
form1.Query1.UnPrepare;
form1.query1.SQL.Add(strsql);
if (form3.CheckBox3.Checked=true) then
begin
form1.Query1.Params.ParamByName('p1').Value:=datetostr(form3.datetimepicker7.Date);
form1.Query1.Params.ParamByName('p2').Value:=datetostr(form3.datetimepicker8.Date);
end;
form1.Query1.Prepare;
form1.query1.Open;
end;
procedure TForm3.CheckBox3Click(Sender: TObject);
begin
if form3.CheckBox3.Checked then
form3.GroupBox5.Visible:=true
else
form3.GroupBox5.Visible:=false;
end;
procedure TForm3.CheckBox4Click(Sender: TObject);
begin
if form3.CheckBox4.Checked then
form3.GroupBox6.Visible:=true
else
form3.GroupBox6.Visible:=false;
end;
procedure TForm3.ComboBox4Change(Sender: TObject);
begin
i:=0;
while i<combobox4.Items.Count do
begin
if combobox4.Text=combobox4.Items[i] then
break;
inc(i);
end;
if i>=combobox4.Items.Count then begin application.MessageBox('属性值选择不对','提示',mb_ok);combobox4.Text:=tmpp;combobox4.SetFocus;exit; end;
end;
procedure TForm3.ComboBox3Change(Sender: TObject);
begin
i:=0;
while i<combobox3.Items.Count do
begin
if combobox3.Text=combobox3.Items[i] then
break;
inc(i);
end;
if i>=combobox3.Items.Count then begin application.MessageBox('属性值选择不对','提示',mb_ok);combobox3.Text:=tmpp;combobox3.SetFocus;exit; end;
end;
procedure TForm3.ComboBox2Change(Sender: TObject);
begin
i:=0;
while i<combobox2.Items.Count do
begin
if combobox2.Text=combobox2.Items[i] then
break;
inc(i);
end;
if i>=combobox2.Items.Count then begin application.MessageBox('属性值选择不对','提示',mb_ok);combobox2.Text:=tmpp;combobox2.SetFocus;exit; end;
end;
procedure TForm3.ComboBox5Change(Sender: TObject);
begin
i:=0;
while i<combobox5.Items.Count do
begin
if combobox5.Text=combobox5.Items[i] then
break;
inc(i);
end;
if i>=combobox5.Items.Count then begin application.MessageBox('属性值选择不对','提示',mb_ok);combobox5.Text:=tmpp;combobox5.SetFocus;exit; end;
end;
procedure TForm3.ComboBox6Change(Sender: TObject);
begin
i:=0;
while i<combobox6.Items.Count do
begin
if combobox6.Text=combobox6.Items[i] then
break;
inc(i);
end;
if i>=combobox6.Items.Count then begin application.MessageBox('属性值选择不对','提示',mb_ok);combobox6.Text:=tmpp;combobox6.SetFocus;exit; end;
end;
procedure TForm3.SpeedButton4Click(Sender: TObject);
begin
OKBottomDlg1.showmodal;
end;
procedure TForm3.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if Form1.query1.Active=true then begin
if Form1.query1.FieldByName('scbz').AsString = 'N' then
if Form1.query1.FieldByName('CFQR').AsString = 'N' then
Form3.DBGrid1.Canvas.Brush.Color:=clSilver
else Form3.DBGrid1.Canvas.Brush.Color:=clSkyblue;
if Form1.query1.FieldByName('scbz').AsString = 'Y' then
if Form1.query1.FieldByName('CFQR').AsString = 'N' then
Form3.DBGrid1.Canvas.Brush.Color:=clyellow
else Form3.DBGrid1.Canvas.Brush.Color:=clwhite;
if Form1.query1.FieldByName('sfbz').AsString = 'Y' then
Form3.DBGrid1.Canvas.Brush.Color:=clred;
if Form1.query1.FieldByName('zlbc').AsString = '不全' then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -