SELECT * FROM PORT_EMP WHERE NO='18336309966'
SELECT * FROM PORT_DEPT WHERE no='42DBAF50712C4046B09BC561C26FAE7E'
SELECT * FROM PORT_STATIONTYPE
SELECT * FROM PORT_STATION
SELECT * FROM PORT_DEPTEMP
SELECT * FROM PORT_DEPTSTATION
SELECT * FROM PORT_DEPTEMPSTATION
EXEC SP_RENAME 'PORT_EMP', 'TEST_PORT_EMP'
EXEC SP_RENAME 'PORT_DEPT', 'TEST_PORT_DEPT'
EXEC SP_RENAME 'PORT_STATIONTYPE', 'TEST_PORT_STATIONTYPE'
EXEC SP_RENAME 'PORT_STATION', 'TEST_PORT_STATION'
EXEC SP_RENAME 'PORT_DEPTEMP', 'TEST_DEPTEMP'
EXEC SP_RENAME 'PORT_DEPTSTATION', 'TEST_PORT_DEPTSTATION'
EXEC SP_RENAME 'PORT_DEPTEMPSTATION', 'TEST_DEPTEMPSTATION'
--http://ccbpm.mydoc.io/
--http://demo.ccflow.org/
/*
* 1/岗位类型
*/
CREATE VIEW [DBO].[PORT_STATIONTYPE]
AS
SELECT No,Name,0 Idx,'' ORGNO FROM BAS_SysRoleType
/*
* 2/--岗位
*/
CREATE VIEW [DBO].[PORT_STATION]
AS
SELECT R.Roles_ID AS No,R.Roles_Name AS Name, R.FK_STATIONTYPE,'' DUTYREQ,''MAKINGS,0 ORGNO
FROM BAS_Roles R where R.DeleteMark !=0
/** 3 --部门
* --部门
* -- 组织机构表 类别 = 1, 机构 = 0 ,1
-- 删除 = 1,
--未删除 = 0
drop view [PORT_DEPT]
*
*/
CREATE VIEW [DBO].[PORT_DEPT]
AS
SELECT OID AS NO,ORGNAME AS NAME, PARENTOID AS ParentNo,
'' NAMEOFPATH, '' TREENO,'' LEADER,'' TEL,0 IDX,0 ISDIR ,ORDERNO AS ORGNO
FROM BAS_ORG where ISDEL =0 AND ISCATEGORY=0
--4--部门岗位【参考自己的业务表,多表联合查询】,一个部门可以有多个岗位
/*******************************************
* select * from BAS_ORG_STATION
* drop view [PORT_DEPTSTATION]
*******************************************/
CREATE VIEW [DBO].[PORT_DEPTSTATION]
AS
SELECT FK_Dept as FK_DEPT,FK_Station AS FK_STATION FROM BAS_ORG_STATION WHERE DELETEMARK !=0
--5--人员
/*******************************************
* SELECT * FROM TEST_PORT_EMP
select * from sys_persondefine
SELECT * FROM BAS_PERSON
SELECT * FROM BAS_ORG
drop view [PORT_EMP]
*******************************************/
CREATE VIEW [DBO].[PORT_EMP]
AS
SELECT SP.USERNAMEDecryp as NO,SP.USERNAME as ecrypname,BP.PERSONNAME as NAME,SP.PASSWORD as PASS,SP.DEPTOID as FK_DEPT,'' SID,
'' Tel,'' Email,'' PinYin,0 Idx
FROM sys_persondefine SP LEFT JOIN BAS_PERSON BP ON SP.USEROID = BP.OID
where SP.ISDEL =0 AND BP.ISDEL=0
-- --6部门人员
/*******************************************
* SELECT * FROM TEST_DEPTEMP
* DROP VIEW [PORT_DEPTEMP]
*******************************************/
CREATE VIEW [DBO].[PORT_DEPTEMP]
AS
SELECT DEPTOID+'-'+USEROID as MYPK,DEPTOID as FK_DEPT,USERNAMEDecryp as FK_EMP,USERNAME as ecrypname,'' FK_DUTY,'' DUTYLEVEL,'' LEADER
FROM sys_persondefine
--7--部门人员岗位【参考自己的业务表,多表联合查询】
/*******************************************
* SELECT * FROM BAS_ORG
select * from sys_persondefine where USEROID='01A9D3CC5EB64FC683FBEB13AF19374C'
SELECT * FROM BAS_PERSON
SELECT * FROM BAS_UserRole where User_ID='7907c44a14a949eeb6a4d6d1f4ca5dfe'
SELECT * FROM TEST_DEPTEMPSTATION
drop view [PORT_DEPTEMPSTATION]
*******************************************/
CREATE VIEW [DBO].[PORT_DEPTEMPSTATION]
AS
SELECT UR.UserRole_ID as MYPK,SP.DEPTOID as FK_DEPT,UR.Roles_ID as FK_STATION,SP.USERNAMEDecryp as FK_EMP,SP.USERNAME as ecrypname
FROM BAS_UserRole UR INNER JOIN sys_persondefine SP ON SP.USEROID = UR.User_ID AND SP.USERNAME = UR.UserAccount
select * from sys_persondefine where USEROID='7907c44a14a949eeb6a4d6d1f4ca5dfe'
SELECT * FROM BAS_UserRole where User_ID='7907c44a14a949eeb6a4d6d1f4ca5dfe'
4eJRh9QGSewr2ABqugfXjw==
/*******************************************
*
*******************************************/
SELECT OID as Organization_ID,ORGSHORTNAME as Organization_Name,PARENTOID as ParentId,'0' AS isUser,'1' AS DeleteMark FROM BAS_ORG
SELECT USEROID AS Organization_ID ,USERNAME AS User_Name,DEPTOID as Organization_ID,'1' AS isUser,ISDEL AS DeleteMark FROM sys_persondefine
sELECT OID as Organization_ID,ORGSHORTNAME as Organization_Name,PARENTOID as ParentId,'0' AS isUser,'1' AS DeleteMark FROM BAS_ORG UNION ALL
SELECT USEROID AS Organization_ID ,USERNAME AS User_Name,DEPTOID as Organization_ID,'1' AS isUser,ISDEL AS DeleteMark FROM sys_persondefine
SELECT OID as Organization_ID,ORGSHORTNAME as Organization_Name,PARENTOID as ParentId,'0' AS isUser,'0' AS DeleteMark,'0' AS PERSONNAME FROM BAS_ORG UNION ALL
SELECT SP.USEROID AS Organization_ID ,SP.USERNAME AS User_Name,SP.DEPTOID as Organization_ID,'1' AS isUser,SP.ISDEL AS DeleteMark,BP.PERSONNAME FROM sys_persondefine SP
LEFT JOIN BAS_PERSON BP ON SP.USEROID=BP.OID
SELECT * FROM BAS_ORG
SELECT * FROM sys_roledefine
SELECT * FROM SYS_ROLEMEMBERDEFINE
SELECT * FROM SYS_PHONEUSER
SELECT * FROM BAS_UserRole
SELECT * FROM BAS_RoleRight
SELECT * FROM BAS_UserRight
手机扫一扫
移动阅读更方便
你可能感兴趣的文章