zoukankan      html  css  js  c++  java
  • mysql自定义函数初始化数据:init_data()

    DELIMITER $$

    USE `local_hnyz`$$

    DROP FUNCTION IF EXISTS `init_data`$$

    CREATE DEFINER=`root`@`localhost` FUNCTION `init_data`() RETURNS INT(11)
    BEGIN
    DECLARE ind INT DEFAULT 1;
    -- 同步扩展表信息
    INSERT INTO se_marker_site_expansion (
    ID,MARKER_SITE_ID,MARKER_SITE_ADDRESS,LONGITUDE,LATITUDE,BUSINESS_INFO,PROMISE_TIME,BUSINESS_STATUS
    )
    SELECT
    REPLACE(CONCAT(UUID(),UUID()),'-',''),ms.`id`,ms.`address`,10,10,'刻章',24,'1'
    FROM
    lv_marker_site ms;

    -- 初始化价格配置
    DELETE FROM se_price_allocation WHERE CONFIG_USER_NAME LIKE 'system' AND CONFIG_USER_PHONE='18878562378';
    WHILE ind < 8 DO
    INSERT INTO se_price_allocation (
    ID,MARKER_SITE_ID,CONFIG_USER_NAME,CONFIG_USER_PHONE,CONFIG_USER_IDENTITY_NUM,METERIAL_TYPE,METERIAL_PRICE
    )
    SELECT
    REPLACE(CONCAT(UUID(),UUID()),'-',''),ms.`id`,'system','18878562378','43243243243234',CONCAT(ind,''),70
    FROM
    lv_marker_site ms;
    SET ind = ind+1;
    END WHILE;
    RETURN 0;
    END$$

    DELIMITER ;

  • 相关阅读:
    你不是真正的快乐
    春天里
    一生有你
    故乡
    第一天
    直来直往
    恋恋风尘
    烦恼歌
    because of you
    从头再来
  • 原文地址:https://www.cnblogs.com/sung1024/p/11362005.html
Copyright © 2011-2022 走看看