From f0376f72170c2eb236bec5560b8c5734edd222f1 Mon Sep 17 00:00:00 2001
From: kaiyu <404897439@qq.com>
Date: Wed, 31 Mar 2021 17:16:40 +0800
Subject: [PATCH] common模块: 增加了convert工具类,驼峰和下划线相互转换 更新了Date工具类,添加根据Date,day获取目标date的方法 更新WebUtils工具类,添加获取请求Ip方法 manage模块: 组织和后台用户增删改查模块全部完成 增加aop用作日志插入
---
screen-api/src/main/resources/mapper/UserMapper.xml | 35 +++++++++++++++++++++++++++--------
1 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/screen-api/src/main/resources/mapper/UserMapper.xml b/screen-api/src/main/resources/mapper/UserMapper.xml
index bcbc3fb..532a523 100644
--- a/screen-api/src/main/resources/mapper/UserMapper.xml
+++ b/screen-api/src/main/resources/mapper/UserMapper.xml
@@ -19,13 +19,32 @@
<result column="is_delete" property="isDelete"/>
</resultMap>
- <select id="selectUsers" resultType="java.util.Map">
- SELECT id,account,user_name userName,email,mobile,wechat FROM `user` WHERE
- <if test="orgId!=null">
- organization_id = #{orgId}
- </if>
- <if test="userId!=null">
- id = #{userId}
- </if>
+ <resultMap id="userInfoMap" type="com.moral.api.pojo.UserBO" extends="BaseResultMap">
+ <!--������������-->
+ <association property="organization" javaType="com.moral.api.entity.Organization">
+ <result column="id" property="id" jdbcType="INTEGER"/>
+ <result column="name" property="name" jdbcType="VARCHAR"/>
+ <result column="location_level" property="locationLevel"/>
+ </association>
+ <!--���������-->
+ <collection property="groups" ofType="com.moral.api.entity.Group" javaType="java.util.ArrayList">
+ <id column="groupId" property="id" jdbcType="INTEGER"/>
+ <result column="group_name" property="groupName" jdbcType="VARCHAR"/>
+ </collection>
+ </resultMap>
+
+ <!--������������������������������������������-->
+ <select id="selectUserInfo" resultMap="userInfoMap">
+ SELECT u.id, u.account, u.password, u.user_name, u.organization_id, u.expire_time, u.is_delete,u.is_Admin,
+ o.name, o.location_level,
+ a.id groupId , a.group_name
+ FROM `user` u
+ LEFT JOIN
+ (SELECT ug.user_id,g.id,g.group_name FROM `user_group` ug ,`group` g WHERE ug.group_id=g.id AND g.is_delete = 0
+ AND ug.is_delete = 0) a
+ ON a.user_id=u.id
+ LEFT JOIN `organization` o ON o.id=u.organization_id
+ WHERE u.account = #{account}
</select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0