Files
2026-07-10 15:25:05 +08:00

83 lines
3.4 KiB
Transact-SQL

/****** Object: View [dbo].[v_systemcontrolLocation] Script Date: 12/09/2014 16:13:50 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER view [dbo].[v_systemcontrolLocation]
as
select id,fieldName,username1 as userName, a.fieldsqlTag as fieldTypeId,
fieldsqlid as lookupKeyField,fieldsqlname as lookupResult,fieldsql as lookupSql,a.tagid as nullable,
defaultdate as defaultValue,edit as edited,controlHeight,controlLeft,
controlWidth,controlTop,b.formKey,a.OrderId,a.privilegeView,a.privilegeOper,
a.addVisible as visible,isnull(a.autoNo,0) as autoNo,unionFields,unionValue,ShowMobile,
a.addModuleId,c.AddDllName as addDllName,c.ToolsName as addModuleName,calcExpr
from
p_systemwordbooktab a
left join p_systemDlltab b on a.tab=b.DllCoid
left join p_systemdlltab c on a.addmoduleid=c.DllCoid and isnull(a.AddModuleId,'')<>''
where isnull(a.addVisible,0)=0
union all
select a.id,fieldName,userName,fieldTypeId,
lookupKeyField,lookupResult,lookupSql,nullable,
defaultValue,edited,controlHeight,controlLeft,
controlWidth,controlTop,b.formKey,a.orderid, privilegeview,privilegeoper,
a.isVisible,ISNULL( a.autoNo,0) as autoNo,unionFields,unionValue,ShowMobile,
a.addModuleId,c.AddDllName as addDllName,c.ToolsName as addModuleName,a.calcExpr
from
p_systembillInfo a
left join p_systembilltype b on a.typeCode=b.typeCode
left join p_systemdlltab c on a.addmoduleid=c.DllCoid and isnull(a.AddModuleId,'')<>''
where isnull(a.isVisible,0)=0
union all
select a.id,a.controlName as fieldname,a.controlLabel as username,a.controlType as fieldtypeid,
a.keyField as lookupkeyfield,a.resultField as lookupResult,a.sourceSql as lookupSql,0 as nullable,
a.defaultValue,0 as edited,a.controlHeight,a.controlLeft,a.controlWidth,a.controlTop,b.formkey,
a.orderid,'' as privilegeview,'' as privilegeoper,0 as visible,0 as autoNo,null as unionFields,null as unionValue,ShowMobile,
null as addModuleId,null as addDllName,null as addModuleName,null as calcExpr
from p_systembillsourcecond a
left join p_systembillsource b on a.sourceId=b.id and a.formKey=b.formKey
where a.formKey is not null and b.formKey is not null
union all
select a.id,a.controlName as fieldname,a.controlLabel as username,a.controlType as fieldtypeid,
a.keyField as lookupkeyfield,a.resultField as lookupresult,a.sourceSql as lookupsql,0 as nullable,
a.defaultValue,0 as edited,a.controlHeight,a.controlLeft,a.controlWidth,a.controlTop,b.condKey as formkey,
a.orderid, '' as privilegeview, '' as privilegeoper,0 as visible,0 as autoNo,null as unionFields,null as unionValue,ShowMobile,
null as addModuleId,null as addDllName,null as addModuleName,null as calcExpr
from p_systembillsourcecond a
left join p_systemDlltab b on a.sourceId=b.DllID and a.formKey=b.condKey
where a.formKey is not null and b.formKey is not null
--×ó±ßÌõ¼þ
union all
select a.id,a.controlName as fieldname,a.controlLabel as username,a.controlType as fieldtypeid,
a.keyField as lookupkeyfield,a.resultField as lookupresult,a.sourceSql as lookupsql,0 as nullable,
a.defaultValue,0 as edited,a.controlHeight,a.controlLeft,a.controlWidth,a.controlTop,b.fieldKey as formkey,
a.orderid, '' as privilegeview, '' as privilegeoper,0 as visible,0 as autoNo,null as unionFields,null as unionValue,a.ShowMobile,
null as addModuleId,null as addDllName,null as addModuleName,null as calcExpr
from p_systembillsourcecond a
left join p_systemwordbooktab b on a.formKey=b.fieldKey
where a.formKey is not null and b.formKey is not null
GO