From 333065f8d9b599b048668a0686ba2ee58944b0e4 Mon Sep 17 00:00:00 2001
From: kaiyu <404897439@qq.com>
Date: Thu, 18 Mar 2021 11:26:33 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev
---
screen-api/src/main/resources/mapper/UserMapper.xml | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/screen-api/src/main/resources/mapper/UserMapper.xml b/screen-api/src/main/resources/mapper/UserMapper.xml
index 58ed1f3..b062eb3 100644
--- a/screen-api/src/main/resources/mapper/UserMapper.xml
+++ b/screen-api/src/main/resources/mapper/UserMapper.xml
@@ -17,6 +17,45 @@
<result column="update_time" property="updateTime"/>
<result column="expire_time" property="expireTime"/>
<result column="is_delete" property="isDelete"/>
+ <!--������������-->
+ <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="BaseResultMap">
+ SELECT u.id,u.account,u.password,u.user_name,u.organization_id,u.expire_time,u.is_delete,
+ o.name,u.is_admin,o.location_level,
+ g.id groupId,g.group_name
+ FROM `user` u,
+ `organization` o,
+ `user_group` ug,
+ `group` g
+ WHERE u.account = #{account}
+ AND u.organization_id=o.id
+ AND u.id = ug.user_id
+ AND ug.group_id = g.id
+ AND g.is_delete = 0
+ AND ug.is_delete = 0
+ </select>
+
+
+ <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>
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0