大家看看这个触发器是干什么用的呀
FOR INSERT
AS
declare @parentid int
declare @topicusername varchar(50)
declare @postid int,@posttime datetime,@username varchar(50)
declare @forumname varchar(50)
declare @icon tinyint
declare @subject varchar(80)
declare @usejf bit
declare @topicRatings int
declare @replyRatings int
declare @jf int
declare @attachment bit,@encrypt bit
select @attachment=attachment,@encrypt=encrypt,@TopicRatings=isnull(topicRatings,0),@ReplyRatings=isnull(ReplyRatings,0),@forumname=inserted.forumname,@icon=inserted.icon,@subject=inserted.subject,@parentid=isnull(parentid,0),@postid=postid, @username=username,@posttime=posttime,@usejf=forum.jf from inserted inner join forum on inserted.forumname=forum.forumname
if (@parentid =0)
/*主题*/
begin
set @jf=@topicRatings
update post set attachmentfilename=(case when isnull(attachmentfilename,'')<>'' then convert(nvarchar(255),@postid)+'-'+attachmentfilename else null end),attachments=@attachment,encrypts=@encrypt,replycount=0,lastreplyusername=@username,lastreplyposttime=@posttime where postid=@postid
if (@usejf=1)
begin
update register set postcount=isnull(postcount,0)+1,jf=isnull(jf,0)+@jf where lower(username)=lower(@username)
end
update forum set lastpostusername=@username,topiccount=isnull(topiccount,0)+1,lastpostid=@postid,lastposttime=@posttime,lastposticon=@icon,lastpostsubject=@subject from forum where forumname=@forumname
end
else
/*跟贴*/
begin
set @jf=@replyRatings
update post set attachmentfilename=(case when isnull(attachmentfilename,'')<>'' then convert(nvarchar(255),@postid)+'-'+attachmentfilename else null end),attachments=@attachment,encrypts=@encrypt where postid=@postid
update post set attachments=isnull(attachments,0)+@attachment,encrypts=isnull(encrypts,0)+@encrypt,replycount=isnull(replycount,0)+1,lastreplyusername=@username,lastreplyposttime=@posttime where postid=@parentid
if (@usejf=1)
begin
update register set jf=isnull(jf,0)+@jf,postcount=isnull(postcount,0)+1 where lower(username)=lower(@username)
end
else
begin
update register set postcount=isnull(postcount,0)+1 where lower(username)=lower(@username)
end
update forum set lastpostusername=@username
,replycount=isnull(replycount,0)+1,
lastpostid=@parentid,lastposttime=@posttime,lastposticon=@icon,lastpostsubject=@subject from forum where forumname=@forumname
end
相关推荐
触发器的分类
基本触发器:★与非门组成基本触发器,或非门组成基本触发器;同步触发器:★同步RS触发器,★同步D触发器;主从触发器:★主从RS触发器,★主从JK触发器;边沿触发器:★边沿D触发器,★边沿JK触发器;施密特触发器:★用555定时器构成的施密特触发器;单稳态触发器:用555定时器构成的单稳态触发器。 双稳态器件有两类:一类是触发器,一类是锁存器。锁存器是触发器的原始形
【FGPA】Verilog:JK 触发器 | D 触发器 | T 触发器 | D 触发器的实现
JK 触发器是 RS 触发器和 T 触发器的组合。它有两个输入端 J 和 K,如果两个输入端都等于 1,则将当前值反转。
触发器的应用
触发器
四驱PHEV、插电式混合动力汽车+DM混动系统P2+P4+发动机(三擎四驱)Matlab仿真
内容概要:本文系统解读了一套完整的多机器人路径规划(MAPF)MATLAB代码库,旨在解决在共享环境中为多个智能体寻找无冲突路径的核心问题。文章采用几何、拓扑、调度与呈现四层架构,详细阐述了地图解析、四邻域拓扑与Petri网构建、基于优先级启发式的路径规划、时间同步与冲突消解,以及可视化等关键技术环节。核心设计思想为空间规划与时间消解分离,通过动态边权膨胀、节点预留历史、几何惩罚驱动的局部同步等机制有效提升算法效率与可扩展性。文中深入分析了三种时间同步策略的适用场景与性能取舍,并强调了可视化在算法验证中的关键作用,为构建可复现、可扩展的MAPF仿真系统提供了详尽的技术参考。; 适合人群:具备一定MATLAB编程基础,从事机器人、自动化、智能交通、无人机编队等相关领域研究的研发人员及研究生。; 使用场景及目标:① 学习并掌握多机器人路径规划中的优先级规划与冲突消解核心算法;② 理解并应用基于Petri网的整数规划求解方法;③ 构建并优化可复现、可扩展的MAPF仿真系统,服务于仓储物流、自动驾驶、无人机集群等实际应用场景;④ 提升MATLAB工程化开发能力与复杂算法的可视化水平。; 阅读建议:建议读者结合提供的MATLAB代码与MovingAI标准地图数据,严格按照章节顺序逐步实践,重点关注各模块间的接口设计、性能优化策略及“信息前移”的工程思想,并通过调整智能体数量、地图复杂度等参数,全面验证算法的鲁棒性与效率。
产业园区运营负责人如何利用平台提升园区内企业与科研机构的协同创新能力?.docx
科易网基于40亿+科创知识图谱数据库,深度探索AI技术在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,研究科技创新领域的AI+数智化解决方案,推动科技创新与产业创新智能化发展。


