Auto commit
This commit is contained in:
parent
a2e6ffbfde
commit
d59764c856
@ -160,21 +160,18 @@ WHERE h.hid = r.hid AND r.price =(
|
||||
|
||||
#8 触发器
|
||||
DELIMITER $$
|
||||
DROP TRIGGER IF EXISTS tri_updateInteroduce;
|
||||
CREATE TRIGGER tri_updateInteroduce
|
||||
DROP TRIGGER IF EXISTS tri_updateIntroduce;
|
||||
CREATE TRIGGER tri_updateIntroduce
|
||||
BEFORE UPDATE ON t_hotel
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
IF NEW.`level` <> OLD.`level` THEN
|
||||
IF NEW.`level` IN ('一星', '二星') THEN
|
||||
IF NEW.`level` = '一星' OR NEW.`level` = '二星' THEN
|
||||
SET NEW.introduce = '实用';
|
||||
ELSEIF NEW.`level` IN ('三星', '四星') THEN
|
||||
ELSEIF NEW.`level` = '三星' OR NEW.`level` = '四星' THEN
|
||||
SET NEW.introduce = '豪华';
|
||||
ELSE
|
||||
ELSEIF NEW.`level` = '五星' THEN
|
||||
SET NEW.introduce = '奢华';
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
END $$
|
||||
DELIMITER ;
|
||||
|
||||
@ -188,8 +185,12 @@ BEGIN
|
||||
WHERE h.hid = r.hid AND r.rname = in_rname
|
||||
ORDER BY r.price
|
||||
LIMIT 1;
|
||||
|
||||
END $$
|
||||
DELIMITER ;
|
||||
|
||||
CALL pro_GetLowPrice('标准间', @result);
|
||||
SELECT @result;
|
||||
```
|
||||
|
||||
### 第三套
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user