张延森 3 年之前
父節點
當前提交
0e24df9346
共有 2 個文件被更改,包括 1 次插入18 次删除
  1. 1
    1
      src/main/resources/application-prod.yml
  2. 0
    17
      src/main/resources/mapper/TaChannelMapper.xml

+ 1
- 1
src/main/resources/application-prod.yml 查看文件

@@ -6,7 +6,7 @@ spring:
6 6
   datasource:
7 7
     username: marketing
8 8
     password: u@cSFJ5*kS9hGP7a
9
-    url: jdbc:mysql://210.13.107.60:3306/marketing-cloud?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
9
+    url: jdbc:mysql://localhost:3306/marketing-cloud?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
10 10
     driver-class-name: com.mysql.cj.jdbc.Driver
11 11
     initial-size: 10 # 初始化连接数
12 12
     max-active: 20 # 最大连接数

+ 0
- 17
src/main/resources/mapper/TaChannelMapper.xml 查看文件

@@ -3,23 +3,6 @@
3 3
 <mapper namespace="com.yunzhi.marketing.mapper.TaChannelMapper">
4 4
 
5 5
     <select id="channelCode" resultType="int">
6
-        drop FUNCTION if exists roundNum;
7
-        create function roundNum() returns int
8
-        begin
9
-        declare x int default 1;
10
-        declare y int default 0;
11
-        declare a int default 20;
12
-        declare b int default 1;
13
-        while (b <![CDATA[ < a ]]> ) do
14
-        set x = (select (select FLOOR(100000 + RAND()*900000))  as num);
15
-        set y = (select count(1) from ta_channel where channel_code = x);
16
-        if y = 0
17
-        then return x;
18
-        END IF;
19
-        set b = b + 1;
20
-        end while;
21
-        return 0;
22
-        end;
23 6
         select roundNum();
24 7
     </select>
25 8