|
@@ -284,9 +284,13 @@ CREATE DEFINER = `root`@`%` TRIGGER `lucene_trade_goods_i` AFTER INSERT ON `trad
|
|
|
declare v_data text default 'goId';
|
|
declare v_data text default 'goId';
|
|
|
declare v_priority int default 0;
|
|
declare v_priority int default 0;
|
|
|
|
|
|
|
|
- if new.cmp_uuid then
|
|
|
|
|
|
|
+ if new.cmp_uuid is not null then
|
|
|
set v_data='cmpId';
|
|
set v_data='cmpId';
|
|
|
select cmp_id into v_data_id from product$component where cmp_uuid=new.cmp_uuid;
|
|
select cmp_id into v_data_id from product$component where cmp_uuid=new.cmp_uuid;
|
|
|
|
|
+ if v_data_id is null then
|
|
|
|
|
+ set v_data=concat('cmp_uuid 没有关联的器件:', new.cmp_uuid);
|
|
|
|
|
+ set v_data_id=new.go_id;
|
|
|
|
|
+ end if;
|
|
|
else
|
|
else
|
|
|
set v_data_id=new.go_id;
|
|
set v_data_id=new.go_id;
|
|
|
end if;
|
|
end if;
|
|
@@ -307,9 +311,13 @@ CREATE DEFINER = `root`@`%` TRIGGER `lucene_trade_goods_u` AFTER UPDATE ON `trad
|
|
|
declare v_data text default 'goId';
|
|
declare v_data text default 'goId';
|
|
|
declare v_priority int default 0;
|
|
declare v_priority int default 0;
|
|
|
|
|
|
|
|
- if old.cmp_uuid then
|
|
|
|
|
|
|
+ if old.cmp_uuid is not null then
|
|
|
set v_data='cmpId';
|
|
set v_data='cmpId';
|
|
|
select cmp_id into v_data_id from product$component where cmp_uuid=old.cmp_uuid;
|
|
select cmp_id into v_data_id from product$component where cmp_uuid=old.cmp_uuid;
|
|
|
|
|
+ if v_data_id is null then
|
|
|
|
|
+ set v_data=concat('cmp_uuid 没有关联的器件:', old.cmp_uuid);
|
|
|
|
|
+ set v_data_id=old.go_id;
|
|
|
|
|
+ end if;
|
|
|
else
|
|
else
|
|
|
set v_data_id=old.go_id;
|
|
set v_data_id=old.go_id;
|
|
|
end if;
|
|
end if;
|
|
@@ -330,9 +338,13 @@ CREATE DEFINER = `root`@`%` TRIGGER `lucene_trade_goods_d` AFTER DELETE ON `trad
|
|
|
declare v_data text default 'goId';
|
|
declare v_data text default 'goId';
|
|
|
declare v_priority int default 0;
|
|
declare v_priority int default 0;
|
|
|
|
|
|
|
|
- if old.cmp_uuid then
|
|
|
|
|
|
|
+ if old.cmp_uuid is not null then
|
|
|
set v_data='cmpId';
|
|
set v_data='cmpId';
|
|
|
select cmp_id into v_data_id from product$component where cmp_uuid=old.cmp_uuid;
|
|
select cmp_id into v_data_id from product$component where cmp_uuid=old.cmp_uuid;
|
|
|
|
|
+ if v_data_id is null then
|
|
|
|
|
+ set v_data=concat('cmp_uuid 没有关联的器件:', old.cmp_uuid);
|
|
|
|
|
+ set v_data_id=old.go_id;
|
|
|
|
|
+ end if;
|
|
|
else
|
|
else
|
|
|
set v_data_id=old.go_id;
|
|
set v_data_id=old.go_id;
|
|
|
end if;
|
|
end if;
|