| | |
| | | `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| | | `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| | | `roleId` int NOT NULL, |
| | | `pushKey` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci default null, |
| | | `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| | | `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| | | PRIMARY KEY (`id`) USING BTREE, |
| | |
| | | change createStamp createTime varchar(50) default null; |
| | | |
| | | |
| | | alter table user |
| | | add pushKey varchar(50) default null; |
| | | |
| | | |
| | | |
| | |
| | | @Repository |
| | | public interface UserMapper { |
| | | |
| | | @Insert("INSERT INTO user (username, password, roleId, createTime, updateTime) VALUES" + |
| | | "('${username}', '${password}', '${role.id}', '${createTime}', '${updateTime}')") |
| | | @Insert("INSERT INTO user (username, password, roleId, pushKey, createTime, updateTime) VALUES" + |
| | | "('${username}', '${password}', '${role.id}', '${pushKey}', '${createTime}', '${updateTime}')") |
| | | int add(User user); |
| | | |
| | | @Update(value = {" <script>" + |
| | | "UPDATE user " + |
| | | "SET updateTime='${updateTime}' " + |
| | | "<if test=\"pushKey != null\">, pushKey='${pushKey}'</if>" + |
| | | "<if test=\"role != null\">, roleId='${role.id}'</if>" + |
| | | "<if test=\"password != null\">, password='${password}'</if>" + |
| | | "<if test=\"username != null\">, username='${username}'</if>" + |
| | |
| | | private String password; |
| | | private String createTime; |
| | | private String updateTime; |
| | | private String pushKey; |
| | | private Role role; |
| | | |
| | | public int getId() { |
| | |
| | | public void setRole(Role role) { |
| | | this.role = role; |
| | | } |
| | | |
| | | public String getPushKey() { |
| | | return pushKey; |
| | | } |
| | | |
| | | public void setPushKey(String pushKey) { |
| | | this.pushKey = pushKey; |
| | | } |
| | | } |