Feat(SQL, UI): Button Icons page, Command Button Links page created with get and set functionality.
This commit is contained in:
@@ -1,21 +1,28 @@
|
||||
|
||||
USE demo;
|
||||
|
||||
DROP PROCEDURE IF EXISTS demo.p_dog_get_many_location;
|
||||
DROP PROCEDURE IF EXISTS demo.p_dog_get_many_button_icon;
|
||||
|
||||
DELIMITER //
|
||||
CREATE PROCEDURE demo.p_dog_get_many_location (
|
||||
CREATE PROCEDURE demo.p_dog_get_many_button_icon (
|
||||
IN a_id_user INT
|
||||
, IN a_get_all_location BIT
|
||||
, IN a_get_inactive_location BIT
|
||||
, IN a_ids_location TEXT
|
||||
, IN a_names_location TEXT
|
||||
, IN a_get_all_file_type BIT
|
||||
, IN a_get_inactive_file_type BIT
|
||||
, IN a_ids_file_type TEXT
|
||||
, IN a_names_file_type TEXT
|
||||
, IN a_get_all_image BIT
|
||||
, IN a_get_inactive_image BIT
|
||||
, IN a_ids_image TEXT
|
||||
, IN a_names_image TEXT
|
||||
, IN a_get_all_button_icon BIT
|
||||
, IN a_get_inactive_button_icon BIT
|
||||
, IN a_ids_button_icon TEXT
|
||||
, IN a_names_button_icon TEXT
|
||||
, IN a_notes_button_icon TEXT
|
||||
, IN a_require_all_id_search_filters_met BIT
|
||||
, IN a_require_any_id_search_filters_met BIT
|
||||
, IN a_require_all_non_id_search_filters_met BIT
|
||||
, IN a_require_any_non_id_search_filters_met BIT
|
||||
, IN a_output_LOCATIONS BIT
|
||||
, IN a_output_LOCATION_links BIT
|
||||
, IN a_debug BIT
|
||||
)
|
||||
BEGIN
|
||||
@@ -43,7 +50,7 @@ BEGIN
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error (
|
||||
id_error INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||
, id_type INT NULL
|
||||
, code VARCHAR(100) NOT NULL
|
||||
, code VARCHAR(250) NOT NULL
|
||||
, msg TEXT NOT NULL
|
||||
);
|
||||
|
||||
@@ -88,34 +95,46 @@ BEGIN
|
||||
|
||||
SET a_id_user := IFNULL(a_id_user, 0);
|
||||
/*
|
||||
SET a_get_all_location := IFNULL(a_get_all_location, 0);
|
||||
SET a_get_inactive_location := IFNULL(a_get_inactive_location, 0);
|
||||
SET a_ids_location := TRIM(IFNULL(a_ids_location, ''));
|
||||
SET a_names_location := TRIM(IFNULL(a_names_location, ''));
|
||||
SET a_hand_signal_default_descriptions_location := TRIM(IFNULL(a_hand_signal_default_descriptions_location, ''));
|
||||
SET a_notes_location := TRIM(IFNULL(a_notes_location, ''));
|
||||
SET a_get_all_file_type := IFNULL(a_get_all_file_type, 0);
|
||||
SET a_get_inactive_file_type := IFNULL(a_get_inactive_file_type, 0);
|
||||
SET a_ids_file_type := TRIM(IFNULL(a_ids_file_type, ''));
|
||||
SET a_names_file_type := TRIM(IFNULL(a_names_file_type, ''));
|
||||
SET a_get_all_image := IFNULL(a_get_all_image, 0);
|
||||
SET a_get_inactive_image := IFNULL(a_get_inactive_image, 0);
|
||||
SET a_ids_image := TRIM(IFNULL(a_ids_image, ''));
|
||||
SET a_names_image := TRIM(IFNULL(a_names_image, ''));
|
||||
SET a_get_all_button_icon := IFNULL(a_get_all_button_icon, 0);
|
||||
SET a_get_inactive_button_icon := IFNULL(a_get_inactive_button_icon, 0);
|
||||
SET a_ids_button_icon := TRIM(IFNULL(a_ids_button_icon, ''));
|
||||
SET a_names_button_icon := TRIM(IFNULL(a_names_button_icon, ''));
|
||||
SET a_notes_button_icon := TRIM(IFNULL(a_notes_button_icon, ''));
|
||||
SET a_require_all_id_search_filters_met := IFNULL(a_require_all_id_search_filters_met, 1);
|
||||
SET a_require_any_id_search_filters_met := IFNULL(a_require_any_id_search_filters_met, 1);
|
||||
SET a_require_all_non_id_search_filters_met := IFNULL(a_require_all_non_id_search_filters_met, 0);
|
||||
SET a_require_any_non_id_search_filters_met := IFNULL(a_require_any_non_id_search_filters_met, 1);
|
||||
*/
|
||||
SET a_output_LOCATIONS := IFNULL(a_output_LOCATIONS, 0);
|
||||
SET a_output_LOCATION_links := IFNULL(a_output_LOCATION_links, 0);
|
||||
SET a_debug := IFNULL(a_debug, 0);
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
a_id_user
|
||||
, a_get_all_location
|
||||
, a_get_inactive_location
|
||||
, a_ids_location
|
||||
, a_names_location
|
||||
, a_get_all_file_type
|
||||
, a_get_inactive_file_type
|
||||
, a_ids_file_type
|
||||
, a_names_file_type
|
||||
, a_get_all_image
|
||||
, a_get_inactive_image
|
||||
, a_ids_image
|
||||
, a_names_image
|
||||
, a_get_all_button_icon
|
||||
, a_get_inactive_button_icon
|
||||
, a_ids_button_icon
|
||||
, a_names_button_icon
|
||||
, a_notes_button_icon
|
||||
, a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met
|
||||
, a_output_LOCATIONS
|
||||
, a_output_LOCATION_links
|
||||
, a_debug
|
||||
;
|
||||
|
||||
@@ -129,23 +148,14 @@ BEGIN
|
||||
END IF;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Msg_Error;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Location_Link;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Location;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Button_Icon;
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_Location (
|
||||
id_location INT NOT NULL
|
||||
, code VARCHAR(100)
|
||||
CREATE TEMPORARY TABLE tmp_Button_Icon (
|
||||
id_button_icon INT NOT NULL
|
||||
, id_image INT
|
||||
, code VARCHAR(250)
|
||||
, name VARCHAR(250)
|
||||
, active BIT
|
||||
|
||||
, does_meet_id_filters BIT
|
||||
, does_meet_non_id_filters BIT
|
||||
);
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_Location_Link (
|
||||
id_link INT NOT NULL
|
||||
, id_location_parent INT
|
||||
, id_location_child INT
|
||||
, notes TEXT
|
||||
, active BIT
|
||||
|
||||
, does_meet_id_filters BIT
|
||||
@@ -155,7 +165,7 @@ BEGIN
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error (
|
||||
id_error INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||
, id_type INT NULL
|
||||
, code VARCHAR(100) NOT NULL
|
||||
, code VARCHAR(250) NOT NULL
|
||||
, msg TEXT NOT NULL
|
||||
);
|
||||
|
||||
@@ -226,7 +236,7 @@ BEGIN
|
||||
VALUES (
|
||||
v_id_type_error_no_permission
|
||||
, v_code_type_error_no_permission
|
||||
, 'You do not have permission to view Locations.'
|
||||
, 'You do not have permission to view Button_Icons.'
|
||||
)
|
||||
;
|
||||
END IF;
|
||||
@@ -237,16 +247,25 @@ BEGIN
|
||||
);
|
||||
|
||||
|
||||
-- Call Location Calc
|
||||
-- Call Button_Icon Calc
|
||||
IF NOT EXISTS(SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN demo.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
v_guid -- a_guid
|
||||
, a_id_user -- a_id_user
|
||||
, a_get_all_location -- a_get_all_location
|
||||
, a_get_inactive_location -- a_get_inactive_location
|
||||
, a_ids_location -- a_ids_location
|
||||
, a_names_location -- a_names_location
|
||||
, a_get_all_file_type -- a_get_all_file_type
|
||||
, a_get_inactive_file_type -- a_get_inactive_file_type
|
||||
, a_ids_file_type -- a_ids_file_type
|
||||
, a_names_file_type -- a_names_file_type
|
||||
, a_get_all_image -- a_get_all_image
|
||||
, a_get_inactive_image -- a_get_inactive_image
|
||||
, a_ids_image -- a_ids_image
|
||||
, a_names_image -- a_names_image
|
||||
, a_get_all_button_icon -- a_get_all_button_icon
|
||||
, a_get_inactive_button_icon -- a_get_inactive_button_icon
|
||||
, a_ids_button_icon -- a_ids_button_icon
|
||||
, a_names_button_icon -- a_names_button_icon
|
||||
, a_notes_button_icon -- a_notes_button_icon
|
||||
, a_require_all_id_search_filters_met -- a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met -- a_require_all_non_id_search_filters_met
|
||||
@@ -256,13 +275,22 @@ BEGIN
|
||||
;
|
||||
END IF;
|
||||
|
||||
CALL demo.p_dog_calc_location (
|
||||
CALL demo.p_dog_calc_button_icon (
|
||||
v_guid -- a_guid
|
||||
, a_id_user -- a_id_user
|
||||
, a_get_all_location -- a_get_all_location
|
||||
, a_get_inactive_location -- a_get_inactive_location
|
||||
, a_ids_location -- a_ids_location
|
||||
, a_names_location -- a_names_location
|
||||
, a_get_all_file_type -- a_get_all_file_type
|
||||
, a_get_inactive_file_type -- a_get_inactive_file_type
|
||||
, a_ids_file_type -- a_ids_file_type
|
||||
, a_names_file_type -- a_names_file_type
|
||||
, a_get_all_image -- a_get_all_image
|
||||
, a_get_inactive_image -- a_get_inactive_image
|
||||
, a_ids_image -- a_ids_image
|
||||
, a_names_image -- a_names_image
|
||||
, a_get_all_button_icon -- a_get_all_button_icon
|
||||
, a_get_inactive_button_icon -- a_get_inactive_button_icon
|
||||
, a_ids_button_icon -- a_ids_button_icon
|
||||
, a_names_button_icon -- a_names_button_icon
|
||||
, a_notes_button_icon -- a_notes_button_icon
|
||||
, a_require_all_id_search_filters_met -- a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met -- a_require_all_non_id_search_filters_met
|
||||
@@ -272,105 +300,69 @@ BEGIN
|
||||
);
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT COUNT(*) FROM demo.DOG_Location_Temp;
|
||||
SELECT * FROM demo.DOG_Location_Temp;
|
||||
SELECT COUNT(*) FROM demo.DOG_Location_Link_Temp;
|
||||
SELECT * FROM demo.DOG_Location_Link_Temp;
|
||||
SELECT COUNT(*) FROM demo.DOG_Button_Icon_Temp;
|
||||
SELECT * FROM demo.DOG_Button_Icon_Temp;
|
||||
END IF;
|
||||
|
||||
INSERT INTO tmp_Location (
|
||||
id_location
|
||||
INSERT INTO tmp_Button_Icon (
|
||||
id_button_icon
|
||||
, id_image
|
||||
, code
|
||||
, name
|
||||
, notes
|
||||
, active
|
||||
|
||||
, does_meet_id_filters
|
||||
, does_meet_non_id_filters
|
||||
)
|
||||
SELECT
|
||||
LOCATION_T.id_location
|
||||
, LOCATION_T.code
|
||||
, LOCATION_T.name
|
||||
, LOCATION_T.active
|
||||
BUTTON_ICON_T.id_button_icon
|
||||
, BUTTON_ICON_T.id_image
|
||||
, BUTTON_ICON_T.code
|
||||
, BUTTON_ICON_T.name
|
||||
, BUTTON_ICON_T.notes
|
||||
, BUTTON_ICON_T.active
|
||||
|
||||
, LOCATION_T.does_meet_id_filters
|
||||
, LOCATION_T.does_meet_non_id_filters
|
||||
FROM demo.DOG_Location_Temp LOCATION_T
|
||||
WHERE LOCATION_T.GUID = v_guid
|
||||
;
|
||||
|
||||
INSERT INTO tmp_Location_Link (
|
||||
id_link
|
||||
, id_location_parent
|
||||
, id_location_child
|
||||
, active
|
||||
|
||||
, does_meet_id_filters
|
||||
, does_meet_non_id_filters
|
||||
)
|
||||
SELECT
|
||||
LOCATION_LINK_T.id_link
|
||||
, LOCATION_LINK_T.id_location_parent
|
||||
, LOCATION_LINK_T.id_location_child
|
||||
, LOCATION_LINK_T.active
|
||||
|
||||
, NULL AS does_meet_id_filters
|
||||
, NULL AS does_meet_non_id_filters
|
||||
FROM demo.DOG_Location_Link_Temp LOCATION_LINK_T
|
||||
WHERE LOCATION_LINK_T.GUID = v_guid
|
||||
, BUTTON_ICON_T.does_meet_id_filters
|
||||
, BUTTON_ICON_T.does_meet_non_id_filters
|
||||
FROM demo.DOG_Button_Icon_Temp BUTTON_ICON_T
|
||||
WHERE BUTTON_ICON_T.GUID = v_guid
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT COUNT(*) FROM tmp_Location;
|
||||
SELECT * FROM tmp_Location;
|
||||
SELECT COUNT(*) FROM tmp_Location_Link;
|
||||
SELECT * FROM tmp_Location_Link;
|
||||
SELECT COUNT(*) FROM tmp_Button_Icon;
|
||||
SELECT * FROM tmp_Button_Icon;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
-- Filter outputs
|
||||
IF EXISTS(SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN demo.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
SELECT * FROM tmp_Location;
|
||||
SELECT * FROM tmp_Location_Link;
|
||||
SELECT * FROM tmp_Button_Icon;
|
||||
END IF;
|
||||
|
||||
DELETE FROM tmp_Location_Link;
|
||||
DELETE FROM tmp_Location;
|
||||
DELETE FROM tmp_Button_Icon;
|
||||
END IF;
|
||||
|
||||
|
||||
-- Outputs
|
||||
-- Locations
|
||||
IF a_output_LOCATIONS = 1 THEN
|
||||
SELECT
|
||||
t_LOCATIONS.id_location
|
||||
, t_LOCATIONS.code
|
||||
, t_LOCATIONS.name
|
||||
, t_LOCATIONS.active
|
||||
-- Button_Icons
|
||||
SELECT
|
||||
t_BUTTON_ICONS.id_button_icon
|
||||
, t_BUTTON_ICONS.id_image
|
||||
, IMAGES.path AS path_image
|
||||
, IMAGES.name AS name_image
|
||||
, t_BUTTON_ICONS.code
|
||||
, t_BUTTON_ICONS.name
|
||||
, t_BUTTON_ICONS.notes
|
||||
, t_BUTTON_ICONS.active
|
||||
|
||||
, t_LOCATIONS.does_meet_id_filters
|
||||
, t_LOCATIONS.does_meet_non_id_filters
|
||||
FROM tmp_Location t_LOCATIONS
|
||||
ORDER BY t_LOCATIONS.name
|
||||
;
|
||||
END IF;
|
||||
|
||||
-- Location Links
|
||||
IF a_output_LOCATION_links = 1 THEN
|
||||
SELECT
|
||||
t_LOCATION_LINK.id_link
|
||||
, t_LOCATION_LINK.id_location_parent
|
||||
, t_LOCATION_LINK.id_location_child
|
||||
, t_LOCATION_LINK.active
|
||||
|
||||
, t_LOCATION_LINK.does_meet_id_filters
|
||||
, t_LOCATION_LINK.does_meet_non_id_filters
|
||||
FROM tmp_Location_Link t_LOCATION_LINK
|
||||
INNER JOIN tmp_Location t_LOCATIONS ON t_LOCATION_LINK.id_location_child = t_LOCATIONS.id_location
|
||||
ORDER BY t_LOCATIONS.name
|
||||
;
|
||||
END IF;
|
||||
, t_BUTTON_ICONS.does_meet_id_filters
|
||||
, t_BUTTON_ICONS.does_meet_non_id_filters
|
||||
FROM tmp_Button_Icon t_BUTTON_ICONS
|
||||
LEFT JOIN demo.DOG_Image IMAGES ON t_BUTTON_ICONS.id_image = IMAGES.id_image
|
||||
ORDER BY t_BUTTON_ICONS.name
|
||||
;
|
||||
|
||||
-- Errors
|
||||
SELECT
|
||||
@@ -388,17 +380,16 @@ BEGIN
|
||||
;
|
||||
|
||||
IF a_debug = 1 AND v_can_view = 1 THEN
|
||||
SELECT * FROM tmp_Location;
|
||||
SELECT * FROM tmp_Button_Icon;
|
||||
END IF;
|
||||
|
||||
CALL demo.p_dog_clear_calc_location(
|
||||
CALL demo.p_dog_clear_calc_button_icon(
|
||||
v_guid -- a_guid
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Msg_Error;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Location_Link;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Location;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Button_Icon;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
CALL demo.p_core_debug_timing_reporting ( v_time_start );
|
||||
@@ -408,35 +399,49 @@ DELIMITER ;
|
||||
|
||||
|
||||
|
||||
CALL demo.p_dog_get_many_location (
|
||||
CALL demo.p_dog_get_many_button_icon (
|
||||
1 -- 'auth0|6582b95c895d09a70ba10fef', -- a_id_user
|
||||
, 1 -- a_get_all_location
|
||||
, 0 -- a_get_inactive_location
|
||||
, '' -- a_ids_location
|
||||
, '' -- a_names_location
|
||||
, 1 -- a_get_all_file_type
|
||||
, 0 -- a_get_inactive_file_type
|
||||
, '' -- a_ids_file_type
|
||||
, '' -- a_names_file_type
|
||||
, 1 -- a_get_all_image
|
||||
, 0 -- a_get_inactive_image
|
||||
, '' -- a_ids_image
|
||||
, '' -- a_names_image
|
||||
, 1 -- a_get_all_button_icon
|
||||
, 0 -- a_get_inactive_button_icon
|
||||
, '' -- a_ids_button_icon
|
||||
, '' -- a_names_button_icon
|
||||
, '' -- a_notes_button_icon
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 1 -- a_require_any_non_id_search_filters_met
|
||||
, 1 -- a_output_LOCATIONS
|
||||
, 1 -- a_output_LOCATION_links
|
||||
, 0 -- a_debug
|
||||
, 1 -- a_debug
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
CALL demo.p_dog_get_many_location (
|
||||
/*
|
||||
CALL demo.p_dog_get_many_button_icon (
|
||||
1 -- 'auth0|6582b95c895d09a70ba10fef', -- a_id_user
|
||||
, 1 -- a_get_all_location
|
||||
, 0 -- a_get_inactive_location
|
||||
, '' -- a_ids_location
|
||||
, 'pat,point' -- a_names_location
|
||||
, 1 -- a_get_all_file_type
|
||||
, 0 -- a_get_inactive_file_type
|
||||
, '' -- a_ids_file_type
|
||||
, 'pat,point' -- a_names_file_type
|
||||
, 1 -- a_get_all_image
|
||||
, 0 -- a_get_inactive_image
|
||||
, '' -- a_ids_image
|
||||
, 'pat,point' -- a_names_image
|
||||
, 1 -- a_get_all_button_icon
|
||||
, 0 -- a_get_inactive_button_icon
|
||||
, '' -- a_ids_button_icon
|
||||
, 'pat,point' -- a_names_button_icon
|
||||
, 'pat,point' -- a_notes_button_icon
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 1 -- a_require_any_non_id_search_filters_met
|
||||
, 1 -- a_output_LOCATIONS
|
||||
, 1 -- a_output_LOCATION_links
|
||||
, 1 -- a_debug
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user