D10xhGemei/A00通用方法/U_ProgressUpdate.pas

62 lines
1.3 KiB
ObjectPascal
Raw Normal View History

2025-06-27 17:30:04 +08:00
unit U_ProgressUpdate;
interface
uses
System.SysUtils, ADODB;
function TradeMarketProgressUpdate(AdoCmd: TADOQuery; MTMSIdS: string): Boolean;
function TradeMarketProgressUpdateByTMMID(AdoCmd: TADOQuery; MTMMID: string): Boolean;
implementation
function TradeMarketProgressUpdate(AdoCmd: TADOQuery; MTMSIdS: string): Boolean;
begin
with AdoCmd do
begin
close;
sql.Clear;
sql.Add('exec P_Trade_Market_UpOut');
sql.Add('@TMSIdS=' + quotedstr(Trim(MTMSIdS)));
Open;
end;
Result := True;
end;
function TradeMarketProgressUpdateByTMMID(AdoCmd: TADOQuery; MTMMID: string): Boolean;
var
MTMSIdS: string;
begin
with AdoCmd do
begin
close;
sql.Clear;
sql.Add('select distinct TMSId from Trade_Market_sub A ');
sql.Add('where EXISTS(select X.RTValue from [dbo].[F_Tool_SplitString](' + quotedstr(Trim(MTMMID)) + ','','') X where X.RTValue=A.TMSId ) ');
Open;
while not Eof do
begin
if Trim(MTMSIdS) = '' then
MTMSIdS := FieldByName('TMSId').AsString
else
MTMSIdS := MTMSIdS + ',' + FieldByName('TMSId').AsString;
end;
end;
with AdoCmd do
begin
close;
sql.Clear;
sql.Add('exec P_Trade_Market_UpOut');
sql.Add('@TMSIdS=' + quotedstr(Trim(MTMSIdS)));
Open;
end;
Result := True;
end;
end.