- 1
- 0
- 约2.65千字
- 约 21页
- 2016-12-05 发布于贵州
- 举报
第10章 员工考勤信息 管理2员工考勤 员工考勤模块 系统功能概述 员工考勤模块主要实现员工的上下班考勤管理功能,同时还可以查看公司所有员工的考勤详细情况及考勤设置。 该模块将全部采用存储过程完成对数据库的操作,主要包含签到、签离、考勤查询、考勤设置等功能。 系统功能概述 从系统基本功能概述上分析系统流程: 考勤设置 签到 签离 考勤查询 数据库设计 数据库设计 数据库设计 员工考勤 员工考勤功能概述 该模块实现员工的上班签到,输入员工编号后回车进行签到,则将员工当时的签到记录写进表checkinrecord中。 存储过程分析 CREATE PROCEDURE employeeCheckInAccess @EmployeeID varchar(10), @CheckDate datetime, @CheckType int as declare @EmpID varchar(10) select @EmpID=empid from employee where employeeid=@EmployeeID insert into checkinrecord(empid,checkdate,checktype) values(@EmpID,@CheckDate,@CheckType) 查找员工考勤信息 存储过程分析 /* 查询员工的考勤记录 @EmployeeID 员工编号 为空表示查询所有员工考勤 @BeginDate 起始日期 @EndDate 截止日期 @CheckType 签到类型 @CheckInOut 签到签离 tempcheck 临时表 */ CREATE PROCEDURE getEmployeesCheck @EmployeeID varchar(10), @BeginDate datetime, @EndDate datetime, @CheckType varchar(10), @CheckInOut varchar(10) AS begin 存储过程分析 if exists(SELECT * from sysobjects where name=tempcheck) Drop table tempcheck select ci.empid,ci.checkdate,ct.checktype,checkinout=签到 into tempcheck from checkinrecord as ci,checktype as ct where ci.checktype=ct.checktypeid union select co.empid employeeid,co.checkoutdate,ct.checktype,checkinout=签离 from checkoutrecord as co,checktype as ct where co.checktype=ct.checktypeid order by empid,checkdate desc,checkinout asc 存储过程分析 if(@EmployeeID=) select ee.employeeid ,ee.employeename ,checkdate ,checktype,checkinout from tempcheck as tc,employee as ee where tc.empid=ee.empid and checkdate between @BeginDate and @EndDate and checktype like %+@CheckType+% and checkinout like %+@CheckInOut+% else 存储过程分析 select ee.employeeid ,ee.employeename ,checkdate ,checktype,checkinout from tempcheck as tc,employee as ee where tc.empid=ee.empid and ee.employeeid=@EmployeeID and checkdate between @BeginDate and @EndDate and checktype like %+@CheckType+% and checkinout like %+@CheckInOut+% --drop table tempcheck end 功能概述 实现对员工考勤信息的模糊查询。 可以查询某一员工在某一时间段、某一类型的考勤数据。 签离 员工考勤功能概述 该模块实现员工的签离,输入员工编号后回车进行签离,系统对输入的员工编号进行如下验证: 验证此
原创力文档

文档评论(0)