From da820c982d04cfe8d95b5544ce50ef28e0a8b08a Mon Sep 17 00:00:00 2001 From: "zhangdaiscott@163.com" Date: Mon, 2 Jul 2018 12:03:46 +0800 Subject: [PATCH] =?UTF-8?q?mysql=E5=A2=9E=E5=8A=A0=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E8=BF=87=E7=A8=8B=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jeecg-framework/docs/jeecg_3.7.6_mysql.sql | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/jeecg-framework/docs/jeecg_3.7.6_mysql.sql b/jeecg-framework/docs/jeecg_3.7.6_mysql.sql index c879c327..ff9317ef 100644 --- a/jeecg-framework/docs/jeecg_3.7.6_mysql.sql +++ b/jeecg-framework/docs/jeecg_3.7.6_mysql.sql @@ -20140,3 +20140,64 @@ CREATE TABLE `t_s_user_position_rel` ( -- ---------------------------- -- Records of t_s_user_position_rel -- ---------------------------- + +-- ---------------------------- +-- Procedure structure for delete_jeecgDemo_createDate +-- ---------------------------- +DROP PROCEDURE IF EXISTS `delete_jeecgDemo_createDate`; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `delete_jeecgDemo_createDate`(IN `createDate` date) +BEGIN + delete from jeecg_demo where create_date >= createDate; +END +;; +DELIMITER ; + +-- ---------------------------- +-- Procedure structure for formDataList +-- ---------------------------- +DROP PROCEDURE IF EXISTS `formDataList`; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `formDataList`(tableName varchar(50),dbFields varchar(500),whereSql varchar(1000)) +BEGIN + declare exe_sql varchar(2000); + SET exe_sql = CONCAT("select ",dbFields," from ",tableName,whereSql); + set @v_sql=exe_sql; + prepare stmt from @v_sql; + EXECUTE stmt; + deallocate prepare stmt; +END +;; +DELIMITER ; + +-- ---------------------------- +-- Procedure structure for replaceOrgCode +-- ---------------------------- +DROP PROCEDURE IF EXISTS `replaceOrgCode`; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `replaceOrgCode`() +BEGIN +DECLARE code_length int DEFAULT 0 ; +DECLARE new_code VARCHAR(500); +DECLARE org_id VARCHAR(500); +DECLARE old_code VARCHAR(500); +DECLARE code_length_index int DEFAULT 1; +DECLARE b int default 0; +DECLARE pro CURSOR for select id,org_code,LENGTH(org_code) from t_s_depart; +DECLARE CONTINUE HANDLER FOR NOT FOUND SET b = 1; +OPEN pro; +FETCH pro into org_id,old_code,code_length; + while b<>1 do + set code_length_index=1; + set new_code=''; + while code_length_index