/********************************************************************************name:usp_biz_contractgetbyid* *desc: Delete Item (delete all child tables) * * * * **return values:** **parameters:**auth:**date:2008-7-13****************************** /alter proc Usp_biz_contractgetbyid@contractid Uniqueidentifierasbeginselect dbo.uf_getcontractpartyname (A.partya) Partyaname,dbo.uf_getcontractpartyname (A. PARTYB) Partybname,dbo.uf_getcontractpartyname (A.PARTYC) partycname, IsNull (P.code, ') + '. ' + IsNull (p.packagename, ' ') + IsNull (Dbo.uf_getdictname (69,c.projproperty), ') Projectname,dbo.uf_getdictname (1,investmoneytype) Investmoneytypename,c.projectid,bidtype.typeid,c.name Projectname,c.code Projectcode, dbo.uf_ Getcontractpartydutypersonname (Partya) partyadutypersonname,dbo.uf_getcontractpartydutypersonname (PartyB) Partybdutypersonname,dbo.uf_getdictname (1,feetype) Feetypename,*from tbl_biz_contract A
Left Join tbl_biz_invitebidprojdetail bon A.invitebidtypeid = B.invitebidtypeid
Left join Tbl_biz_invitebidtype bidtype on bidtype.invitebidtypeid = A.invitebidtypeid
Left join Tbl_cfg_project con bidtype.projectid = C.projectid
Left Join Tbl_cfg_projectpackage Pon c.packageid = p.packageidwhere [email protected] END
ALTER FUNCTION [dbo]. [Uf_getcontractpartyname] (@ContractPartyID as uniqueidentifier) RETURNS varchar (asbegindeclare @Ret varchar) SELECT @Ret =partyname from tbl_biz_contractpartyinfo WHERE Contractpartyid = @ContractPartyIDRETURN @RetEND
/* Get the Dictionary data name */alter FUNCTION [dbo]. [Uf_getdictname] (@ParentID as int, @id as int) RETURNS varchar (asbegindeclare) @Ret varchar () SELECT @Ret =name from tblcommondict WHERE id = @idRETURN @RetEND
ALTER FUNCTION [dbo]. [Uf_getcontractpartydutypersonname] (@ContractPartyID as uniqueidentifier) RETURNS varchar (asbegindeclare @Ret varchar) SELECT @Ret =dutypersonname from tbl_biz_contractpartyinfo WHERE Contractpartyid = @ContractPartyIDRETURN @RetEND
SQL Stored procedure Call function