46 lines
2.0 KiB
Transact-SQL
46 lines
2.0 KiB
Transact-SQL
ALTER VIEW [dbo].[View_SitePerson_Checking]
|
|
AS
|
|
/*ÈËÔ±¿¼ÇÚÊÓͼ*/
|
|
SELECT ch.CheckingId,person.CardNo,ch.ProjectId,person.IdentityCard,ch.WorkAreaId,ch.IntoOutTime,ch.IntoOut,
|
|
ch.[Address],ch.WorkAreaName,person.PersonName,person.UnitId,unit.UnitName,ch.States
|
|
from dbo.SitePerson_Checking ch
|
|
left join dbo.SitePerson_Person person on ch.PersonId=person.PersonId
|
|
left join dbo.Base_Unit unit on person.UnitId=unit.UnitId
|
|
|
|
|
|
GO
|
|
|
|
UPDATE SitePerson_Checking SET IntoOut=0 WHERE IntoOut !=1
|
|
GO
|
|
/****** Object: Index [NonClusteredIndex-20210720-112756] Script Date: 2021/7/20 11:31:47 ******/
|
|
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20210720-112756] ON [dbo].[t_d_facerecord]
|
|
(
|
|
[ProjectId] ASC,
|
|
[EmployNO] ASC,
|
|
[RoleID] ASC,
|
|
[DateTimeRecord] ASC
|
|
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
|
GO
|
|
|
|
/****** Object: Index [NonClusteredIndex-20210720-113607] Script Date: 2021/7/20 11:36:59 ******/
|
|
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20210720-113607] ON [dbo].[t_d_EmployInOutRecord]
|
|
(
|
|
[ProjectId] ASC,
|
|
[RecordDate] ASC,
|
|
[IDCardNo] ASC
|
|
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
|
GO
|
|
|
|
/****** Object: Index [SitePerson_PersonInOut_PersonIdChangeTime] Script Date: 2021/7/20 11:38:07 ******/
|
|
DROP INDEX [SitePerson_PersonInOut_PersonIdChangeTime] ON [dbo].[SitePerson_PersonInOut]
|
|
GO
|
|
|
|
/****** Object: Index [SitePerson_PersonInOut_PersonIdChangeTime] Script Date: 2021/7/20 11:38:07 ******/
|
|
CREATE NONCLUSTERED INDEX [SitePerson_PersonInOut_PersonIdChangeTime] ON [dbo].[SitePerson_PersonInOut]
|
|
(
|
|
[ProjectId] ASC,
|
|
[PersonId] ASC,
|
|
[ChangeTime] ASC
|
|
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
|
GO
|