declare @p1 int set @p1=1 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000)',N'select o.*,j.* from yc_yg o,yc_jgzd j where o.col_exists_org = j.jgbm and (o.col_op_no=@P0 or o.col_loginname=@P1) ',N'0107001',N'0107001' select @p1 go declare @p1 int set @p1=2 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000)',N'select qxbm from yc_zm g where g.bmbm = @P0 and g.jgbm = @P1 order by g.qxbm ',N'1602',N'Z305' select @p1 go select (case when right(convert(char(10),getdate(),120),2) >= '26' then convert(varchar(7),DATEADD(Month,1,getdate()),120) else left(convert(char(10),getdate(),120),7) end) go set implicit_transactions on go declare @p1 int set @p1=3 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000),@P2 nvarchar(4000),@P3 nvarchar(4000),@P4 nvarchar(4000),@P5 nvarchar(4000)',N' insert into yb_rz (jgbm,rq,gnmk,ksrq,jsrq,czy) values(@P0,@P1,@P2,@P3,@P4,@P5) ',N'0107',N'2023-05',N'登录成功!',N'10.101.4.35',N'1602',N'0107001' select @p1 go IF @@TRANCOUNT > 0 COMMIT TRAN go IF @@TRANCOUNT > 0 COMMIT TRAN set implicit_transactions off go select convert(char(10),getdate(),120) go select convert(char(10),getdate(),120) go set implicit_transactions on go declare @p1 int set @p1=4 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000),@P2 nvarchar(4000),@P3 nvarchar(4000)',N'update yc_yg set col_address = @P0 , col_tel = @P1 , col_reject_sdate = @P2 where col_op_no = @P3 ',N'10.101.4.35',N'登录成功!',N'2023-05-17',N'0107001' select @p1 go IF @@TRANCOUNT > 0 COMMIT TRAN go IF @@TRANCOUNT > 0 COMMIT TRAN set implicit_transactions off go select t.jgbm,jk1,jk2,jk3,jk4,sum1,sum2,sum3,sum4 from (select jgbm,jk1,jk2,jk3,jk4 from yc_jgzd where jgbm = '0107') T left join (select jgbm,count(*) as sum1 from yb_jysrrb where jgbm = '0107' and rq = '20230517' group by jgbm) A on A.jgbm = T.jgbm left join (select jgbm,count(*) as sum2 from yb_ddps where jgbm = '0107' and rq = '20230517' group by jgbm) B on B.jgbm = T.jgbm left join (select jgbm,count(*) as sum3 from yb_zhzy where jgbm = '0107' and rq = '20230517' group by jgbm) C on C.jgbm = T.jgbm left join (select jgbm,count(*) as sum4 from yb_dbys where jgbm = '0107' and rq = '20230517' group by jgbm) D on D.jgbm = T.jgbm order by T.jgbm go declare @p1 int set @p1=5 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000)',N'select * from yc_jgzd where (jgbm like @P0 or jgbm = @P1 ) and len(jgbm)<=4 order by jgbm ',N'0107___',N'0107' select @p1 go select '' as yscx, 0 as dj, '' as jykh union select plate as yscx, length as dj, GPS_state as jykh from yc_cars where GPS_pass = '0107' order by yscx go select * from yc_yscx2 order by dj go select driver_name, driver_ID from yc_drivers where agency = '0107' order by driver_ID go select t.*,a.jgmc from yb_dbys2 t,yc_jgzd a where t.jgbm like '0107%' and t.rq = '20230516' and t.jgbm = a.jgbm order by jyztjg go declare @p1 int set @p1=1 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000)',N'select * from yc_jgzd where (jgbm like @P0 or jgbm = @P1 ) and len(jgbm)<=4 order by jgbm ',N'0107___',N'0107' select @p1 go select driver_name, driver_ID from yc_drivers where agency = '0107' order by driver_ID go select '' as yscx, 0 as dj, '' as jykh union select plate as yscx, length as dj, GPS_state as jykh from yc_cars where GPS_pass = '0107' order by yscx go select * from yc_yscx2 order by dj go declare @p1 int set @p1=2 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000)',N'select o.*,j.* from yc_yg o,yc_jgzd j where o.col_exists_org = j.jgbm and (o.col_op_no=@P0 or o.col_loginname=@P1) ',N'01003',N'01003' select @p1 go declare @p1 int set @p1=3 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000)',N'select qxbm from yc_zm g where g.bmbm = @P0 and g.jgbm = @P1 order by g.qxbm ',N'1606',N'Z303' select @p1 go select (case when right(convert(char(10),getdate(),120),2) >= '26' then convert(varchar(7),DATEADD(Month,1,getdate()),120) else left(convert(char(10),getdate(),120),7) end) go set implicit_transactions on go declare @p1 int set @p1=4 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000),@P2 nvarchar(4000),@P3 nvarchar(4000),@P4 nvarchar(4000),@P5 nvarchar(4000)',N' insert into yb_rz (jgbm,rq,gnmk,ksrq,jsrq,czy) values(@P0,@P1,@P2,@P3,@P4,@P5) ',N'01',N'2023-05',N'登录成功!',N'10.101.0.42',N'1606',N'01003' select @p1 go IF @@TRANCOUNT > 0 COMMIT TRAN go IF @@TRANCOUNT > 0 COMMIT TRAN set implicit_transactions off go select convert(char(10),getdate(),120) go select convert(char(10),getdate(),120) go set implicit_transactions on go declare @p1 int set @p1=5 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000),@P2 nvarchar(4000),@P3 nvarchar(4000)',N'update yc_yg set col_address = @P0 , col_tel = @P1 , col_reject_sdate = @P2 where col_op_no = @P3 ',N'10.101.0.42',N'登录成功!',N'2023-05-17',N'01003' select @p1 go IF @@TRANCOUNT > 0 COMMIT TRAN go IF @@TRANCOUNT > 0 COMMIT TRAN set implicit_transactions off go select t.jgbm,jk1,jk2,jk3,jk4,sum1,sum2,sum3,sum4 from (select jgbm,jk1,jk2,jk3,jk4 from yc_jgzd where jgbm = '01') T left join (select jgbm,count(*) as sum1 from yb_jysrrb where jgbm = '01' and rq = '20230517' group by jgbm) A on A.jgbm = T.jgbm left join (select jgbm,count(*) as sum2 from yb_ddps where jgbm = '01' and rq = '20230517' group by jgbm) B on B.jgbm = T.jgbm left join (select jgbm,count(*) as sum3 from yb_zhzy where jgbm = '01' and rq = '20230517' group by jgbm) C on C.jgbm = T.jgbm left join (select jgbm,count(*) as sum4 from yb_dbys where jgbm = '01' and rq = '20230517' group by jgbm) D on D.jgbm = T.jgbm order by T.jgbm go declare @p1 int set @p1=6 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000)',N'select * from yc_jgzd where ( jgbm like @P0 or jgbm = @P1 ) and len(jgbm)<=7 and fbf= 1 order by jgbm ',N'01__',N'01' select @p1 go declare @p1 int set @p1=7 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000)',N'select * from yc_yscx3 where khlx = @P0 order by dj ',N'2' select @p1 go select * from DIC_CUSTOMER_ADVANCE01 where Fld_Station_Code like '01%' and Fld_Customer_Type='2' order by Fld_Customer_Code go declare @p1 int set @p1=8 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000),@P2 nvarchar(4000)',N'select t.*,a.jgmc,b.* from yb_dbys3 t,yc_jgzd a, DIC_CUSTOMER_ADVANCE01 b where t.jgbm = @P0 and t.rq = @P1 and t.jgbm = a.jgbm and t.jyztjg = b.Fld_Customer_Code and b.Fld_Customer_Type=t.khlx and t.khlx = @P2 order by jyztjg ',N'0111',N'20230517',N'2' select @p1 go exec sp_execute 6,N'01__',N'01' go select * from DIC_CUSTOMER_ADVANCE01 where Fld_Station_Code like '01%' and Fld_Customer_Type='2' order by Fld_Customer_Code go exec sp_execute 7,N'2' go select t.*,t2.jgmc sjjgmc from DIC_CUSTOMER_ADVANCE t left outer join yc_jgzd t2 on t.Fld_Station_Code = t2.jgbm where t.Fld_Customer_Type='1' and t.Fld_Station_Code like '01%' order by t.Fld_Customer_Code go select t.*,t2.jgmc sjjgmc from DIC_CUSTOMER_ADVANCE t left outer join yc_jgzd t2 on t.Fld_Station_Code = t2.jgbm where t.Fld_Customer_Type='1' and t.Fld_Station_Code like '01%' order by t.Fld_Customer_Code go exec sp_execute 6,N'01__',N'01' go select * from yc_yscx3 where khlx='1' order by dj go set implicit_transactions on go declare @p1 int set @p1=9 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000),@P2 nvarchar(4000),@P3 nvarchar(4000),@P4 nvarchar(4000),@P5 nvarchar(4000),@P6 int,@P7 nvarchar(4000),@P8 nvarchar(4000),@P9 nvarchar(4000),@P10 nvarchar(4000),@P11 nvarchar(4000),@P12 nvarchar(4000),@P13 nvarchar(4000),@P14 nvarchar(4000),@P15 nvarchar(4000),@P16 nvarchar(4000),@P17 nvarchar(4000),@P18 nvarchar(4000)',N'insert into yb_dbys2 (jgbm,rq,jyztjg,fwjg,yscx,fs,lc,ddml,czy,zpsj,dbje, jcf,wxzf,zfje, xjje,tcf,lqf, jyh, jyf) values (@P0,@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12,@P13,@P14,@P15,@P16,@P17,@P18) ',N'0107',N'20230516',N'1',N'230',N'黑AF92E7',N'苟福东',152674,N'行车记录仪',N'0107001',N'0',N'0',N'0',N'无',N'0',N'230',N'0',N'0',N'',N'0' select @p1 go IF @@TRANCOUNT > 0 COMMIT TRAN go IF @@TRANCOUNT > 0 COMMIT TRAN set implicit_transactions off go select isnull(max(session_id),0) from sys.dm_tran_session_transactions go exec sp_execute 1,N'0107___',N'0107' go select '' as yscx, 0 as dj, '' as jykh union select plate as yscx, length as dj, GPS_state as jykh from yc_cars where GPS_pass = '0107' order by yscx go select * from yc_yscx2 order by dj go select t.*,a.jgmc from yb_dbys2 t,yc_jgzd a where t.jgbm like '0107%' and t.rq = '20230516' and t.jgbm = a.jgbm order by jyztjg go select driver_name, driver_ID from yc_drivers where agency = '0107' order by driver_ID go set implicit_transactions on go exec sp_execute 9,N'0107',N'20230516',N'1',N'230',N'黑AK7459',N'苟福东',116740,N'行车记录仪',N'0107001',N'0',N'0',N'0',N'无',N'0',N'230',N'0',N'0',N'',N'0' go IF @@TRANCOUNT > 0 COMMIT TRAN go IF @@TRANCOUNT > 0 COMMIT TRAN set implicit_transactions off go select isnull(max(session_id),0) from sys.dm_tran_session_transactions go exec sp_execute 1,N'0107___',N'0107' go select '' as yscx, 0 as dj, '' as jykh union select plate as yscx, length as dj, GPS_state as jykh from yc_cars where GPS_pass = '0107' order by yscx go select * from yc_yscx2 order by dj go select t.*,a.jgmc from yb_dbys2 t,yc_jgzd a where t.jgbm like '0107%' and t.rq = '20230516' and t.jgbm = a.jgbm order by jyztjg go select driver_name, driver_ID from yc_drivers where agency = '0107' order by driver_ID go select t.*,t2.jgmc sjjgmc from DIC_CUSTOMER_ADVANCE t left outer join yc_jgzd t2 on t.Fld_Station_Code = t2.jgbm where t.Fld_Customer_Type='2' and t.Fld_Station_Code like '01%' order by t.Fld_Customer_Code go exec sp_execute 6,N'01__',N'01' go select * from yc_yscx3 where khlx='2' order by dj go select t.*,t2.jgmc sjjgmc from DIC_CUSTOMER_ADVANCE t left outer join yc_jgzd t2 on t.Fld_Station_Code = t2.jgbm where t.Fld_Customer_Type='1' and t.Fld_Station_Code like '01%' order by t.Fld_Customer_Code go set implicit_transactions on go declare @p1 int set @p1=10 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000)',N' select t.*,t2.jgmc sjjgmc from DIC_CUSTOMER_ADVANCE t left outer join yc_jgzd t2 on t.Fld_Station_Code = t2.jgbm where Fld_Station_Code like @P0 and Fld_Customer_Type = @P1 and Fld_Customer_Class in (''总包价格(元)'') and Fld_Customer_Name like ''%上马科技有限公司%'' and Fld_Parent_Code in (''110010'') and Fld_Customer_Code in (''110017'') ',N'0111%',N'2' select @p1 go select t.*,t2.jgmc sjjgmc from DIC_CUSTOMER_ADVANCE t left outer join yc_jgzd t2 on t.Fld_Station_Code = t2.jgbm where t.Fld_Customer_Type='1' and t.Fld_Station_Code like '01%' order by t.Fld_Customer_Code go exec sp_execute 6,N'01__',N'01' go select * from yc_yscx3 where khlx='2' order by dj go select t.*,t2.jgmc sjjgmc from DIC_CUSTOMER_ADVANCE t left outer join yc_jgzd t2 on t.Fld_Station_Code = t2.jgbm where t.Fld_Customer_Type='2' and t.Fld_Station_Code like '01%' order by t.Fld_Customer_Code go exec sp_execute 6,N'01__',N'01' go select * from yc_yscx3 where khlx='2' order by dj go select t.*,t2.jgmc sjjgmc from DIC_CUSTOMER_ADVANCE t left outer join yc_jgzd t2 on t.Fld_Station_Code = t2.jgbm where t.Fld_Customer_Type='1' and t.Fld_Station_Code like '01%' order by t.Fld_Customer_Code go declare @p1 int set @p1=11 exec sp_prepexec @p1 output,N'@P0 nvarchar(4000),@P1 nvarchar(4000),@P2 nvarchar(4000),@P3 nvarchar(4000),@P4 float,@P5 float,@P6 float,@P7 float,@P8 nvarchar(4000),@P9 nvarchar(4000),@P10 nvarchar(4000),@P11 nvarchar(4000),@P12 nvarchar(4000),@P13 nvarchar(4000)',N' insert into DIC_CUSTOMER_ADVANCE01 (Fld_Station_Code,Fld_Customer_Code, Fld_Customer_Type, Fld_Project_Code, Fld_Customer_Level, Fld_Fee_Balance,Fld_Id, Fld_Pz_Balance,Fld_Account_No,Fld_Customer_Name,Fld_Customer_Address,Fld_Customer_Phone,Fld_Customer_Linkman,Fld_Customer_Fax,Fld_Customer_Mobile, Fld_Parent_Code,Fld_Customer_Class,Fld_Distract_Station_Code,Fld_Update_Flag,Fld_Start_Date) values(@P0,@P1,@P2,@P3,''1'',@P4,@P5,@P6,@P7,@P8,@P9,'''','''',0,0,@P10,@P11,@P12,@P13,convert(varchar(8),getdate(),112)) ',N'0111',N'110017',N'2',N'',0,0,0,0,N'上马科技有限公司',N'上马科技',N'110010',N'总包价格(元)',N'哈东多联营业部',N'0' select @p1 go select t.*,t2.jgmc sjjgmc from DIC_CUSTOMER_ADVANCE t left outer join yc_jgzd t2 on t.Fld_Station_Code = t2.jgbm where t.Fld_Customer_Type='2' and t.Fld_Station_Code like '01%' order by t.Fld_Customer_Code go select t.*,t2.jgmc sjjgmc from DIC_CUSTOMER_ADVANCE t left outer join yc_jgzd t2 on t.Fld_Station_Code = t2.jgbm where t.Fld_Customer_Type='1' and t.Fld_Station_Code like '01%' order by t.Fld_Customer_Code go exec sp_execute 6,N'01__',N'01' go select * from yc_yscx3 where khlx='2' order by dj go select isnull(max(session_id),0) from sys.dm_tran_session_transactions go exec sp_execute 9,N'0107',N'20230516',N'1',N'230',N'黑AF88G8',N'孙晓飞',108968,N'行车记录仪',N'0107001',N'0',N'0',N'0',N'无',N'0',N'230',N'0',N'0',N'',N'0' go select isnull(max(session_id),0) from sys.dm_tran_session_transactions go exec sp_execute 1,N'0107___',N'0107' go select '' as yscx, 0 as dj, '' as jykh union select plate as yscx, length as dj, GPS_state as jykh from yc_cars where GPS_pass = '0107' order by yscx go select * from yc_yscx2 order by dj go select t.*,a.jgmc from yb_dbys2 t,yc_jgzd a where t.jgbm like '0107%' and t.rq = '20230516' and t.jgbm = a.jgbm order by jyztjg go select driver_name, driver_ID from yc_drivers where agency = '0107' order by driver_ID go exec sp_execute 6,N'01__',N'01' go select * from DIC_CUSTOMER_ADVANCE where Fld_Station_Code like '01%' and Fld_Customer_Type='1' order by Fld_Customer_Code go exec sp_execute 6,N'01__',N'01' go select * from DIC_CUSTOMER_ADVANCE01 where Fld_Station_Code like '01%' and Fld_Customer_Type='' order by Fld_Customer_Code go select * from ( select t.pkid,t.jgbm,t.rq,t.jyztjg,t.fwjg,t.yscx,t.fs,t.lc,t.ddml,isnull(convert(varchar(12),t.czrq,112),'') czrq,t.czy,t.zt,isnull(convert(varchar(12),t.qrrq,112),'') qrrq, isnull(t.qrczy,'') qrczy,t.khlx,a.jgmc,b.Fld_Customer_Name as jyztmc,isnull(convert(varchar(12),qrrq,112),'') as qrrq1,dbje from tv_dbys3 t,yc_jgzd a,DIC_CUSTOMER_ADVANCE b where t.rq between '20230501' and '20230517' and b.Fld_Customer_type <= '2' and t.jgbm like '01%' and t.jgbm = a.jgbm and t.jyztjg = b.Fld_Customer_Code and t.khlx =b.Fld_Customer_Type union select 0 pkid,'ZZZZ' jgbm,'-' rq,'-' jyztjg,sum(fwjg) fwjg,'-' yscx,'-' fs,sum(lc) lc, sum(ddml) ddml,'-' czrq,'-' czy,'-' zt,'-' qrrq, '-' qrczy,'-' khlx,'合 计' jgmc,'-'jyztmc,'-' qrrq1,sum(dbje) dbje from tv_dbys3 t,yc_jgzd a,DIC_CUSTOMER_ADVANCE b where t.rq between '20230501' and '20230517' and b.Fld_Customer_type <= '2' and t.jgbm like '01%' and t.jgbm = a.jgbm and t.jyztjg = b.Fld_Customer_Code and t.khlx =b.Fld_Customer_Type ) t order by jgbm,jyztjg,rq go exec sp_execute 6,N'01__',N'01' go select * from DIC_CUSTOMER_ADVANCE01 where Fld_Station_Code like '01%' and Fld_Customer_Type='' order by Fld_Customer_Code go select * from ( select t.pkid,t.jgbm,t.rq,t.jyztjg,t.fwjg,t.yscx,t.fs,t.lc,t.ddml,isnull(convert(varchar(12),t.czrq,112),'') czrq,t.czy,t.zt,isnull(convert(varchar(12),t.qrrq,112),'') qrrq, isnull(t.qrczy,'') qrczy,t.khlx,a.jgmc,b.Fld_Customer_Name as jyztmc,isnull(convert(varchar(12),qrrq,112),'') as qrrq1,dbje from tv_dbys3 t,yc_jgzd a,DIC_CUSTOMER_ADVANCE b where t.rq between '20230401' and '20230517' and b.Fld_Customer_type <= '2' and t.jgbm like '01%' and t.jgbm = a.jgbm and t.jyztjg = b.Fld_Customer_Code and t.khlx =b.Fld_Customer_Type union select 0 pkid,'ZZZZ' jgbm,'-' rq,'-' jyztjg,sum(fwjg) fwjg,'-' yscx,'-' fs,sum(lc) lc, sum(ddml) ddml,'-' czrq,'-' czy,'-' zt,'-' qrrq, '-' qrczy,'-' khlx,'合 计' jgmc,'-'jyztmc,'-' qrrq1,sum(dbje) dbje from tv_dbys3 t,yc_jgzd a,DIC_CUSTOMER_ADVANCE b where t.rq between '20230401' and '20230517' and b.Fld_Customer_type <= '2' and t.jgbm like '01%' and t.jgbm = a.jgbm and t.jyztjg = b.Fld_Customer_Code and t.khlx =b.Fld_Customer_Type ) t order by jgbm,jyztjg,rq go