From 5c2d27f75d2bacfc040b180e2d814df796929472 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 25 Jan 2022 16:23:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9mysql5=E4=BD=8E=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/mysql.sql | 16 ++++++++-------- .../iot/vmp/storager/dao/UserMapper.java | 8 ++++---- .../streamPush/StreamPushController.java | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sql/mysql.sql b/sql/mysql.sql index 36905c89..65693750 100644 --- a/sql/mysql.sql +++ b/sql/mysql.sql @@ -397,13 +397,13 @@ LOCK TABLES `platform_gb_stream` WRITE; UNLOCK TABLES; -- --- Table structure for table `role` +-- Table structure for table `user_role` -- -DROP TABLE IF EXISTS `role`; +DROP TABLE IF EXISTS `user_role`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `role` ( +CREATE TABLE `user_role` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `authority` varchar(50) NOT NULL, @@ -414,13 +414,13 @@ CREATE TABLE `role` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `role` +-- Dumping data for table `user_role` -- -LOCK TABLES `role` WRITE; -/*!40000 ALTER TABLE `role` DISABLE KEYS */; -INSERT INTO `role` VALUES (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57'); -/*!40000 ALTER TABLE `role` ENABLE KEYS */; +LOCK TABLES `user_role` WRITE; +/*!40000 ALTER TABLE `user_role` DISABLE KEYS */; +INSERT INTO `user_role` VALUES (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57'); +/*!40000 ALTER TABLE `user_role` ENABLE KEYS */; UNLOCK TABLES; -- diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/UserMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/UserMapper.java index 7eb71e6a..addb27d0 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/UserMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/UserMapper.java @@ -27,7 +27,7 @@ public interface UserMapper { @Delete("DELETE FROM user WHERE id != 1 and id=#{id}") int delete(int id); - @Select("select user.*, role.id roleID, role.name roleName, role.authority roleAuthority , role.createTime roleCreateTime , role.updateTime roleUpdateTime FROM user, role WHERE user.roleId=role.id and user.username=#{username} AND user.password=#{password}") + @Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id and u.username=#{username} AND u.password=#{password}") @Results(id = "roleMap", value = { @Result(column = "roleID", property = "role.id"), @Result(column = "roleName", property = "role.name"), @@ -37,15 +37,15 @@ public interface UserMapper { }) User select(String username, String password); - @Select("select user.*, role.id roleID, role.name roleName, role.authority roleAuthority, role.createTime roleCreateTime , role.updateTime roleUpdateTime FROM user, role WHERE user.roleId=role.id and user.id=#{id}") + @Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id and u.id=#{id}") @ResultMap(value="roleMap") User selectById(int id); - @Select("select user.*, role.id roleID, role.name roleName, role.authority roleAuthority, role.createTime roleCreateTime , role.updateTime roleUpdateTime FROM user, role WHERE user.roleId=role.id and username=#{username}") + @Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id and u.username=#{username}") @ResultMap(value="roleMap") User getUserByUsername(String username); - @Select("select user.*, role.id roleID, role.name roleName, role.authority roleAuthority, role.createTime roleCreateTime , role.updateTime roleUpdateTime FROM user, role WHERE user.roleId=role.id") + @Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id") @ResultMap(value="roleMap") List selectAll(); } diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java index c58bd600..3ea207a3 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java @@ -123,7 +123,7 @@ public class StreamPushController { // 录像查询以channelId作为deviceId查询 String key = DeferredResultHolder.UPLOAD_FILE_CHANNEL; String uuid = UUID.randomUUID().toString(); - logger.warn("通道导入文件类型: {}",file.getContentType() ); + logger.info("通道导入文件类型: {}",file.getContentType() ); if (file.isEmpty()) { logger.warn("通道导入文件为空"); WVPResult wvpResult = new WVPResult<>();