mysql数据库中的出发器

 

 

 

 

//   Triger_flow_group_user_Insert

BEGIN
	SET new.fid=REPLACE(UUID(),'-','');
	set new.userName=(select ifnull(name,real_name) as name from blade_user where account=new.userNo);
	set new.userId=(SELECT id  FROM blade_user WHERE account=new.userNo);
    END




//   Triger_flow_group_user_Update

BEGIN
	SET new.userName=(SELECT IFNULL(NAME,real_name) AS NAME FROM blade_user WHERE account=new.userNo);
	SET new.userId=(SELECT id  FROM blade_user WHERE account=new.userNo);
    END

  

posted @ 2021-05-15 11:06  红尘沙漏  阅读(52)  评论(0编辑  收藏  举报