如何使用give表编写队列以根据位置和班次维护用户? [英] how to write queue with give table to maintain users based on location and shift?
问题描述
队列逻辑:FIFO(查询应基于将表分配给一周的日期从该表中获取一组用户.查询应按计算机组所在的位置进行过滤.分配时,您必须检查是否有效无效,请忽略该用户,再尝试下一个用户.已更新的用户集的更新日期为队列表中的开始日期.
桌子
QueueTable(列:审核员,位置,日期)
机器(列:机器名称,m_no,位置)
组(列:组名,组号,位置,班次)
周表(今天,周,周1,周2,周3)[周是当前周,周1,是当前周的下一个周,周2是周1,下一个,....很快]
帮助我写队列或以其他理由建议我类似的过程或服务
在此先感谢
谢谢与问候
vamsi krishna
Queue Logic : FIFO ( Query should get a set of users from this table based on the date assign them to a week . Query should filtered by location in which the machine group is present. While assigning you have to check the validity if not valid ignore that user try the next user. The set of user that are updated will have updated date which is week start date in the queue table.
Tables
QueueTable (columns: Auditor, Location, Date)
machine(columns : machine_name,m_no,location)
group(columns:groupname,groupnumber,location ,shift)
weektable(today,weeek,week1,week2,week3)[week is current week,week1,is next to current week,week2 is next to week1,....soon]
help me to write queue or sugget me any other like procedure or service with reason
thanks in advance
Thanks&Regards
vamsi krishna
推荐答案
create procedure sp_schedule
as declare @qid int
declare @loc varchar(30)
begin TRANSACTION tran1
select top 1 @qid = q_id,@loc=location from QueueTable where
QueueTable.audit_date =(select top 1 audit_Date from queuetable order by audit_Date asc)
update queuetable set audit_date=GETDATE() where @qid=q_id and @loc=Location
commit tran1
这篇关于如何使用give表编写队列以根据位置和班次维护用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!