📄 unit_zishenpf.pas
字号:
+') order by a.dwbm_id';;}
adoquery.Open;
setcellsheet(cell1,adoquery.RecordCount,27);
adoquery.First;
for i:=0 to adoquery.RecordCount-1 do
begin
iPage:=i div 27;
irow:=i mod 27;
cell1.SetCellString(1,irow+6,ipage,adoquery.fieldbyname('dwbm_id').asstring);
cell1.SetCellString(2,irow+6,ipage,adoquery.fieldbyname('dw_name').asstring);
cell1.SetCellString(3,irow+6,ipage,adoquery.fieldbyname('wj2_duanshu').asstring);
cell1.SetCellString(4,irow+6,ipage,adoquery.fieldbyname('ys_caiwu').asstring);
cell1.SetCellString(5,irow+6,ipage,adoquery.fieldbyname('ys_jingyan').asstring);
cell1.SetCellString(6,irow+6,ipage,adoquery.fieldbyname('total').asstring);
cell1.SetCellString(7,irow+6,ipage,adoquery.fieldbyname('id').asstring);
adoquery.Next;
end;
adoquery.Open;
adoquery.close;
adoquery.SQL.Text:='drop table #bid_linshi';
adoquery.ExecSQL;
finally
freeandnil(adoquery);
end;
end;
procedure tfrm_zishenpf.loadZSpf110;
var
adoquery:tadoquery;
i:integer;
iPage,irow:Integer;
begin
adoquery:=tadoquery.Create(nil);
try
adoquery.Connection:=datamodule1.ADOMainConn;
datamodule1.ADOMainConn.BeginTrans;
try
adoquery.Close;
adoquery.SQL.Text:=' select identity(int,1,1) as id,a.dw_id into #bid_linshi from ( select top 500 a.dw_id from bid_wenjian2 a, '
+' bid_xmgczb b,bid_yushen_defen c where A.wj2_leixing=1 and a.wj2_leibie=c.bd_leibie and c.dw_id=a.dw_id and c.xmgczb_id=a.xmgczb_id '
//+' and a.wj2_qzx=1
+' and a.wj2_leibie='+trim(GetLeibie(com_leibie.Text))
+' and (c.ys_caiwu>=0 or c.ys_jishu>=0) and a.xmgczb_id=b.xmgczb_id AND xm_isbn='''
+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
+' and zblx_id='+xmbdgc.BDLX_ID+' order by (c.ys_caiwu+c.ys_jishu) DESC) a';
adoquery.ExecSQL;
datamodule1.ADOMainConn.CommitTrans;
except
datamodule1.ADOMainConn.RollbackTrans;
exit;
end;
adoquery.Close;
{if com_leibie.ItemIndex=0 then
adoquery.SQL.Text:=' select dwbm_Id,dw_name,wj2_duanshu,ys_caiwu,ys_jishu,total,id '
+' from (select dwbm_Id,a.dw_id,wj2_duanshu,ys_caiwu,ys_jishu,total,id from '
+' bid_wenjian2 a left join (select id,a.dw_id,ys_caiwu,ys_jishu,'
+' (ys_caiwu+ys_jishu) as total,xmgczb_Id from bid_yushen_defen a,#bid_linshi b'
+' where a.dw_id=b.dw_id) b on a.dw_id=b.dw_id and a.xmgczb_id=b.xmgczb_id '
+' where a.xmgczb_id in (select xmgczb_id from bid_xmgczb '
+' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID+' and zblx_id='
+xmbdgc.BDLX_ID+') and wj2_leixing=1) a,bid_danwei_xinxi b where a.dw_Id =b.dw_id order by dwbm_id '
else}
adoquery.SQL.Text:=' select dwbm_Id,dw_name,wj2_duanshu,ys_caiwu,ys_jishu,total,id '
+' from (select dwbm_Id,a.dw_id,wj2_duanshu,ys_caiwu,ys_jishu,total,id from '
+' bid_wenjian2 a left join (select id,a.dw_id,bd_leibie,ys_caiwu,ys_jishu,'
+' (ys_caiwu+ys_jishu) as total,xmgczb_Id from bid_yushen_defen a,#bid_linshi b'
+' where a.dw_id=b.dw_id) b on a.dw_id=b.dw_id and a.wj2_leibie=b.bd_leibie and a.xmgczb_id=b.xmgczb_id '
+' where wj2_leixing=1 and wj2_leibie='+trim(GetLeibie(com_leibie.Text))
+' and a.xmgczb_id in (select xmgczb_id from bid_xmgczb '
+' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID+' and zblx_id='
+xmbdgc.BDLX_ID+') and wj2_leixing=1) a,bid_danwei_xinxi b where a.dw_Id =b.dw_id order by dwbm_id' ;
{if com_leibie.ItemIndex=0 then
adoquery.SQL.Text:=' select a.dwbm_id,b.dw_name,a.wj2_duanshu,c.ys_caiwu,c.ys_jishu,(c.ys_caiwu+c.ys_jishu) as total,'
+' d.id from bid_wenjian2 a,bid_danwei_xinxi b,'
+' bid_yushen_defen c,#bid_linshi d where A.wj2_leixing=1 and a.dw_id=b.dw_ID AND a.dw_id=d.dw_id and a.dw_id=c.dw_id '
//+' and a.wj2_qzx=1
+' and a.xmgczb_id=c.xmgczb_id and a.xmgczb_id in (select xmgczb_id from bid_xmgczb '
+' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID+' and zblx_id='+xmbdgc.BDLX_ID
+') order by a.dwbm_id'
else
adoquery.SQL.Text:=' select a.dwbm_id,b.dw_name,a.wj2_duanshu,c.ys_caiwu,c.ys_jishu,(c.ys_caiwu+c.ys_jishu) as total,'
+' d.id from bid_wenjian2 a,bid_danwei_xinxi b,'
+' bid_yushen_defen c,#bid_linshi d where A.wj2_leixing=1 and a.dw_id=b.dw_ID AND a.dw_id=d.dw_id and a.dw_id=c.dw_id '
+' and a.wj2_leibie='+trim(inttostr(com_leibie.ItemIndex))
//+' and a.wj2_qzx=1
+' and a.xmgczb_id=c.xmgczb_id and a.xmgczb_id in (select xmgczb_id from bid_xmgczb '
+' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID+' and zblx_id='+xmbdgc.BDLX_ID
+') order by a.dwbm_id'; }
adoquery.Open;
setcellsheet(cell1,adoquery.RecordCount,27);
adoquery.First;
for i:=0 to adoquery.RecordCount-1 do
begin
iPage:=i div 27;
irow:=i mod 27;
cell1.SetCellString(1,irow+6,ipage,adoquery.fieldbyname('dwbm_id').asstring);
cell1.SetCellString(2,irow+6,ipage,adoquery.fieldbyname('dw_name').asstring);
cell1.SetCellString(3,irow+6,ipage,adoquery.fieldbyname('wj2_duanshu').asstring);
cell1.SetCellString(4,irow+6,ipage,adoquery.fieldbyname('ys_caiwu').asstring);
cell1.SetCellString(5,irow+6,ipage,adoquery.fieldbyname('ys_jishu').asstring);
cell1.SetCellString(6,irow+6,ipage,adoquery.fieldbyname('total').asstring);
cell1.SetCellString(7,irow+6,ipage,adoquery.fieldbyname('id').asstring);
adoquery.Next;
end;
adoquery.close;
adoquery.SQL.Text:='drop table #bid_linshi';
adoquery.ExecSQL;
finally
freeandnil(adoquery);
end;
end;
procedure tfrm_zishenpf.loadZSpf111;
var
adoquery:tadoquery;
caiwu,jishu,jingyan,zuidi:Integer;
i,j:integer;
iPage,irow:Integer;
bTongguo:boolean;
begin
// 获得参数
adoquery:=tadoquery.Create(nil);
try
adoquery.Close;
adoquery.Connection:=datamodule1.ADOMainConn;
adoquery.SQL.Text:='select isnull(cs_jishu_hege,0) as jishu,isnull(cs_jingyan_hege,0) as jingyan,'
+'isnull(cs_caiwu_hege,0) as caiwu,isnull(cs_zuidixian,0) as zuidi from bid_canshu_save'
+' where xmgczb_id in (select xmgczb_id from bid_xmgczb '
+' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID+' and zblx_id='
+xmbdgc.BDLX_ID+')';
adoquery.Open;
try
caiwu:=adoquery.fieldbyname('caiwu').AsInteger;
jishu:=adoquery.fieldbyname('jishu').AsInteger;
jingyan:=adoquery.fieldbyname('jingyan').AsInteger;
zuidi:=adoquery.fieldbyname('zuidi').AsInteger;
except //不存在,为0
caiwu:=0;
jishu:=0;
jingyan:=0;
zuidi:=0;
end;
finally
freeandnil(adoquery);
end;
adoquery:=tadoquery.Create(nil);
try
adoquery.Connection:=datamodule1.ADOMainConn;
datamodule1.ADOMainConn.BeginTrans;
try
adoquery.Close;
adoquery.SQL.Text:=' select identity(int,1,1) as id,a.dw_id into #bid_linshi from (select top 500 a.dw_id from bid_wenjian2 a, '
+' bid_xmgczb b,bid_yushen_defen c where A.wj2_leixing=1 and a.wj2_leibie=c.bd_leibie and c.dw_id=a.dw_id and c.xmgczb_id=a.xmgczb_id '
//+' and a.wj2_qzx=1
+' and a.wj2_leibie='+trim(GetLeibie(com_leibie.Text))
+' and (c.ys_caiwu>=0 or c.ys_jishu>=0 or c.ys_jingyan>=0) and a.xmgczb_id=b.xmgczb_id '
+' AND xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
+' and zblx_id='+xmbdgc.BDLX_ID+' order by (c.ys_caiwu+c.ys_jishu+c.ys_jingyan) DESC) a';
adoquery.ExecSQL;
datamodule1.ADOMainConn.CommitTrans;
except
datamodule1.ADOMainConn.RollbackTrans;
exit;
end;
adoquery.close;
{if com_leibie.ItemIndex=0 then
adoquery.SQL.Text:=' select dwbm_Id,dw_name,wj2_duanshu,ys_caiwu,ys_jishu,ys_jingyan,total,id '
+' from (select dwbm_Id,a.dw_id,wj2_duanshu,ys_caiwu,ys_jishu,ys_jingyan,total,id from '
+' bid_wenjian2 a left join (select id,a.dw_id,ys_caiwu,ys_jishu,ys_jingyan,'
+' (ys_caiwu+ys_jishu+ys_jingyan) as total,xmgczb_Id from bid_yushen_defen a,#bid_linshi b'
+' where a.dw_id=b.dw_id) b on a.dw_id=b.dw_id and a.xmgczb_id=b.xmgczb_id '
+' where a.xmgczb_id in (select xmgczb_id from bid_xmgczb '
+' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID+' and zblx_id='
+xmbdgc.BDLX_ID+') and wj2_leixing=1) a,bid_danwei_xinxi b where a.dw_Id =b.dw_id order by dwbm_id '
{' select a.dwbm_id,b.dw_name,a.wj2_duanshu,c.ys_caiwu,c.ys_jishu,c.ys_jingyan,(c.ys_caiwu+c.ys_jishu+c.ys_jingyan) '
+' as total, d.id from bid_wenjian2 a,bid_danwei_xinxi b,'
+' bid_yushen_defen c,#bid_linshi d where A.wj2_leixing=1 and a.dw_id=b.dw_ID AND a.dw_id=d.dw_id and a.dw_id=c.dw_id '
//+' and a.wj2_qzx=1
+' and a.xmgczb_id=c.xmgczb_id and a.xmgczb_id in (select xmgczb_id from bid_xmgczb '
+' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID+' and zblx_id='+xmbdgc.BDLX_ID
+') order by a.dwbm_id'
else}
adoquery.SQL.Text:=' select dwbm_Id,dw_name,wj2_duanshu,ys_caiwu,ys_jishu,ys_jingyan,total,id '
+' from (select dwbm_Id,a.dw_id,wj2_duanshu,ys_caiwu,ys_jishu,ys_jingyan,total,id from '
+' bid_wenjian2 a left join (select id,a.dw_id,bd_leibie,ys_caiwu,ys_jishu,ys_jingyan,'
+' (ys_caiwu+ys_jishu+ys_jingyan) as total,xmgczb_Id from bid_yushen_defen a,#bid_linshi b'
+' where a.dw_id=b.dw_id) b on a.dw_id=b.dw_id and a.wj2_leibie=b.bd_leibie and a.xmgczb_id=b.xmgczb_id '
+' where wj2_leixing=1 and wj2_leibie='+trim(GetLeiBie(com_leibie.Text))
+' and a.xmgczb_id in (select xmgczb_id from bid_xmgczb '
+' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID+' and zblx_id='
+xmbdgc.BDLX_ID+') and wj2_leixing=1) a,bid_danwei_xinxi b where a.dw_Id =b.dw_id order by dwbm_id' ;
{' select a.dwbm_id,b.dw_name,a.wj2_duanshu,c.ys_caiwu,c.ys_jishu,c.ys_jingyan,(c.ys_caiwu+c.ys_jishu+c.ys_jingyan) '
+' as total, d.id from bid_wenjian2 a,bid_danwei_xinxi b,'
+' bid_yushen_defen c,#bid_linshi d where A.wj2_leixing=1 and a.dw_id=b.dw_ID AND a.dw_id=d.dw_id and a.dw_id=c.dw_id '
+' and a.wj2_leibie='+trim(inttostr(com_leibie.ItemIndex))
//+' and a.wj2_qzx=1
+' and a.xmgczb_id=c.xmgczb_id and a.xmgczb_id in (select xmgczb_id from bid_xmgczb '
+' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID+' and zblx_id='+xmbdgc.BDLX_ID
+') order by a.dwbm_id'; }
adoquery.Open;
setcellsheet(cell1,adoquery.RecordCount,27);
adoquery.First;
for i:=0 to adoquery.RecordCount-1 do
begin
iPage:=i div 27;
irow:=i mod 27;
cell1.SetCellString(1,irow+6,ipage,adoquery.fieldbyname('dwbm_id').asstring);
cell1.SetCellString(2,irow+6,ipage,adoquery.fieldbyname('dw_name').asstring);
cell1.SetCellString(3,irow+6,ipage,adoquery.fieldbyname('wj2_duanshu').asstring);
cell1.SetCellString(4,irow+6,ipage,adoquery.fieldbyname('ys_caiwu').asstring);
cell1.SetCellString(5,irow+6,ipage,adoquery.fieldbyname('ys_jishu').asstring);
cell1.SetCellString(6,irow+6,ipage,adoquery.fieldbyname('ys_jingyan').asstring);
cell1.SetCellString(7,irow+6,ipage,adoquery.fieldbyname('total').asstring);
cell1.SetCellString(8,irow+6,ipage,adoquery.fieldbyname('id').asstring);
//设置未通过资格预审人的颜色
btongguo:=false;
if ((adoquery.fieldbyname('ys_caiwu').asstring<>'') and (adoquery.fieldbyname('ys_caiwu').AsInteger<caiwu)) then
begin
cell1.setcelltextcolor(4,irow+6,ipage,CELL1.FindColorIndex(colortorgb(clred),1));
btongguo:=true;
end;
if ((adoquery.fieldbyname('ys_jishu').asstring<>'') and (adoquery.fieldbyname('ys_jishu').AsInteger<jishu)) then
begin
cell1.setcelltextcolor(5,irow+6,ipage,CELL1.FindColorIndex(colortorgb(clred),1));
btongguo:=true;
end;
if ((adoquery.fieldbyname('ys_jingyan').asstring<>'') and (adoquery.fieldbyname('ys_jingyan').AsInteger<jingyan)) then
begin
cell1.setcelltextcolor(6,irow+6,ipage,CELL1.FindColorIndex(colortorgb(clred),1));
btongguo:=true;
end;
if ((adoquery.fieldbyname('total').asstring<>'') and (adoquery.fieldbyname('total').AsInteger<zuidi)) then
begin
cell1.setcelltextcolor(7,irow+6,ipage,CELL1.FindColorIndex(colortorgb(clred),1));
btongguo:=true;
end;
if btongguo=true then
begin
cell1.setcelltextcolor(2,irow+6,ipage,CELL1.FindColorIndex(colortorgb(clred),1));
end;
adoquery.Next;
end;
adoquery.close;
adoquery.SQL.Text:='drop table #bid_linshi';
adoquery.ExecSQL;
finally
freeandnil(adoquery);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -