jinpengyong
2023-07-31 7ed9e64f4b566574d19a6be15660cba9dbe6cabe
screen-api/src/main/resources/mapper/UserMapper.xml
@@ -25,27 +25,28 @@
            <result column="id" property="id" jdbcType="INTEGER"/>
            <result column="name" property="name" jdbcType="VARCHAR"/>
            <result column="location_level_code" property="locationLevelCode"/>
            <result column="org_expire_ime" property="expireTime"/>
            <result column="org_expire_time" property="expireTime"/>
        </association>
        <!--用户组-->
        <collection property="groups" ofType="com.moral.api.entity.Group" javaType="java.util.ArrayList">
        <association property="group" javaType="com.moral.api.entity.Group">
            <id column="group_id" property="id" jdbcType="INTEGER"/>
            <result column="group_name" property="groupName" jdbcType="VARCHAR"/>
        </collection>
        </association>
    </resultMap>
    <!--查询用户信息,包含组织,角色-->
    <select id="selectUserInfo" resultMap="userInfoMap">
      SELECT u.id, u.account, u.password, u.user_name, u.email, u.mobile, u.wechat ,u.organization_id, u.expire_time, u.is_delete,u.is_Admin,
      o.name, o.location_level_code, o.expire_time org_expire_ime,
      o.name, o.location_level_code, o.expire_time org_expire_time,
      a.id group_id , 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
            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}
        AND u.is_delete = '0'
    </select>
</mapper>