Browse Source

框架迁移

root 5 years ago
parent
commit
e18a90c09d

+ 80 - 0
repo/src/main/java/com/kingkong/repo/dao/ThreeloginMapper.java

@@ -0,0 +1,80 @@
1
+package com.kingkong.repo.dao;
2
+
3
+import com.kingkong.repo.entity.Threelogin;
4
+import org.apache.ibatis.annotations.Delete;
5
+import org.apache.ibatis.annotations.Insert;
6
+import org.apache.ibatis.annotations.ResultMap;
7
+import org.apache.ibatis.annotations.Select;
8
+import org.apache.ibatis.annotations.Update;
9
+
10
+import java.util.List;
11
+
12
+public interface ThreeloginMapper {
13
+    @Delete({
14
+        "delete from K_USER.K_THREE_LOGIN",
15
+        "where CODE = #{code,jdbcType=VARCHAR}"
16
+    })
17
+    int deleteByPrimaryKey(String code);
18
+
19
+    @Insert({
20
+        "insert into K_USER.K_THREE_LOGIN (CODE, CLIENT_ID, ",
21
+        "CLIENT_SECRET, NAME, ",
22
+        "CREATED_AT, UPDATED_AT, ",
23
+        "DELETED_AT, APP_ID, URI, ",
24
+        "TYPE, PROFILE, USERNAME, ",
25
+        "PASSWORD, TOKEN, ",
26
+        "REFRESH_DATE, CALLBACK_URI)",
27
+        "values (#{code,jdbcType=VARCHAR}, #{clientId,jdbcType=VARCHAR}, ",
28
+        "#{clientSecret,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
29
+        "#{createdAt,jdbcType=DATE}, #{updatedAt,jdbcType=DATE}, ",
30
+        "#{deletedAt,jdbcType=DATE}, #{appId,jdbcType=DECIMAL}, #{uri,jdbcType=VARCHAR}, ",
31
+        "#{type,jdbcType=DECIMAL}, #{profile,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, ",
32
+        "#{password,jdbcType=VARCHAR}, #{token,jdbcType=VARCHAR}, ",
33
+        "#{refreshDate,jdbcType=DATE}, #{callbackUri,jdbcType=VARCHAR})"
34
+    })
35
+    int insert(Threelogin record);
36
+
37
+    int insertSelective(Threelogin record);
38
+
39
+    @Select({
40
+        "select",
41
+        "CODE, CLIENT_ID, CLIENT_SECRET, NAME, CREATED_AT, UPDATED_AT, DELETED_AT, APP_ID, ",
42
+        "URI, TYPE, PROFILE, USERNAME, PASSWORD, TOKEN, REFRESH_DATE, CALLBACK_URI",
43
+        "from K_USER.K_THREE_LOGIN",
44
+        "where CODE = #{code,jdbcType=VARCHAR}"
45
+    })
46
+    @ResultMap("com.kingkong.repo.dao.ThreeloginMapper.BaseResultMap")
47
+    Threelogin selectByPrimaryKey(String code);
48
+
49
+    int updateByPrimaryKeySelective(Threelogin record);
50
+
51
+    @Update({
52
+        "update K_USER.K_THREE_LOGIN",
53
+        "set CLIENT_ID = #{clientId,jdbcType=VARCHAR},",
54
+          "CLIENT_SECRET = #{clientSecret,jdbcType=VARCHAR},",
55
+          "NAME = #{name,jdbcType=VARCHAR},",
56
+          "CREATED_AT = #{createdAt,jdbcType=DATE},",
57
+          "UPDATED_AT = #{updatedAt,jdbcType=DATE},",
58
+          "DELETED_AT = #{deletedAt,jdbcType=DATE},",
59
+          "APP_ID = #{appId,jdbcType=DECIMAL},",
60
+          "URI = #{uri,jdbcType=VARCHAR},",
61
+          "TYPE = #{type,jdbcType=DECIMAL},",
62
+          "PROFILE = #{profile,jdbcType=VARCHAR},",
63
+          "USERNAME = #{username,jdbcType=VARCHAR},",
64
+          "PASSWORD = #{password,jdbcType=VARCHAR},",
65
+          "TOKEN = #{token,jdbcType=VARCHAR},",
66
+          "REFRESH_DATE = #{refreshDate,jdbcType=DATE},",
67
+          "CALLBACK_URI = #{callbackUri,jdbcType=VARCHAR}",
68
+        "where CODE = #{code,jdbcType=VARCHAR}"
69
+    })
70
+    int updateByPrimaryKey(Threelogin record);
71
+
72
+    @Select({
73
+            "select",
74
+            "CODE, CLIENT_ID, CLIENT_SECRET, NAME, CREATED_AT, UPDATED_AT, DELETED_AT, APP_ID, ",
75
+            "URI, TYPE, PROFILE, USERNAME, PASSWORD, TOKEN, REFRESH_DATE, CALLBACK_URI",
76
+            "from K_USER.K_THREE_LOGIN",
77
+            "where APP_ID = #{appid}"
78
+    })
79
+    List<Threelogin> listAppThreeLogin(Integer appid);
80
+}

+ 120 - 0
repo/src/main/java/com/kingkong/repo/entity/Threelogin.java

@@ -0,0 +1,120 @@
1
+package com.kingkong.repo.entity;
2
+
3
+import java.util.Date;
4
+
5
+public class Threelogin {
6
+    private String code;
7
+
8
+    private String clientId;
9
+
10
+    private String clientSecret;
11
+
12
+    private String name;
13
+
14
+    private Date createdAt;
15
+
16
+    private Date updatedAt;
17
+
18
+    private Date deletedAt;
19
+
20
+    private Integer appId;
21
+
22
+    private String uri;
23
+
24
+    private Short type;
25
+
26
+    private String profile;
27
+
28
+    private String username;
29
+
30
+    private String password;
31
+
32
+    private String token;
33
+
34
+    private Date refreshDate;
35
+
36
+    private String callbackUri;
37
+
38
+    public Threelogin(String code, String clientId, String clientSecret, String name, Date createdAt, Date updatedAt, Date deletedAt, Integer appId, String uri, Short type, String profile, String username, String password, String token, Date refreshDate, String callbackUri) {
39
+        this.code = code;
40
+        this.clientId = clientId;
41
+        this.clientSecret = clientSecret;
42
+        this.name = name;
43
+        this.createdAt = createdAt;
44
+        this.updatedAt = updatedAt;
45
+        this.deletedAt = deletedAt;
46
+        this.appId = appId;
47
+        this.uri = uri;
48
+        this.type = type;
49
+        this.profile = profile;
50
+        this.username = username;
51
+        this.password = password;
52
+        this.token = token;
53
+        this.refreshDate = refreshDate;
54
+        this.callbackUri = callbackUri;
55
+    }
56
+
57
+    public String getCode() {
58
+        return code;
59
+    }
60
+
61
+    public String getClientId() {
62
+        return clientId;
63
+    }
64
+
65
+    public String getClientSecret() {
66
+        return clientSecret;
67
+    }
68
+
69
+    public String getName() {
70
+        return name;
71
+    }
72
+
73
+    public Date getCreatedAt() {
74
+        return createdAt;
75
+    }
76
+
77
+    public Date getUpdatedAt() {
78
+        return updatedAt;
79
+    }
80
+
81
+    public Date getDeletedAt() {
82
+        return deletedAt;
83
+    }
84
+
85
+    public Integer getAppId() {
86
+        return appId;
87
+    }
88
+
89
+    public String getUri() {
90
+        return uri;
91
+    }
92
+
93
+    public Short getType() {
94
+        return type;
95
+    }
96
+
97
+    public String getProfile() {
98
+        return profile;
99
+    }
100
+
101
+    public String getUsername() {
102
+        return username;
103
+    }
104
+
105
+    public String getPassword() {
106
+        return password;
107
+    }
108
+
109
+    public String getToken() {
110
+        return token;
111
+    }
112
+
113
+    public Date getRefreshDate() {
114
+        return refreshDate;
115
+    }
116
+
117
+    public String getCallbackUri() {
118
+        return callbackUri;
119
+    }
120
+}

+ 182 - 0
repo/src/main/resources/mapper/ThreeloginMapper.xml

@@ -0,0 +1,182 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.kingkong.repo.dao.ThreeloginMapper">
4
+  <resultMap id="BaseResultMap" type="com.kingkong.repo.entity.Threelogin">
5
+    <constructor>
6
+      <idArg column="CODE" javaType="java.lang.String" jdbcType="VARCHAR" />
7
+      <arg column="CLIENT_ID" javaType="java.lang.String" jdbcType="VARCHAR" />
8
+      <arg column="CLIENT_SECRET" javaType="java.lang.String" jdbcType="VARCHAR" />
9
+      <arg column="NAME" javaType="java.lang.String" jdbcType="VARCHAR" />
10
+      <arg column="CREATED_AT" javaType="java.util.Date" jdbcType="DATE" />
11
+      <arg column="UPDATED_AT" javaType="java.util.Date" jdbcType="DATE" />
12
+      <arg column="DELETED_AT" javaType="java.util.Date" jdbcType="DATE" />
13
+      <arg column="APP_ID" javaType="java.lang.Integer" jdbcType="DECIMAL" />
14
+      <arg column="URI" javaType="java.lang.String" jdbcType="VARCHAR" />
15
+      <arg column="TYPE" javaType="java.lang.Short" jdbcType="DECIMAL" />
16
+      <arg column="PROFILE" javaType="java.lang.String" jdbcType="VARCHAR" />
17
+      <arg column="USERNAME" javaType="java.lang.String" jdbcType="VARCHAR" />
18
+      <arg column="PASSWORD" javaType="java.lang.String" jdbcType="VARCHAR" />
19
+      <arg column="TOKEN" javaType="java.lang.String" jdbcType="VARCHAR" />
20
+      <arg column="REFRESH_DATE" javaType="java.util.Date" jdbcType="DATE" />
21
+      <arg column="CALLBACK_URI" javaType="java.lang.String" jdbcType="VARCHAR" />
22
+    </constructor>
23
+  </resultMap>
24
+  <sql id="Base_Column_List">
25
+    CODE, CLIENT_ID, CLIENT_SECRET, NAME, CREATED_AT, UPDATED_AT, DELETED_AT, APP_ID, 
26
+    URI, TYPE, PROFILE, USERNAME, PASSWORD, TOKEN, REFRESH_DATE, CALLBACK_URI
27
+  </sql>
28
+  <insert id="insertSelective" parameterType="com.kingkong.repo.entity.Threelogin">
29
+    insert into K_USER.K_THREE_LOGIN
30
+    <trim prefix="(" suffix=")" suffixOverrides=",">
31
+      <if test="code != null">
32
+        CODE,
33
+      </if>
34
+      <if test="clientId != null">
35
+        CLIENT_ID,
36
+      </if>
37
+      <if test="clientSecret != null">
38
+        CLIENT_SECRET,
39
+      </if>
40
+      <if test="name != null">
41
+        NAME,
42
+      </if>
43
+      <if test="createdAt != null">
44
+        CREATED_AT,
45
+      </if>
46
+      <if test="updatedAt != null">
47
+        UPDATED_AT,
48
+      </if>
49
+      <if test="deletedAt != null">
50
+        DELETED_AT,
51
+      </if>
52
+      <if test="appId != null">
53
+        APP_ID,
54
+      </if>
55
+      <if test="uri != null">
56
+        URI,
57
+      </if>
58
+      <if test="type != null">
59
+        TYPE,
60
+      </if>
61
+      <if test="profile != null">
62
+        PROFILE,
63
+      </if>
64
+      <if test="username != null">
65
+        USERNAME,
66
+      </if>
67
+      <if test="password != null">
68
+        PASSWORD,
69
+      </if>
70
+      <if test="token != null">
71
+        TOKEN,
72
+      </if>
73
+      <if test="refreshDate != null">
74
+        REFRESH_DATE,
75
+      </if>
76
+      <if test="callbackUri != null">
77
+        CALLBACK_URI,
78
+      </if>
79
+    </trim>
80
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
81
+      <if test="code != null">
82
+        #{code,jdbcType=VARCHAR},
83
+      </if>
84
+      <if test="clientId != null">
85
+        #{clientId,jdbcType=VARCHAR},
86
+      </if>
87
+      <if test="clientSecret != null">
88
+        #{clientSecret,jdbcType=VARCHAR},
89
+      </if>
90
+      <if test="name != null">
91
+        #{name,jdbcType=VARCHAR},
92
+      </if>
93
+      <if test="createdAt != null">
94
+        #{createdAt,jdbcType=DATE},
95
+      </if>
96
+      <if test="updatedAt != null">
97
+        #{updatedAt,jdbcType=DATE},
98
+      </if>
99
+      <if test="deletedAt != null">
100
+        #{deletedAt,jdbcType=DATE},
101
+      </if>
102
+      <if test="appId != null">
103
+        #{appId,jdbcType=DECIMAL},
104
+      </if>
105
+      <if test="uri != null">
106
+        #{uri,jdbcType=VARCHAR},
107
+      </if>
108
+      <if test="type != null">
109
+        #{type,jdbcType=DECIMAL},
110
+      </if>
111
+      <if test="profile != null">
112
+        #{profile,jdbcType=VARCHAR},
113
+      </if>
114
+      <if test="username != null">
115
+        #{username,jdbcType=VARCHAR},
116
+      </if>
117
+      <if test="password != null">
118
+        #{password,jdbcType=VARCHAR},
119
+      </if>
120
+      <if test="token != null">
121
+        #{token,jdbcType=VARCHAR},
122
+      </if>
123
+      <if test="refreshDate != null">
124
+        #{refreshDate,jdbcType=DATE},
125
+      </if>
126
+      <if test="callbackUri != null">
127
+        #{callbackUri,jdbcType=VARCHAR},
128
+      </if>
129
+    </trim>
130
+  </insert>
131
+  <update id="updateByPrimaryKeySelective" parameterType="com.kingkong.repo.entity.Threelogin">
132
+    update K_USER.K_THREE_LOGIN
133
+    <set>
134
+      <if test="clientId != null">
135
+        CLIENT_ID = #{clientId,jdbcType=VARCHAR},
136
+      </if>
137
+      <if test="clientSecret != null">
138
+        CLIENT_SECRET = #{clientSecret,jdbcType=VARCHAR},
139
+      </if>
140
+      <if test="name != null">
141
+        NAME = #{name,jdbcType=VARCHAR},
142
+      </if>
143
+      <if test="createdAt != null">
144
+        CREATED_AT = #{createdAt,jdbcType=DATE},
145
+      </if>
146
+      <if test="updatedAt != null">
147
+        UPDATED_AT = #{updatedAt,jdbcType=DATE},
148
+      </if>
149
+      <if test="deletedAt != null">
150
+        DELETED_AT = #{deletedAt,jdbcType=DATE},
151
+      </if>
152
+      <if test="appId != null">
153
+        APP_ID = #{appId,jdbcType=DECIMAL},
154
+      </if>
155
+      <if test="uri != null">
156
+        URI = #{uri,jdbcType=VARCHAR},
157
+      </if>
158
+      <if test="type != null">
159
+        TYPE = #{type,jdbcType=DECIMAL},
160
+      </if>
161
+      <if test="profile != null">
162
+        PROFILE = #{profile,jdbcType=VARCHAR},
163
+      </if>
164
+      <if test="username != null">
165
+        USERNAME = #{username,jdbcType=VARCHAR},
166
+      </if>
167
+      <if test="password != null">
168
+        PASSWORD = #{password,jdbcType=VARCHAR},
169
+      </if>
170
+      <if test="token != null">
171
+        TOKEN = #{token,jdbcType=VARCHAR},
172
+      </if>
173
+      <if test="refreshDate != null">
174
+        REFRESH_DATE = #{refreshDate,jdbcType=DATE},
175
+      </if>
176
+      <if test="callbackUri != null">
177
+        CALLBACK_URI = #{callbackUri,jdbcType=VARCHAR},
178
+      </if>
179
+    </set>
180
+    where CODE = #{code,jdbcType=VARCHAR}
181
+  </update>
182
+</mapper>