feat: refs #7823 refs#7823 selectPrinterFreely
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
d7449c00f6
commit
0ed7118786
|
@ -1,22 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`printer_checkSector`(vLabelerFk tinyint(3) unsigned, vSector INT(11))
|
||||
BEGIN
|
||||
/**
|
||||
* Comprueba si la impresora pertenece al sector
|
||||
*
|
||||
* @param vLabelerFk id de la impresora
|
||||
* @param vSector sector a comprobar
|
||||
*/
|
||||
DECLARE isPrinterInNewSector BOOL;
|
||||
|
||||
IF vLabelerFk IS NOT NULL THEN
|
||||
SELECT COUNT(sectorFK) INTO isPrinterInNewSector
|
||||
FROM vn.printer p
|
||||
WHERE id = vLabelerFk AND sectorFk = vSector;
|
||||
|
||||
IF !isPrinterInNewSector THEN
|
||||
CALL util.throw("PrinterNotInSameSector");
|
||||
END IF;
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,8 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`operator_beforeInsert`
|
||||
BEFORE INSERT ON `operator`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
CALL vn.printer_checkSector(NEW.labelerFk, NEW.sectorFk);
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,10 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`operator_beforeUpdate`
|
||||
BEFORE UPDATE ON `operator`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
IF NOT (NEW.labelerFk <=> OLD.labelerFk AND NEW.sectorFk <=> OLD.sectorFk) THEN
|
||||
CALL vn.printer_checkSector(NEW.labelerFk, NEW.sectorFk);
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1 @@
|
|||
-- Place your SQL code here
|
Loading…
Reference in New Issue