加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
datamodule.pas 127.29 KB
一键复制 编辑 原始数据 按行查看 历史
JiangXiaoDong 提交于 2021-10-07 11:36 . init
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855
unit datamodule;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, ZConnection, ZDataset, fpjson, jsonparser, contnrs, base64;
type
//URL记录
TnkUrlItem = record
pkey:string[255];
proot:string[255];
purl:string[255];
end;
PnkUrlItem = ^TnkUrlItem;
//自定义页面按钮
TnkPage = record
id:integer;
caption:string[255];
url:string[255];
Flag:integer;
end;
//脚本记录
TnkScript = record
Mode:string;
Kind:string;
Caption:string;
Url:string;
Script:string;
end;
//定点机构实时监控对象
TnkHisWatcher = record
tag:integer;
caption:string;
user:string;
pwd:String;
page:integer;
end;
//URL管理对象
{ TnkUrls }
TnkUrls = class(TComponent)
private
FList:TList;
function GetCount: integer;
public
constructor Create(AOwner:TComponent);override;
destructor Destroy; Override;
procedure Clear;//清除所有项目
procedure Add(AKey, ARoot, AUrl:string);//增加新项目
function IndexOf(AKey:string):integer;//根据Key查找记录
function Item(AIndex:integer):TnkUrlItem;//根据下标返回记录
published
property Count:integer read GetCount;
end;
//分析报告对象
{ TnkReport }
TnkReport = class(TComponent)
private
FCMonth: integer;
FCyear: integer;
FTipsCount: integer;
FTitle: string;
FWarningCount: integer;
FWarningJson:TJsonObject;
FTipsJson:TJsonObject;
FDetailJson:TJsonObject;
function GetDetail: string;
function GetTips: string;
function GetWarning: string;
public
constructor Create(AOwner:TComponent);override;
destructor Destroy;override;
procedure AddWarning(AKey,AValue:string);
procedure AddTips(AKey, AValue:string);
procedure AddDetail(AKey, AValue:string);
procedure AddDetail(AKey:string;AJson:TJsonObject);overload;
function WarningKey(AIndex:integer):string;
function WarningValue(AIndex:integer):string;
function TipsKey(AIndex:integer):string;
function TipsValue(AIndex:integer):string;
function WarningLength:integer;
function TipsLength:integer;
published
property CYear:integer read FCyear write FCyear;
property CMonth:integer read FCMonth write FCMonth;
property TipsCount:integer read FTipsCount write FTipsCount; //提示数量
property WarningCount:integer read FWarningCount write FWarningCount; //风险点数量
property Title:string read FTitle write FTitle;//报告标题
property Warning:string read GetWarning;
property Tips:string read GetTips;
property Detail:string read GetDetail;
end;
//慢性病编码及医院编码对照对象
{ TnkManbingBianmaItem }
TnkManbingBianmaItem = class(TComponent)
private
FCode: string;
FLevel: string;
FList:TStrings;
function GetHospital: TStrings;
procedure SetHospital(AValue: TStrings);
public
constructor Create(AOwner:TComponent);override;
destructor Destroy;override;
published
property Code:string read FCode write FCode;//疾病编码
property Level:string read FLevel write FLevel;//级别编码
property Hospital:TStrings read GetHospital write SetHospital;//对应的医院编码列表
end;
TnkManbingBianma = class(TComponent)
private
FList:TObjectList;
function GetCount: integer;
public
constructor Create(AOwner:TComponent);override;
destructor Destroy;override;
procedure Clear;//清除全部
function Add(AItem:TnkManbingBianmaItem):integer;//添加编码
function Item(AIndex:integer):TnkManbingBianmaItem;
function Check(ACode,AHospital:string):integer;//对比疾病编码和医院编码,返回错误码
property Count:integer read GetCount;
end;
{ Tdm }
Tdm = class(TDataModule)
conn: TZConnection;
innerqryWork: TZQuery;
pubqry: TZQuery;
innerqry: TZQuery;
connWork: TZConnection;
pubqryWork: TZQuery;
procedure DataModuleCreate(Sender: TObject);
procedure DataModuleDestroy(Sender: TObject);
private
public
Platform:string;
Urls:TnkUrls;
Pages:array of TnkPage;//自定义屏页面
Scripts:array of TnkScript;//自定义脚本
HisWatcher:array of TnkHisWatcher;//定点医药机构实时监控
HisWatcherTag:integer;//用于注入时的状态机变量
JuWatchUser, JuWatchPwd:string;//医保局实时监控用户名和密码
isAdmin:integer;//是否管理员
procedure FillPages;//填充自定义监控大屏页面
procedure FillScripts;//填充自定义脚本
procedure FillManbingBianma(AManbingTable,AHospitalTable:string;AObject:TnkManbingBianma;AWS:boolean=True);//填充慢病编码对象
procedure LoadUrls;//载入URLS表
procedure DeleteHuabo(AYear,AMonth:integer;AWS:boolean=True);//删除指定年月的划拨数据
procedure InsertHuabo(AYear,AMonth:integer;A0,A1,A2,A3,A4,A5,A6:string;A7:double;A8,A9,A10,A11,A12,A13,A14:string;AChecked:boolean=False;AWS:boolean=True);//保存划拨数据
procedure DeleteSiwang(AYear, AMonth:integer;AWS:boolean=True);//删除指定年月的死亡数据
procedure InsertSiwang(AYear, AMonth:integer; A0:TDate; A1, A2, A3:string;AWS:boolean=True);//保存死亡数据
function GetSiwangDate(AID:string;var ADate:TDate;AWS:boolean=True):boolean;//获取指定身份证号的死亡日期
procedure SaveHuaboFx(AR:TnkReport;ADelete:boolean;AShortKind:string='');//保存个人账户划拨风险分析报告
{保存风险点主子表}
function GenerateID:string;//生成唯一标识号
procedure SaveFx(AR:TnkReport;ADelete:boolean;AShortKind:string='';AWS:boolean=True);//调用参数同SaveHuaboFx,但存储表为FxMaster和FxDetail
procedure SaveImportLog(AKind:string;AYear,AMonth:integer;ASource,ADispFile:string;ACount:integer;AWS:boolean=True);//保存导入日志
procedure UpdateRecordCount(AIncCount:integer);//在Stat表中增加recordCount数量
procedure SaveAnalLog(AKind:string;AYear,AMonth,AWarningCount,ATipsCount:integer;AWS:boolean=True);//保存风险分析日志
procedure InsertDanwei(cyear, cmonth:integer;c0,c1,c2,c3,c4,c5,c6,c7,c8,c9:string;c10,c11:TDate;c12:double;c13,c14,c15,c16,c17:integer;c18,c19,c20,c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,c31,c32,c33,c34,c35,c36,c37,c38,c39,c40,c41:string;Check:boolean;AWS:boolean=True);//保存单位信息表
procedure DeleteDanwei(AYear, AMonth:integer;AWS:boolean=True);//删除单位信息记录
procedure DeleteZhuxiao(AYear, AMonth:integer;AWS:boolean=True);//删除企业注销名单
procedure InsertZhuxiao(cyear, cmonth:integer; c0,c1,c2,c3,c4,c5,c6,c7:string;c8:TDate;c9,c10:string;c11:TDate;check:boolean;AWS:boolean=True);//保存企业注销名单
procedure InsertXuesheng(cyear, cmonth:integer; c0,c1,c2:string;c3:TDate;c4,c5,c6,c7,c8:string;c9:TDate;c10,c11:string;c12:integer;c13,c14,c15:double;check:boolean;AWS:boolean=True);//保存学生参保名单
procedure DeleteXueSheng(AYear, AMonth:integer;AWS:boolean=True);//删除学生登记表
procedure InsertBujiao(cyear,cmonth:integer;c0,c1,c2,c3,c4,c5,c6,c7,c8:string;c9:TDate;c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27,c28:double;c29,c30,c31:string;check:boolean;AWS:boolean=True);//保存职工医疗保险补缴表
procedure InsertZhuanchu(cyear,cmonth:integer;c0,c1,c2,c3,c4,c5,c6,c7:string;c8:double;c9,c10,c11,c12:String;c13:TDate;c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27:string;check:boolean; AWS:boolean=True);//保存职工医疗保险转出名单表
procedure InsertJumin(cyear,cMonth:integer;c0,c1,c2:string;c3:TDate;c4,c5,c6,c7,c8:string;c9:TDate;c10,c11:string;c12:integer;c13,c14,c15:double;check:boolean; AWS:boolean=True);//保存居民医疗保险参保人员名单表
procedure InsertGaoxueya(cyear,cmonth:integer;c0,c1,c2,c3,c4,c5,c6:string;c7,c8:TDate;check:boolean; AWS:boolean=True);//保存高血压、糖尿病办理登记表
procedure InsertManxingbing(cyear,cmonth:integer;c0,c1,c2,c3,c4,c5,c6,c7,c8,c9:string;c10,c11:TDate;c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22:string;check:boolean; AWS:boolean=True);//居民慢性病办理名单表存
procedure InsertZhigongManxingbing(cyear,cmonth:integer;c0,c1,c2,c3,c4,c5,c6,c7,c8,c9:string;c10,c11:TDate;c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24:string;check:boolean; AWS:boolean=True);//职工慢性病办理名单表存
procedure InsertManbingBianma(cyear,cmonth:integer;c0,c1,c2,c3:string;check:boolean; AWS:boolean=True);//保存居民慢性名称和编码
procedure InsertZhigongManbingBianma(cyear,cmonth:integer;c0,c1,c2:string;check:boolean; AWS:boolean=True);//保存职工慢性名称和编码
procedure InsertYiyuanBianma(cyear,cmonth:integer;c0,c1,c2,c3:string;check:boolean; AWS:boolean=True);//保存定点医疗机构名称编码级别对应表
procedure InsertZhigong(cyear,cMonth:integer;c0,c1,c2,c3,c4:string;c5:TDate;c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17:string;check:boolean;AWS:boolean=True);//保存参保职工名单
procedure DeleteZhigong(AYear, AMonth:integer;AWS:boolean=True);//删除参保职工名单
procedure DeleteYiyuanBianma(AYear, AMonth:integer;AWS:boolean=True);//删除定点医疗机构名称编码级别对应表
procedure DeleteManbingBianma(AYear, AMonth:integer;AWS:boolean=True);//删除居民慢性病名称和编码
procedure DeleteZhigongManbingBianma(AYear, AMonth:integer;AWS:boolean=True);//删除职工慢性病名称和编码
procedure DeleteBujiao(AYear, AMonth:integer;AWS:boolean=True);//删除职工医疗保险补缴表
procedure DeleteZhuanchu(AYear, AMonth:integer;AWS:boolean=True);//删除职工医疗保险转出名单表
procedure DeleteJumin(AYear,AMonth:integer;AWS:boolean=True);//删除居民医疗保险参保人员名单表
procedure DeleteGaoxueya(AYear, AMonth:integer;AWS:boolean=True);//删除高血压、糖尿病办理登记表
procedure DeleteManxingbing(AYear, AMonth:integer;AWS:boolean=True);//删除居民慢性病办理名单表
procedure DeleteZhigongManxingbing(AYear, AMonth:integer;AWS:boolean=True);//删除职工慢性病办理名单表
procedure ResetTable(ATable:string;AWS:boolean=True);//复位数据,删除表内全部数据
procedure ResetBigData;//复位Stat Stat_detail表
procedure UpdateAnalCount;//更新Stat表中analcount数量
function RemovePercent(AText:string):string;//去除百分号
function CheckIDCardNumber(IdCode : AnsiString): boolean; //获取身份证校验码
end;
var
dm: Tdm;
implementation
{$R *.frm}
{ TnkManbingBianma }
function TnkManbingBianma.GetCount: integer;
begin
Result:=FList.Count;
end;
constructor TnkManbingBianma.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FList:=TObjectList.Create(True);
end;
destructor TnkManbingBianma.Destroy;
begin
Clear;
FList.Free;
inherited Destroy;
end;
procedure TnkManbingBianma.Clear;
var
i:integer;
begin
if FList.Count=0 then Exit;
for i:=FList.Count-1 downto 0 do
begin
FList.Delete(i);
end;
FList.Clear;
end;
function TnkManbingBianma.Add(AItem:TnkManbingBianmaItem):integer;
begin
Result:=FList.Add(AItem);
end;
function TnkManbingBianma.Item(AIndex: integer): TnkManbingBianmaItem;
begin
Result:=(FList.Items[Aindex] as TnkManbingBianmaItem);
end;
function TnkManbingBianma.Check(ACode, AHospital: string): integer;
var
i,j:integer;
mm:boolean;
mCodeIndex:integer;
mItem:TnkManbingBianmaItem;
begin
//对比疾病编码和医院编码,返回错误码,0表示无错
mcodeIndex:=-1;
for i:=0 to Self.Count-1 do
begin
if Pos(Self.Item(i).Code,ACode)>0 then //疾病双编码
begin
mCodeIndex:=i;
Break;
end;
end;
if mCodeIndex=-1 then
begin
Result:=1;//没有找到疾病编码
Exit;
end
else
begin
mItem:=Self.Item(mCodeIndex);
// if mItem.Hospital.IndexOf(Ahospital)=-1 then
mm:=False;
for j:=0 to mItem.Hospital.Count-1 do
begin
if Pos(mItem.Hospital.Strings[j], AHospital)>0 then
begin
mm:=True;
Break;
end;
end;
//if mItem.Hospital.IndexOf(Ahospital)=-1 then
if mm=False then
begin
Result:=2;//没有找到医院编码
Exit;
end
else
begin
Result:=0;
end;
end;
end;
{ TnkManbingBianmaItem }
function TnkManbingBianmaItem.GetHospital: TStrings;
begin
Result:=FList;
end;
procedure TnkManbingBianmaItem.SetHospital(AValue: TStrings);
begin
FList.Assign(AValue);
end;
constructor TnkManbingBianmaItem.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FList:=TStringList.Create;
end;
destructor TnkManbingBianmaItem.Destroy;
begin
FList.Free;
inherited Destroy;
end;
{ TnkReport }
function Tdm.CheckIDCardNumber(IdCode : AnsiString): boolean;
const
WI: array[0..16] of Integer = (7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
VC: array[0..10] of AnsiChar = ('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
var
P: PAnsiChar;
I, S: Integer;
begin
Result := False;
if Length(IdCode) <> 18 then Exit;
P := PAnsiChar(IdCode);
S := 0;
for I := 0 to 16 do
S := S + (Ord(P[I]) - $30) * WI[I];
S := S mod 11;
Result := P[17] = VC[S];
end;
function TnkReport.GetTips: string;
begin
Result:=FTipsJson.AsJSON;
end;
function TnkReport.GetDetail: string;
begin
Result:=FDetailJson.AsJSON;
end;
function TnkReport.GetWarning: string;
begin
Result:=FWarningJson.AsJSON;
end;
constructor TnkReport.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FWarningJson:=TJsonObject.Create;
FTipsJson:=TJsonObject.Create;
FDetailJson:=TJsonObject.Create;
end;
destructor TnkReport.Destroy;
begin
FWarningJson.Free;
FTipsJson.Free;
FDetailJson.Free;
inherited Destroy;
end;
procedure TnkReport.AddWarning(AKey, AValue: string);
begin
FWarningJson.Add(AKey,AValue);
end;
procedure TnkReport.AddTips(AKey, AValue: string);
begin
FTipsJson.Add(AKey, AValue);
end;
procedure TnkReport.AddDetail(AKey, AValue: string);
begin
FDetailJson.Add(AKey, AValue);
end;
procedure TnkReport.AddDetail(AKey: string; AJson: TJsonObject);
begin
FDetailJson.Add(AKey, AJson);
end;
function TnkReport.WarningKey(AIndex: integer): string;
begin
Result:=FWarningJson.Names[AIndex];
end;
function TnkReport.WarningValue(AIndex: integer): string;
begin
Result:=FWarningJson.Items[AIndex].AsString;
end;
function TnkReport.TipsKey(AIndex: integer): string;
begin
Result:=FTipsJson.Names[AIndex];
end;
function TnkReport.TipsValue(AIndex: integer): string;
begin
Result:=FTipsJson.Items[AIndex].AsString;
end;
function TnkReport.WarningLength: integer;
begin
Result:=FWarningJson.Count;
end;
function TnkReport.TipsLength: integer;
begin
Result:=FTipsJson.Count;
end;
{ TnkUrls }
function TnkUrls.GetCount: integer;
begin
Result:=FList.Count;
end;
constructor TnkUrls.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FList:=TList.Create;
end;
destructor TnkUrls.Destroy;
begin
Clear;
FList.Free;
inherited Destroy;
end;
procedure TnkUrls.Clear;
var
i:integer;
begin
for i :=0 to FList.Count-1 do
begin
Dispose(PnkUrlItem(FList.Items[i]));
end;
FList.Clear;
end;
procedure TnkUrls.Add(AKey, ARoot, AUrl:string);
var
m:PnkUrlItem;
begin
new(m);
m^.pkey:=AKey;
m^.proot:=ARoot;
m^.purl:=AUrl;
FList.Add(m);
end;
function TnkUrls.IndexOf(AKey: string): integer;
var
i:integer;
begin
Result:=-1;
for i:=0 to FList.Count-1 do
begin
if PnkUrlItem(FList.Items[i])^.pkey=AKey then
begin
Result:=i;
Break;
end;
end;
end;
function TnkUrls.Item(AIndex: integer): TnkUrlItem;
var
m:PnkUrlItem;
begin
if (AIndex>=0) and (AIndex<FList.Count) then
begin
Result.pkey:=PnkUrlItem(FList.Items[AIndex])^.pkey;
Result.proot:=PnkUrlItem(FList.Items[AIndex])^.proot;
Result.purl:=PnkUrlItem(FList.Items[AIndex])^.purl;
end;
end;
{ Tdm }
procedure Tdm.DataModuleCreate(Sender: TObject);
begin
Urls:=TnkUrls.Create(Self);
end;
procedure Tdm.DataModuleDestroy(Sender: TObject);
begin
Urls.Free;
end;
procedure Tdm.FillPages;
var
i:integer;
begin
with pubqry do
begin
Close;
Sql.Clear;
Sql.Add('select * from pages order by id');
Open;
SetLength(Pages,RecordCount);
i:=0;
First;
while not Eof do
begin
Pages[i].caption:=FieldByName('caption').AsString;
Pages[i].url:=FieldByName('url').AsString;
Pages[i].id:=FieldByName('id').AsInteger;
i:=i+1;
Next;
end;
end;
end;
procedure Tdm.FillScripts;
var
i:integer;
begin
with pubQry do
begin
Close;
Sql.Clear;
Sql.Add('select * from scripts order by id');
Open;
SetLength(Scripts, RecordCount);
i:=0;
while not Eof do
begin
Scripts[i].Kind:=FieldByName('kind').AsString;
Scripts[i].Caption:=FieldByName('caption').AsString;
Scripts[i].Url:=FieldByName('url').AsString;
Scripts[i].Script:=DecodeStringBase64(FieldByName('script').AsString);
i:=i+1;
Next;
end;
end;
end;
procedure Tdm.FillManbingBianma(AManbingTable, AHospitalTable: string;
AObject: TnkManbingBianma; AWS: boolean);
var
mQuery:TZQuery;
mItem:TnkManbingBianmaItem;
procedure FillHospital(ALevel:string;AHosCode:string);
var
j:integer;
mItem2:TnkManbingBianmaItem;
begin
for j:=0 to AObject.Count-1 do
begin
mItem2:=AObject.Item(j);
if (Trim(mItem.Level)='') or (Pos('一级及以上', mItem.Level)>0) then
begin
//一级及以上
if (ALevel='1') or (ALevel='2') or (ALevel='3') then
mItem2.Hospital.Add(AHosCode);
end
else
if Pos('二级及以下', mItem.Level)>0 then
begin
//二级及以下
if (ALevel='1') or (ALevel='2') then
mItem2.Hospital.Add(AHosCode);
end;
end;
end;
begin
if AWS=False then
mQuery:=InnerQry
else
mQuery:=InnerQryWork;
AObject.Clear;
//先填充疾病编码
with mQuery do
begin
Close;
Sql.Clear;
Sql.Add('select * from '+AManBingTable);
Open;
First;
while not Eof do
begin
mItem:=TnkManbingBianmaItem.Create(nil);
mItem.Code:=Trim(FieldByName('c1').AsString);
mItem.Level:=Trim(FieldByName('c3').AsString);
AObject.Add(mItem);
//特殊处理病种
if Pos(mItem.Code,'N0010,N0021,N0030,N0032')>0 then
begin
mItem.Hospital.Add('070021');//潍坊市第二人民医院编码,待修改
end;
Next;
end;
end;
//填充医院对应的编码
with mQuery do
begin
Close;
Sql.Clear;
Sql.Add('select * from '+AHospitalTable);
Open;
First;
while not Eof do
begin
FillHospital(Trim(FieldByName('c3').AsString),Trim(FieldByName('c1').AsString));
Next;
end;
end;
end;
procedure Tdm.LoadUrls;
begin
Urls.Clear;
with pubQry do
begin
Close;
Sql.Clear;
Sql.Add('select * from urls');
Open;
First;
while not Eof do
begin
Urls.Add(FieldByName('pkey').AsString,FieldByName('proot').AsString,FieldByName('purl').AsString);
Next;
end;
end;
end;
procedure Tdm.DeleteHuabo(AYear, AMonth: integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from huabo where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from huabo where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.InsertHuabo(AYear, AMonth: integer; A0, A1, A2, A3, A4, A5,
A6: string; A7: double; A8, A9, A10, A11, A12, A13, A14: string;AChecked:boolean=False;AWS:boolean=True);
var
mFlag:boolean;
begin
mFlag:=False;
if AChecked then
begin
//检查是否存在相同年月、相同社保号码、医疗账户号、卡号和银行账号的划拨记录,如果存在则跳过,否则插入
{if AWS=False then
begin
with pubqry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from huabo where cyear=:cyear and cmonth=:cmonth and c0=:c0 and c4=:c4 and c5=:c5 and c6=:c6');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
Params.ParamByName('c0').AsString:=A0;
Params.ParamByName('c4').AsString:=A4;
Params.ParamByName('c5').AsString:=A5;
Params.ParamByName('c6').AsString:=A6;
Open;
First;
if FieldByName('aa').AsInteger>0 then
mFlag:=True;
end;
end
else
begin
with pubqryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from huabo where cyear=:cyear and cmonth=:cmonth and c0=:c0 and c4=:c4 and c5=:c5 and c6=:c6');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
Params.ParamByName('c0').AsString:=A0;
Params.ParamByName('c4').AsString:=A4;
Params.ParamByName('c5').AsString:=A5;
Params.ParamByName('c6').AsString:=A6;
Open;
First;
if FieldByName('aa').AsInteger>0 then
mFlag:=True;
end;
end; }
end;
//if mFlag=False then
if 1=1 then
begin
if AWS=False then
begin
with pubqry do
begin
Close;
Sql.Clear;
Sql.Add('insert into huabo (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14)');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
Params.ParamByName('c0').AsString:=A0;
Params.ParamByName('c1').AsString:=A1;
Params.ParamByName('c2').AsString:=A2;
Params.ParamByName('c3').AsString:=A3;
Params.ParamByName('c4').AsString:=A4;
Params.ParamByName('c5').AsString:=A5;
Params.ParamByName('c6').AsString:=A6;
Params.ParamByName('c7').AsFloat:=A7;
Params.ParamByName('c8').AsString:=A8;
Params.ParamByName('c9').AsString:=A9;
Params.ParamByName('c10').AsString:=A10;
Params.ParamByName('c11').AsString:=A11;
Params.ParamByName('c12').AsString:=A12;
Params.ParamByName('c13').AsString:=A13;
Params.ParamByName('c14').AsString:=A14;
ExecSQL;
end;
end
else
begin
with pubqryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into huabo (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14)');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
Params.ParamByName('c0').AsString:=A0;
Params.ParamByName('c1').AsString:=A1;
Params.ParamByName('c2').AsString:=A2;
Params.ParamByName('c3').AsString:=A3;
Params.ParamByName('c4').AsString:=A4;
Params.ParamByName('c5').AsString:=A5;
Params.ParamByName('c6').AsString:=A6;
Params.ParamByName('c7').AsFloat:=A7;
Params.ParamByName('c8').AsString:=A8;
Params.ParamByName('c9').AsString:=A9;
Params.ParamByName('c10').AsString:=A10;
Params.ParamByName('c11').AsString:=A11;
Params.ParamByName('c12').AsString:=A12;
Params.ParamByName('c13').AsString:=A13;
Params.ParamByName('c14').AsString:=A14;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.DeleteSiwang(AYear, AMonth: integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from siwang where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from siwang where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.InsertSiwang(AYear, AMonth: integer; A0: TDate; A1, A2,
A3: string; AWS:boolean=True);
var
mFlag:boolean;
begin
mFlag:=False;
if True then
begin
//检查是否存在火化日期、相同证件号码的记录,如果存在则跳过,否则插入
if AWS=False then
begin
with pubqry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from Siwang where c0=:c0 and c2=:c2');
Params.ParamByName('c0').AsDate:=A0;
Params.ParamByName('c2').AsString:=A2;
Open;
First;
if FieldByName('aa').AsInteger>0 then
mFlag:=True;
end;
end
else
begin
with pubqryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from Siwang where c0=:c0 and c2=:c2');
Params.ParamByName('c0').AsDate:=A0;
Params.ParamByName('c2').AsString:=A2;
Open;
First;
if FieldByName('aa').AsInteger>0 then
mFlag:=True;
end;
end;
end;
if mFlag=False then
begin
if AWS=False then
begin
with pubqry do
begin
Close;
Sql.Clear;
Sql.Add('insert into siwang (cyear,cmonth,c0,c1,c2,c3) values (:cyear,:cmonth,:c0,:c1,:c2,:c3)');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
Params.ParamByName('c0').AsDate:=A0;
Params.ParamByName('c1').AsString:=A1;
Params.ParamByName('c2').AsString:=A2;
Params.ParamByName('c3').AsString:=A3;
ExecSQL;
end;
end
else
begin
with pubqryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into siwang (cyear,cmonth,c0,c1,c2,c3) values (:cyear,:cmonth,:c0,:c1,:c2,:c3)');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
Params.ParamByName('c0').AsDate:=A0;
Params.ParamByName('c1').AsString:=A1;
Params.ParamByName('c2').AsString:=A2;
Params.ParamByName('c3').AsString:=A3;
ExecSQL;
end;
end;
end;
end;
function Tdm.GetSiwangDate(AID: string; var ADate: TDate;AWS:boolean=True): boolean;
begin
Result:=False;
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select * from siwang where c2=:c2');
Params.ParamByName('c2').AsString:=AID;
Open;
if RecordCount>0 then
begin
ADate:=FieldByName('c0').AsDateTime;
Result:=True;
end;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select * from siwang where c2=:c2');
Params.ParamByName('c2').AsString:=AID;
Open;
if RecordCount>0 then
begin
ADate:=FieldByName('c0').AsDateTime;
Result:=True;
end;
end;
end;
end;
procedure Tdm.SaveHuaboFx(AR: TnkReport; ADelete: boolean; AShortKind:string='');
begin
if ADelete=True then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('delete from huabofx where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AR.CYear;
Params.ParamByName('cmonth').AsInteger:=AR.CMonth;
ExecSQL;
end;
end;
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into huabofx (cyear, cmonth, cwarningcount, cwarning, ctipscount, ctips, cdetail, shortkind) values (:cyear, :cmonth, :cwarningcount, :cwarning, :ctipscount, :ctips, :cdetail, :shortkind)');
Params.ParamByName('cyear').AsInteger:=AR.CYear;
Params.ParamByName('cmonth').AsInteger:=AR.CMonth;
Params.ParamByName('cwarningcount').AsInteger:=AR.WarningCount;
Params.ParamByName('cwarning').AsString:=AR.Warning;
Params.ParamByName('ctipscount').AsInteger:=AR.TipsCount;
Params.ParamByName('ctips').AsString:=AR.Tips;
Params.ParamByName('cdetail').AsString:=AR.Detail;
Params.ParamByName('shortkind').AsString:=AShortKind;
ExecSQL;
end;
end;
function Tdm.GenerateID: string;
var
m:TGUID;
m2:string;
begin
CreateGUID(m);
m2:=StringReplace(GUIDToString(m),'{','',[rfReplaceall]);
m2:=StringReplace(m2,'}','',[rfReplaceAll]);
m2:=StringReplace(m2,'-','',[rfReplaceAll]);
Result:=m2;
end;
procedure Tdm.SaveFx(AR: TnkReport; ADelete: boolean; AShortKind: string;AWS:boolean=True);
var
mmainid:string;
i:integer;
begin
if ADelete=True then
begin
//清除数据
mMainId:='';
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select * from fxmaster where cyear=:cyear and cmonth=:cmonth and shortkind=:shortkind');
Params.ParamByName('cyear').AsInteger:=AR.CYear;
Params.ParamByName('cmonth').AsInteger:=AR.CMonth;
Params.ParamByName('shortkind').AsString:=AShortKind;
Open;
First;
if not Eof then
begin
mMainId:=FieldByName('mainid').AsString;
end;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select * from fxmaster where cyear=:cyear and cmonth=:cmonth and shortkind=:shortkind');
Params.ParamByName('cyear').AsInteger:=AR.CYear;
Params.ParamByName('cmonth').AsInteger:=AR.CMonth;
Params.ParamByName('shortkind').AsString:=AShortKind;
Open;
First;
if not Eof then
begin
mMainId:=FieldByName('mainid').AsString;
end;
end;
end;
if mmainid<>'' then
begin
//清除主表
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('delete from fxmaster where mainid=:mainid');
Params.ParamByName('mainid').AsString:=mmainid;
ExecSQL;
end;
//清除子表
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('delete from fxdetail where mainid=:mainid');
Params.ParamByName('mainid').AsString:=mmainid;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('delete from fxmaster where mainid=:mainid');
Params.ParamByName('mainid').AsString:=mmainid;
ExecSQL;
end;
//清除子表
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('delete from fxdetail where mainid=:mainid');
Params.ParamByName('mainid').AsString:=mmainid;
ExecSQL;
end;
end;
end;
end;
//保存主表数据
mMainID:=GenerateID;
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into fxmaster (cyear, cmonth, cwarningcount, cwarning, ctipscount, ctips, cdetail, shortkind, mainid) values (:cyear, :cmonth, :cwarningcount, :cwarning, :ctipscount, :ctips, :cdetail, :shortkind,:mainid)');
Params.ParamByName('cyear').AsInteger:=AR.CYear;
Params.ParamByName('cmonth').AsInteger:=AR.CMonth;
Params.ParamByName('cwarningcount').AsInteger:=AR.WarningCount;
Params.ParamByName('cwarning').AsString:='';//AR.Warning;
Params.ParamByName('ctipscount').AsInteger:=AR.TipsCount;
Params.ParamByName('ctips').AsString:='';//AR.Tips;
Params.ParamByName('cdetail').AsString:='';//AR.Detail;
Params.ParamByName('shortkind').AsString:=AShortKind;
Params.ParamByName('mainid').AsString:=mMainId;
ExecSQL;
end;
//保存子表
conn.AutoCommit:=False;
for i:=0 to AR.WarningLength-1 do
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into fxdetail (mainid,warningkey,warningvalue) values (:mainid,:warningkey,:warningvalue)');
Params.ParamByName('mainid').AsString:=mmainid;
Params.ParamByName('warningkey').AsString:=AR.WarningKey(i);
Params.ParamByName('warningvalue').AsString:=AR.WarningValue(i);
ExecSQL;
end;
end;
{for i:=0 to AR.TipsLength-1 do
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into fxdetail (mainid,tipskey,tipsvalue) values (:mainid,:tipskey,:tipsvalue)');
Params.ParamByName('mainid').AsString:=mMainid;
Params.ParamByName('tipskey').AsString:=AR.TipsKey(i);
Params.ParamByName('tipsvalue').AsString:=AR.TipsValue(i);
ExecSQL;
end;
end;}
conn.Commit;
conn.AutoCommit:=True;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into fxmaster (cyear, cmonth, cwarningcount, cwarning, ctipscount, ctips, cdetail, shortkind, mainid) values (:cyear, :cmonth, :cwarningcount, :cwarning, :ctipscount, :ctips, :cdetail, :shortkind,:mainid)');
Params.ParamByName('cyear').AsInteger:=AR.CYear;
Params.ParamByName('cmonth').AsInteger:=AR.CMonth;
Params.ParamByName('cwarningcount').AsInteger:=AR.WarningCount;
Params.ParamByName('cwarning').AsString:='';//AR.Warning;
Params.ParamByName('ctipscount').AsInteger:=AR.TipsCount;
Params.ParamByName('ctips').AsString:='';//AR.Tips;
Params.ParamByName('cdetail').AsString:='';//AR.Detail;
Params.ParamByName('shortkind').AsString:=AShortKind;
Params.ParamByName('mainid').AsString:=mMainId;
ExecSQL;
end;
//保存子表
connWork.AutoCommit:=False;
for i:=0 to AR.WarningLength-1 do
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into fxdetail (mainid,warningkey,warningvalue) values (:mainid,:warningkey,:warningvalue)');
Params.ParamByName('mainid').AsString:=mmainid;
Params.ParamByName('warningkey').AsString:=AR.WarningKey(i);
Params.ParamByName('warningvalue').AsString:=AR.WarningValue(i);
ExecSQL;
end;
end;
{for i:=0 to AR.TipsLength-1 do
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into fxdetail (mainid,tipskey,tipsvalue) values (:mainid,:tipskey,:tipsvalue)');
Params.ParamByName('mainid').AsString:=mMainid;
Params.ParamByName('tipskey').AsString:=AR.TipsKey(i);
Params.ParamByName('tipsvalue').AsString:=AR.TipsValue(i);
ExecSQL;
end;
end;}
connWork.Commit;
connWork.AutoCommit:=True;
end;
end;
procedure Tdm.SaveImportLog(AKind: string; AYear, AMonth: integer;
ASource, ADispFile: string; ACount: integer;AWS:boolean=True);
begin
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into importlog (cyear, cmonth, source, dispfile, reccount, kind) values (:cyear, :cmonth, :source, :dispfile, :reccount, :kind)');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
Params.ParamByName('source').AsString:=ASource;
Params.ParamByName('dispfile').AsString:=ADispFile;
Params.ParamByName('reccount').AsInteger:=ACount;
Params.ParamByName('kind').AsString:=AKind;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into importlog (cyear, cmonth, source, dispfile, reccount, kind) values (:cyear, :cmonth, :source, :dispfile, :reccount, :kind)');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
Params.ParamByName('source').AsString:=ASource;
Params.ParamByName('dispfile').AsString:=ADispFile;
Params.ParamByName('reccount').AsInteger:=ACount;
Params.ParamByName('kind').AsString:=AKind;
ExecSQL;
end;
end;
end;
procedure Tdm.UpdateRecordCount(AIncCount: integer);
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update stat set recordcount=recordcount+:AInc where id=1');
ParamByName('AInc').AsInteger:=AIncCount;
ExecSQL;
end;
end;
procedure Tdm.SaveAnalLog(AKind: string; AYear, AMonth, AWarningCount,
ATipsCount: integer;AWS:boolean=True);
begin
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into anallog (kind, cyear, cmonth, warningcount, tipscount) values (:kind, :cyear, :cmonth, :warningcount, :tipscount)');
Params.ParamByName('kind').AsString:=AKind;
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
Params.ParamByName('warningcount').AsInteger:=AWarningCount;
Params.ParamByName('tipscount').AsInteger:=ATipsCount;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into anallog (kind, cyear, cmonth, warningcount, tipscount) values (:kind, :cyear, :cmonth, :warningcount, :tipscount)');
Params.ParamByName('kind').AsString:=AKind;
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
Params.ParamByName('warningcount').AsInteger:=AWarningCount;
Params.ParamByName('tipscount').AsInteger:=ATipsCount;
ExecSQL;
end;
end;
end;
procedure Tdm.InsertDanwei(cyear, cmonth: integer; c0, c1, c2, c3, c4, c5, c6,
c7, c8, c9: string; c10, c11: TDate; c12: double; c13, c14, c15, c16,
c17: integer; c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29,
c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41: string; Check:boolean;AWS:boolean=True);
var
mCount:integer;
begin
//先检查c0 c1 重复记录,如果存在则更新,否则插入
mCount:=0;
if Check = False then
begin
if AWS=False then
begin
with dm.innerqry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from danwei where c0=:c0 and c1=:c1');
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
with dm.innerqryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from danwei where c0=:c0 and c1=:c1');
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount = 0 then
begin
//插入记录
if AWS=False then
begin
with dm.innerqry do
begin
Close;
Sql.Clear;
Sql.Add('insert into danwei (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,c31,c32,c33,c34,c35,c36,c37,c38,c39,c40,c41) ');
Sql.Add('values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15,:c16,:c17,:c18,:c19,:c20,:c21,:c22,:c23,:c24,:c25,:c26,:c27,:c28,:c29,:c30,:c31,:c32,:c33,:c34,:c35,:c36,:c37,:c38,:c39,:c40,:c41)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsDate:=c10;
Params.ParamByName('c11').AsDate:=c11;
Params.ParamByName('c12').AsFloat:=c12;
Params.ParamByName('c13').AsInteger:=c13;
Params.ParamByName('c14').AsInteger:=c14;
Params.ParamByName('c15').AsInteger:=c15;
Params.ParamByName('c16').AsInteger:=c16;
Params.ParamByName('c17').AsInteger:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
Params.ParamByName('c23').AsString:=c23;
Params.ParamByName('c24').AsString:=c24;
Params.ParamByName('c25').AsString:=c25;
Params.ParamByName('c26').AsString:=c26;
Params.ParamByName('c27').AsString:=c27;
Params.ParamByName('c28').AsString:=c28;
Params.ParamByName('c29').AsString:=c29;
Params.ParamByName('c30').AsString:=c30;
Params.ParamByName('c31').AsString:=c31;
Params.ParamByName('c32').AsString:=c32;
Params.ParamByName('c33').AsString:=c33;
Params.ParamByName('c34').AsString:=c34;
Params.ParamByName('c35').AsString:=c35;
Params.ParamByName('c36').AsString:=c36;
Params.ParamByName('c37').AsString:=c37;
Params.ParamByName('c38').AsString:=c38;
Params.ParamByName('c39').AsString:=c39;
Params.ParamByName('c40').AsString:=c40;
Params.ParamByName('c41').AsString:=c41;
ExecSQL;
end;
end
else
begin
with dm.innerqryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into danwei (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,c31,c32,c33,c34,c35,c36,c37,c38,c39,c40,c41) ');
Sql.Add('values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15,:c16,:c17,:c18,:c19,:c20,:c21,:c22,:c23,:c24,:c25,:c26,:c27,:c28,:c29,:c30,:c31,:c32,:c33,:c34,:c35,:c36,:c37,:c38,:c39,:c40,:c41)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsDate:=c10;
Params.ParamByName('c11').AsDate:=c11;
Params.ParamByName('c12').AsFloat:=c12;
Params.ParamByName('c13').AsInteger:=c13;
Params.ParamByName('c14').AsInteger:=c14;
Params.ParamByName('c15').AsInteger:=c15;
Params.ParamByName('c16').AsInteger:=c16;
Params.ParamByName('c17').AsInteger:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
Params.ParamByName('c23').AsString:=c23;
Params.ParamByName('c24').AsString:=c24;
Params.ParamByName('c25').AsString:=c25;
Params.ParamByName('c26').AsString:=c26;
Params.ParamByName('c27').AsString:=c27;
Params.ParamByName('c28').AsString:=c28;
Params.ParamByName('c29').AsString:=c29;
Params.ParamByName('c30').AsString:=c30;
Params.ParamByName('c31').AsString:=c31;
Params.ParamByName('c32').AsString:=c32;
Params.ParamByName('c33').AsString:=c33;
Params.ParamByName('c34').AsString:=c34;
Params.ParamByName('c35').AsString:=c35;
Params.ParamByName('c36').AsString:=c36;
Params.ParamByName('c37').AsString:=c37;
Params.ParamByName('c38').AsString:=c38;
Params.ParamByName('c39').AsString:=c39;
Params.ParamByName('c40').AsString:=c40;
Params.ParamByName('c41').AsString:=c41;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with dm.innerqry do
begin
Close;
Sql.Clear;
Sql.Add('update danwei set cyear=:cyear, cmonth=:cmonth,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c6=:c6,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15,c16=:c16,c17=:c17,c18=:c18,c19=:c19,c20=:c20,');
Sql.Add('c21=:c21,c22=:c22,c23=:c23,c24=:c24,c25=:c25,c26=:c26,c27=:c27,c28=:c28,c29=:c29,c30=:c30,c31=:c31,c32=:c32,c33=:c33,c34=:c34,c35=:c35,c36=:c36,c37=:c37,c38=:c38,c39=:c39,c40=:c40,c41=:c41 where c0=:c0 and c1=:c1');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsDate:=c10;
Params.ParamByName('c11').AsDate:=c11;
Params.ParamByName('c12').AsFloat:=c12;
Params.ParamByName('c13').AsInteger:=c13;
Params.ParamByName('c14').AsInteger:=c14;
Params.ParamByName('c15').AsInteger:=c15;
Params.ParamByName('c16').AsInteger:=c16;
Params.ParamByName('c17').AsInteger:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
Params.ParamByName('c23').AsString:=c23;
Params.ParamByName('c24').AsString:=c24;
Params.ParamByName('c25').AsString:=c25;
Params.ParamByName('c26').AsString:=c26;
Params.ParamByName('c27').AsString:=c27;
Params.ParamByName('c28').AsString:=c28;
Params.ParamByName('c29').AsString:=c29;
Params.ParamByName('c30').AsString:=c30;
Params.ParamByName('c31').AsString:=c31;
Params.ParamByName('c32').AsString:=c32;
Params.ParamByName('c33').AsString:=c33;
Params.ParamByName('c34').AsString:=c34;
Params.ParamByName('c35').AsString:=c35;
Params.ParamByName('c36').AsString:=c36;
Params.ParamByName('c37').AsString:=c37;
Params.ParamByName('c38').AsString:=c38;
Params.ParamByName('c39').AsString:=c39;
Params.ParamByName('c40').AsString:=c40;
Params.ParamByName('c41').AsString:=c41;
ExecSQL;
end;
end
else
begin
with dm.innerqryWork do
begin
Close;
Sql.Clear;
Sql.Add('update danwei set cyear=:cyear, cmonth=:cmonth,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c6=:c6,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15,c16=:c16,c17=:c17,c18=:c18,c19=:c19,c20=:c20,');
Sql.Add('c21=:c21,c22=:c22,c23=:c23,c24=:c24,c25=:c25,c26=:c26,c27=:c27,c28=:c28,c29=:c29,c30=:c30,c31=:c31,c32=:c32,c33=:c33,c34=:c34,c35=:c35,c36=:c36,c37=:c37,c38=:c38,c39=:c39,c40=:c40,c41=:c41 where c0=:c0 and c1=:c1');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsDate:=c10;
Params.ParamByName('c11').AsDate:=c11;
Params.ParamByName('c12').AsFloat:=c12;
Params.ParamByName('c13').AsInteger:=c13;
Params.ParamByName('c14').AsInteger:=c14;
Params.ParamByName('c15').AsInteger:=c15;
Params.ParamByName('c16').AsInteger:=c16;
Params.ParamByName('c17').AsInteger:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
Params.ParamByName('c23').AsString:=c23;
Params.ParamByName('c24').AsString:=c24;
Params.ParamByName('c25').AsString:=c25;
Params.ParamByName('c26').AsString:=c26;
Params.ParamByName('c27').AsString:=c27;
Params.ParamByName('c28').AsString:=c28;
Params.ParamByName('c29').AsString:=c29;
Params.ParamByName('c30').AsString:=c30;
Params.ParamByName('c31').AsString:=c31;
Params.ParamByName('c32').AsString:=c32;
Params.ParamByName('c33').AsString:=c33;
Params.ParamByName('c34').AsString:=c34;
Params.ParamByName('c35').AsString:=c35;
Params.ParamByName('c36').AsString:=c36;
Params.ParamByName('c37').AsString:=c37;
Params.ParamByName('c38').AsString:=c38;
Params.ParamByName('c39').AsString:=c39;
Params.ParamByName('c40').AsString:=c40;
Params.ParamByName('c41').AsString:=c41;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.DeleteDanwei(AYear, AMonth:integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from danwei where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from danwei where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.DeleteZhuxiao(AYear, AMonth:integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from zhuxiao where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from zhuxiao where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.InsertZhuxiao(cyear, cmonth: integer; c0, c1, c2, c3, c4, c5, c6,
c7: string; c8: TDate; c9, c10: string; c11: TDate; check: boolean;AWS:boolean=True);
var
mCount:integer;
begin
//如果Check=True则比对信用号码
mCount:=0;
if Check=False then
begin
if AWS=False then
begin
With InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from zhuxiao where c6=:c6');
Params.ParamByName('c6').AsString:=c6;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
With InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from zhuxiao where c6=:c6');
Params.ParamByName('c6').AsString:=c6;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount=0 then
begin
//插入记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into zhuxiao (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsDate:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsDate:=c11;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into zhuxiao (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsDate:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsDate:=c11;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update zhuxiao set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11 where c6=:c6');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsDate:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsDate:=c11;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('update zhuxiao set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11 where c6=:c6');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsDate:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsDate:=c11;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.InsertXuesheng(cyear, cmonth: integer; c0, c1, c2: string;
c3: TDate; c4, c5, c6, c7, c8: string; c9: TDate; c10, c11:string; c12:integer; c13, c14,
c15: double; check: boolean; AWS:boolean=True);
var
mCount:integer;
begin
//如果Check=True则比对社保号码
mCount:=0;
if Check=False then
begin
if AWS=False then
begin
With InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from xuesheng where c0=:c0');
Params.ParamByName('c0').AsString:=c0;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
With InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from xuesheng where c0=:c0');
Params.ParamByName('c0').AsString:=c0;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount=0 then
begin
//插入记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into xuesheng (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsDate:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsDate:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsInteger:=c12;
Params.ParamByName('c13').AsFloat:=c13;
Params.ParamByName('c14').AsFloat:=c14;
Params.ParamByName('c15').AsFloat:=c15;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into xuesheng (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsDate:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsDate:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsInteger:=c12;
Params.ParamByName('c13').AsFloat:=c13;
Params.ParamByName('c14').AsFloat:=c14;
Params.ParamByName('c15').AsFloat:=c15;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update xuesheng set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15 where c6=:c6');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsDate:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsDate:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsInteger:=c12;
Params.ParamByName('c13').AsFloat:=c13;
Params.ParamByName('c14').AsFloat:=c14;
Params.ParamByName('c15').AsFloat:=c15;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('update xuesheng set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15 where c6=:c6');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsDate:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsDate:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsInteger:=c12;
Params.ParamByName('c13').AsFloat:=c13;
Params.ParamByName('c14').AsFloat:=c14;
Params.ParamByName('c15').AsFloat:=c15;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.DeleteXueSheng(AYear,AMonth:integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from xuesheng where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from xuesheng where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.InsertBujiao(cyear, cmonth: integer; c0, c1, c2, c3, c4, c5, c6,
c7, c8: string; c9: TDate; c10, c11, c12, c13, c14, c15, c16, c17, c18, c19,
c20, c21, c22, c23, c24, c25, c26, c27, c28: double; c29, c30, c31: string;
check: boolean; AWS:boolean=True);
var
mCount:integer;
begin
//如果Check=True则比对社保号码
mCount:=0;
if Check=False then
begin
if AWS=False then
begin
With InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from bujiao where c0=:c0');
Params.ParamByName('c0').AsString:=c0;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
With InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from bujiao where c0=:c0');
Params.ParamByName('c0').AsString:=c0;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount=0 then
begin
//插入记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into bujiao (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,c31) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15,:c16,:c17,:c18,:c19,:c20,:c21,:c22,:c23,:c24,:c25,:c26,:c27,:c28,:c29,:c30,:c31)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsDate:=c9;
Params.ParamByName('c10').AsFloat:=c10;
Params.ParamByName('c11').AsFloat:=c11;
Params.ParamByName('c12').AsFloat:=c12;
Params.ParamByName('c13').AsFloat:=c13;
Params.ParamByName('c14').AsFloat:=c14;
Params.ParamByName('c15').AsFloat:=c15;
Params.ParamByName('c16').AsFloat:=c16;
Params.ParamByName('c17').AsFloat:=c17;
Params.ParamByName('c18').AsFloat:=c18;
Params.ParamByName('c19').AsFloat:=c19;
Params.ParamByName('c20').AsFloat:=c20;
Params.ParamByName('c21').AsFloat:=c21;
Params.ParamByName('c22').AsFloat:=c22;
Params.ParamByName('c23').AsFloat:=c23;
Params.ParamByName('c24').AsFloat:=c24;
Params.ParamByName('c25').AsFloat:=c25;
Params.ParamByName('c26').AsFloat:=c26;
Params.ParamByName('c27').AsFloat:=c27;
Params.ParamByName('c28').AsFloat:=c28;
Params.ParamByName('c29').AsString:=c29;
Params.ParamByName('c30').AsString:=c30;
Params.ParamByName('c31').AsString:=c31;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into bujiao (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,c31) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15,:c16,:c17,:c18,:c19,:c20,:c21,:c22,:c23,:c24,:c25,:c26,:c27,:c28,:c29,:c30,:c31)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsDate:=c9;
Params.ParamByName('c10').AsFloat:=c10;
Params.ParamByName('c11').AsFloat:=c11;
Params.ParamByName('c12').AsFloat:=c12;
Params.ParamByName('c13').AsFloat:=c13;
Params.ParamByName('c14').AsFloat:=c14;
Params.ParamByName('c15').AsFloat:=c15;
Params.ParamByName('c16').AsFloat:=c16;
Params.ParamByName('c17').AsFloat:=c17;
Params.ParamByName('c18').AsFloat:=c18;
Params.ParamByName('c19').AsFloat:=c19;
Params.ParamByName('c20').AsFloat:=c20;
Params.ParamByName('c21').AsFloat:=c21;
Params.ParamByName('c22').AsFloat:=c22;
Params.ParamByName('c23').AsFloat:=c23;
Params.ParamByName('c24').AsFloat:=c24;
Params.ParamByName('c25').AsFloat:=c25;
Params.ParamByName('c26').AsFloat:=c26;
Params.ParamByName('c27').AsFloat:=c27;
Params.ParamByName('c28').AsFloat:=c28;
Params.ParamByName('c29').AsString:=c29;
Params.ParamByName('c30').AsString:=c30;
Params.ParamByName('c31').AsString:=c31;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update bujiao set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15,c16=:c16,c17=:c17,c18=:c18,c19=:c19,c20=:c20,c21=:c21,c22=:c22,c23=:c23,c24=:c24,c25=:c25,c26=:c26,c27=:c27,c28=:c28,c29=:c29,c30=:c30,c31=:c31 where c0=:c0');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsDate:=c9;
Params.ParamByName('c10').AsFloat:=c10;
Params.ParamByName('c11').AsFloat:=c11;
Params.ParamByName('c12').AsFloat:=c12;
Params.ParamByName('c13').AsFloat:=c13;
Params.ParamByName('c14').AsFloat:=c14;
Params.ParamByName('c15').AsFloat:=c15;
Params.ParamByName('c16').AsFloat:=c16;
Params.ParamByName('c17').AsFloat:=c17;
Params.ParamByName('c18').AsFloat:=c18;
Params.ParamByName('c19').AsFloat:=c19;
Params.ParamByName('c20').AsFloat:=c20;
Params.ParamByName('c21').AsFloat:=c21;
Params.ParamByName('c22').AsFloat:=c22;
Params.ParamByName('c23').AsFloat:=c23;
Params.ParamByName('c24').AsFloat:=c24;
Params.ParamByName('c25').AsFloat:=c25;
Params.ParamByName('c26').AsFloat:=c26;
Params.ParamByName('c27').AsFloat:=c27;
Params.ParamByName('c28').AsFloat:=c28;
Params.ParamByName('c29').AsString:=c29;
Params.ParamByName('c30').AsString:=c30;
Params.ParamByName('c31').AsString:=c31;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('update bujiao set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15,c16=:c16,c17=:c17,c18=:c18,c19=:c19,c20=:c20,c21=:c21,c22=:c22,c23=:c23,c24=:c24,c25=:c25,c26=:c26,c27=:c27,c28=:c28,c29=:c29,c30=:c30,c31=:c31 where c0=:c0');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsDate:=c9;
Params.ParamByName('c10').AsFloat:=c10;
Params.ParamByName('c11').AsFloat:=c11;
Params.ParamByName('c12').AsFloat:=c12;
Params.ParamByName('c13').AsFloat:=c13;
Params.ParamByName('c14').AsFloat:=c14;
Params.ParamByName('c15').AsFloat:=c15;
Params.ParamByName('c16').AsFloat:=c16;
Params.ParamByName('c17').AsFloat:=c17;
Params.ParamByName('c18').AsFloat:=c18;
Params.ParamByName('c19').AsFloat:=c19;
Params.ParamByName('c20').AsFloat:=c20;
Params.ParamByName('c21').AsFloat:=c21;
Params.ParamByName('c22').AsFloat:=c22;
Params.ParamByName('c23').AsFloat:=c23;
Params.ParamByName('c24').AsFloat:=c24;
Params.ParamByName('c25').AsFloat:=c25;
Params.ParamByName('c26').AsFloat:=c26;
Params.ParamByName('c27').AsFloat:=c27;
Params.ParamByName('c28').AsFloat:=c28;
Params.ParamByName('c29').AsString:=c29;
Params.ParamByName('c30').AsString:=c30;
Params.ParamByName('c31').AsString:=c31;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.InsertZhuanchu(cyear, cmonth: integer; c0, c1, c2, c3, c4, c5, c6,
c7: string; c8: double; c9, c10, c11, c12: String; c13: TDate; c14, c15, c16,
c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27: string; check: boolean ; AWS:boolean=True
);
var
mCount:integer;
begin
//如果Check=True则比对社保号码
mCount:=0;
if Check=False then
begin
if AWS=False then
begin
With InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from bujiao where c3=:c3');
Params.ParamByName('c3').AsString:=c3;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
With InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from bujiao where c3=:c3');
Params.ParamByName('c3').AsString:=c3;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount=0 then
begin
if AWS=False then
begin
//插入记录
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into zhuanchu (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15,:c16,:c17,:c18,:c19,:c20,:c21,:c22,:c23,:c24,:c25,:c26,:c27)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsFloat:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsDate:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
Params.ParamByName('c23').AsString:=c23;
Params.ParamByName('c24').AsString:=c24;
Params.ParamByName('c25').AsString:=c25;
Params.ParamByName('c26').AsString:=c26;
Params.ParamByName('c27').AsString:=c27;
ExecSQL;
end;
end
else
begin
//插入记录
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into zhuanchu (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15,:c16,:c17,:c18,:c19,:c20,:c21,:c22,:c23,:c24,:c25,:c26,:c27)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsFloat:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsDate:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
Params.ParamByName('c23').AsString:=c23;
Params.ParamByName('c24').AsString:=c24;
Params.ParamByName('c25').AsString:=c25;
Params.ParamByName('c26').AsString:=c26;
Params.ParamByName('c27').AsString:=c27;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update zhuanchu set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15,c16=:c16,c17=:c17,c18=:c18,c19=:c19,c20=:c20,c21=:c21,c22=:c22,c23=:c23,c24=:c24,c25=:c25,c26=:c26,c27=:c27 where c3=:c3');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsFloat:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsDate:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
Params.ParamByName('c23').AsString:=c23;
Params.ParamByName('c24').AsString:=c24;
Params.ParamByName('c25').AsString:=c25;
Params.ParamByName('c26').AsString:=c26;
Params.ParamByName('c27').AsString:=c27;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('update zhuanchu set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15,c16=:c16,c17=:c17,c18=:c18,c19=:c19,c20=:c20,c21=:c21,c22=:c22,c23=:c23,c24=:c24,c25=:c25,c26=:c26,c27=:c27 where c3=:c3');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsFloat:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsDate:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
Params.ParamByName('c23').AsString:=c23;
Params.ParamByName('c24').AsString:=c24;
Params.ParamByName('c25').AsString:=c25;
Params.ParamByName('c26').AsString:=c26;
Params.ParamByName('c27').AsString:=c27;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.InsertJumin(cyear, cMonth: integer; c0, c1, c2: string;
c3: TDate; c4, c5, c6, c7, c8: string; c9: TDate; c10, c11: string;
c12: integer; c13, c14, c15: double; check: boolean; AWS:boolean=True);
var
mCount:integer;
begin
//如果Check=True则比对社保号码
mCount:=0;
if Check=False then
begin
if AWS=False then
begin
With InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from jumin where c0=:c0');
Params.ParamByName('c0').AsString:=c0;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
With InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from jumin where c0=:c0');
Params.ParamByName('c0').AsString:=c0;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount=0 then
begin
//插入记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into jumin (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsDate:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsDate:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsInteger:=c12;
Params.ParamByName('c13').AsFloat:=c13;
Params.ParamByName('c14').AsFloat:=c14;
Params.ParamByName('c15').AsFloat:=c15;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into jumin (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsDate:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsDate:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsInteger:=c12;
Params.ParamByName('c13').AsFloat:=c13;
Params.ParamByName('c14').AsFloat:=c14;
Params.ParamByName('c15').AsFloat:=c15;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update jumin set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15 where c0=:c0');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsDate:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsDate:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsInteger:=c12;
Params.ParamByName('c13').AsFloat:=c13;
Params.ParamByName('c14').AsFloat:=c14;
Params.ParamByName('c15').AsFloat:=c15;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('update jumin set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15 where c0=:c0');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsDate:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsDate:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsInteger:=c12;
Params.ParamByName('c13').AsFloat:=c13;
Params.ParamByName('c14').AsFloat:=c14;
Params.ParamByName('c15').AsFloat:=c15;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.InsertGaoxueya(cyear, cmonth: integer; c0, c1, c2, c3, c4, c5,
c6: string; c7, c8: TDate; check: boolean; AWS:boolean=True);
var
mCount:integer;
begin
//如果Check=True则比对社保号码
mCount:=0;
if Check=False then
begin
if AWS=False then
begin
With InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from gaoxueya where c0=:c0');
Params.ParamByName('c0').AsString:=c0;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
With InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from gaoxueya where c0=:c0');
Params.ParamByName('c0').AsString:=c0;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount=0 then
begin
//插入记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into gaoxueya (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsDate:=c7;
Params.ParamByName('c8').AsDate:=c8;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into gaoxueya (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsDate:=c7;
Params.ParamByName('c8').AsDate:=c8;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update gaoxueya set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8 where c0=:c0');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsDate:=c7;
Params.ParamByName('c8').AsDate:=c8;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('update gaoxueya set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8 where c0=:c0');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsDate:=c7;
Params.ParamByName('c8').AsDate:=c8;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.InsertManxingbing(cyear, cmonth: integer; c0, c1, c2, c3,
c4,c5, c6, c7, c8, c9: string; c10, c11: TDate; c12, c13,
c14, c15, c16, c17, c18, c19, c20, c21,c22: string; check: boolean; AWS:boolean=True);
var
mCount:integer;
begin
//如果Check=True则比对备案号码
mCount:=0;
if Check=False then
begin
if AWS=False then
begin
With InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from manxingbing where c0=:c0');
Params.ParamByName('c0').AsString:=c0;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
With InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from manxingbing where c0=:c0');
Params.ParamByName('c0').AsString:=c0;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount=0 then
begin
//插入记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into manxingbing (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15,:c16,:c17,:c18,:c19,:c20,:c21,:c22)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsDate:=c10;
Params.ParamByName('c11').AsDate:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsString:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into manxingbing (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15,:c16,:c17,:c18,:c19,:c20,:c21,:c22)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsDate:=c10;
Params.ParamByName('c11').AsDate:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsString:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update manxingbing set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15,c16=:c16,c17=:c17,c18=:c18,c19=:c19,c20=:c20,c21=:c21,c22=:c22 where c0=:c0');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsDate:=c10;
Params.ParamByName('c11').AsDate:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsString:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('update manxingbing set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15,c16=:c16,c17=:c17,c18=:c18,c19=:c19,c20=:c20,c21=:c21,c22=:c22 where c0=:c0');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsDate:=c10;
Params.ParamByName('c11').AsDate:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsString:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.InsertZhigongManxingbing(cyear, cmonth: integer; c0, c1, c2, c3,
c4, c5, c6, c7, c8, c9: string; c10, c11: TDate; c12, c13, c14, c15, c16,
c17, c18, c19, c20, c21, c22, c23, c24: string; check: boolean; AWS: boolean);
var
mCount:integer;
begin
//如果Check=True则比对备案号码
mCount:=0;
if Check=False then
begin
if AWS=False then
begin
With InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from zhigongmanxingbing where c0=:c0');
Params.ParamByName('c0').AsString:=c0;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
With InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from zhigongmanxingbing where c0=:c0');
Params.ParamByName('c0').AsString:=c0;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount=0 then
begin
//插入记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into zhigongmanxingbing (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15,:c16,:c17,:c18,:c19,:c20,:c21,:c22,:c23,:c24)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsDate:=c10;
Params.ParamByName('c11').AsDate:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsString:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
Params.ParamByName('c23').AsString:=c23;
Params.ParamByName('c24').AsString:=c24;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into zhigongmanxingbing (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15,:c16,:c17,:c18,:c19,:c20,:c21,:c22,:c23,:c24)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsDate:=c10;
Params.ParamByName('c11').AsDate:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsString:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
Params.ParamByName('c23').AsString:=c23;
Params.ParamByName('c24').AsString:=c24;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update zhigongmanxingbing set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15,c16=:c16,c17=:c17,c18=:c18,c19=:c19,c20=:c20,c21=:c21,c22=:c22,c23=:c23,c24=:c24 where c0=:c0');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsDate:=c10;
Params.ParamByName('c11').AsDate:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsString:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
Params.ParamByName('c23').AsString:=c23;
Params.ParamByName('c24').AsString:=c24;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('update zhigongmanxingbing set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15,c16=:c16,c17=:c17,c18=:c18,c19=:c19,c20=:c20,c21=:c21,c22=:c22,c23=:c23,c24=:c24 where c0=:c0');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsString:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsDate:=c10;
Params.ParamByName('c11').AsDate:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsString:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
Params.ParamByName('c18').AsString:=c18;
Params.ParamByName('c19').AsString:=c19;
Params.ParamByName('c20').AsString:=c20;
Params.ParamByName('c21').AsString:=c21;
Params.ParamByName('c22').AsString:=c22;
Params.ParamByName('c23').AsString:=c23;
Params.ParamByName('c24').AsString:=c24;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.InsertManbingBianma(cyear, cmonth: integer; c0, c1, c2,c3: string;
check: boolean; AWS:boolean=True);
var
mCount:integer;
begin
//如果Check=True则比对备案号码
mCount:=0;
if Check=False then
begin
if AWS=False then
begin
With InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from manbingbianma where c1=:c1');
Params.ParamByName('c1').AsString:=c1;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
With InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from manbingbianma where c1=:c1');
Params.ParamByName('c1').AsString:=c1;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount=0 then
begin
//插入记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into manbingbianma (cyear,cmonth,c0,c1,c2,c3) values (:cyear,:cmonth,:c0,:c1,:c2,:c3)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into manbingbianma (cyear,cmonth,c0,c1,c2,c3) values (:cyear,:cmonth,:c0,:c1,:c2,:c3)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update manxingbing set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2, c3=:c3 where c1=:c1');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('update manxingbing set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2, c3=:c3 where c1=:c1');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.InsertZhigongManbingBianma(cyear, cmonth: integer; c0, c1,
c2: string; check: boolean; AWS: boolean);
var
mCount:integer;
begin
//如果Check=True则比对备案号码
mCount:=0;
if Check=False then
begin
if AWS=False then
begin
With InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from zhigongmanbingbianma where c1=:c1');
Params.ParamByName('c1').AsString:=c1;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
With InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from zhigongmanbingbianma where c1=:c1');
Params.ParamByName('c1').AsString:=c1;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount=0 then
begin
//插入记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into zhigongmanbingbianma (cyear,cmonth,c0,c1,c2) values (:cyear,:cmonth,:c0,:c1,:c2)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into zhigongmanbingbianma (cyear,cmonth,c0,c1,c2) values (:cyear,:cmonth,:c0,:c1,:c2)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update zhigongmanbingbianma set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2 where c1=:c1');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('update zhigongmanbingbianma set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2 where c1=:c1');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.InsertYiyuanBianma(cyear, cmonth: integer; c0, c1, c2,
c3: string; check: boolean;AWS:boolean=True);
var
mCount:integer;
begin
//如果Check=True则比对备案号码
mCount:=0;
if Check=False then
begin
if AWS=False then
begin
With InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from manbingbianma where c1=:c1');
Params.ParamByName('c1').AsString:=c1;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
With InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from manbingbianma where c1=:c1');
Params.ParamByName('c1').AsString:=c1;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount=0 then
begin
//插入记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into yiyuanbianma (cyear,cmonth,c0,c1,c2,c3) values (:cyear,:cmonth,:c0,:c1,:c2,:c3)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into yiyuanbianma (cyear,cmonth,c0,c1,c2,c3) values (:cyear,:cmonth,:c0,:c1,:c2,:c3)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update manxingbing set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3 where c1=:c1');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('update manxingbing set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3 where c1=:c1');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.InsertZhigong(cyear, cMonth: integer; c0, c1, c2, c3, c4: string;
c5: TDate; c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17: string;
check: boolean;AWS:boolean=True);
var
mCount:integer;
begin
//如果Check=True则比对社保号码
mCount:=0;
if Check=False then
begin
if AWS=False then
begin
With InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from zhigong where c4=:c4');
Params.ParamByName('c4').AsString:=c4;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end
else
begin
With InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('select count(*) as aa from zhigong where c4=:c4');
Params.ParamByName('c4').AsString:=c4;
Open;
First;
mCount:=FieldByName('aa').AsInteger;
end;
end;
end;
if mCount=0 then
begin
//插入记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('insert into zhigong (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15,:c16,:c17)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsDate:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsString:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('insert into zhigong (cyear,cmonth,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17) values (:cyear,:cmonth,:c0,:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9,:c10,:c11,:c12,:c13,:c14,:c15,:c16,:c17)');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsDate:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsString:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
ExecSQL;
end;
end;
end
else
begin
//更新记录
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update zhigong set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15,c16=:c16,c17=:c17 where c4=:c4');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsDate:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsString:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('update zhigong set cyear=:cyear,cmonth=:cmonth,c0=:c0,c1=:c1,c2=:c2,c3=:c3,c4=:c4,c5=:c5,c7=:c7,c8=:c8,c9=:c9,c10=:c10,c11=:c11,c12=:c12,c13=:c13,c14=:c14,c15=:c15,c16=:c16,c17=:c17 where c4=:c4');
Params.ParamByName('cyear').AsInteger:=cyear;
Params.ParamByName('cmonth').AsInteger:=cmonth;
Params.ParamByName('c0').AsString:=c0;
Params.ParamByName('c1').AsString:=c1;
Params.ParamByName('c2').AsString:=c2;
Params.ParamByName('c3').AsString:=c3;
Params.ParamByName('c4').AsString:=c4;
Params.ParamByName('c5').AsDate:=c5;
Params.ParamByName('c6').AsString:=c6;
Params.ParamByName('c7').AsString:=c7;
Params.ParamByName('c8').AsString:=c8;
Params.ParamByName('c9').AsString:=c9;
Params.ParamByName('c10').AsString:=c10;
Params.ParamByName('c11').AsString:=c11;
Params.ParamByName('c12').AsString:=c12;
Params.ParamByName('c13').AsString:=c13;
Params.ParamByName('c14').AsString:=c14;
Params.ParamByName('c15').AsString:=c15;
Params.ParamByName('c16').AsString:=c16;
Params.ParamByName('c17').AsString:=c17;
ExecSQL;
end;
end;
end;
end;
procedure Tdm.DeleteZhigong(AYear,AMonth:integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from zhigong where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from zhigong where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.DeleteYiyuanBianma(AYear, AMonth:integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from yiyuanbianma where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from yiyuanbianma where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.DeleteManbingBianma(AYear, AMonth:integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from manbingbianma where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from manbingbianma where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.DeleteZhigongManbingBianma(AYear, AMonth:integer;AWS: boolean);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from zhigongmanbingbianma where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from zhigongmanbingbianma where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.DeleteBujiao(AYear, AMonth:integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from bujiao where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from bujiao where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.DeleteZhuanchu(AYear, AMonth:integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from zhuanchu where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from zhuanchu where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.DeleteJumin(AYear,AMonth:integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from jumin where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from jumin where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.DeleteGaoxueya(AYear, AMonth:integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from gaoxueya where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from gaoxueya where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.DeleteManxingbing(AYear, AMonth:integer;AWS:boolean=True);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from manxingbing where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from manxingbing where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.DeleteZhigongManxingbing(AYear, AMonth:integer;AWS: boolean);
begin
if AWS=False then
begin
with pubQry do
begin
Close;
SQL.Clear;
Sql.Add('delete from zhigongmanxingbing where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end
else
begin
with pubQryWork do
begin
Close;
SQL.Clear;
Sql.Add('delete from zhigongmanxingbing where cyear=:cyear and cmonth=:cmonth');
Params.ParamByName('cyear').AsInteger:=AYear;
Params.ParamByName('cmonth').AsInteger:=AMonth;
ExecSQL;
end;
end;
end;
procedure Tdm.ResetTable(ATable: string;AWS:boolean=True);
begin
if AWS=False then
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('delete from '+ATable);
ExecSQL;
end;
end
else
begin
with InnerQryWork do
begin
Close;
Sql.Clear;
Sql.Add('delete from '+ATable);
ExecSQL;
end;
end;
end;
procedure Tdm.ResetBigData;
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update stat set recordcount=0,analcount=0,viewcount=0,reportcount=0,warningcount=0');
ExecSQL;
end;
ResetTable('stat_detail');
end;
procedure Tdm.UpdateAnalCount;
begin
with InnerQry do
begin
Close;
Sql.Clear;
Sql.Add('update stat set analcount=analcount+1 where id=1');
ExecSQL;
end;
end;
function Tdm.RemovePercent(AText: string): string;
var
m:string;
begin
if Trim(AText)='' then
begin
Result:='0';
end
else
begin
m:=StringReplace(AText,'%','',[rfReplaceAll]);//去百分号
Result:=StringReplace(m,',','',[rfReplaceAll]);//去千分号
end;
end;
end.
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化