|
@@ -3,9 +3,10 @@
|
|
|
<mapper namespace="org.sky.system.mapper.UserMapper">
|
|
<mapper namespace="org.sky.system.mapper.UserMapper">
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<!-- 通用查询映射结果 -->
|
|
|
- <resultMap id="userResultMap" type="org.sky.system.pojo.entity.User">
|
|
|
|
|
|
|
+ <resultMap id="userResultMap" type="org.sky.system.pojo.vo.UserVO">
|
|
|
<result column="id" property="id"/>
|
|
<result column="id" property="id"/>
|
|
|
<result column="tenant_id" property="tenantId"/>
|
|
<result column="tenant_id" property="tenantId"/>
|
|
|
|
|
+ <result column="tenant_name" property="tenantName"/>
|
|
|
<result column="create_user" property="createUser"/>
|
|
<result column="create_user" property="createUser"/>
|
|
|
<result column="create_time" property="createTime"/>
|
|
<result column="create_time" property="createTime"/>
|
|
|
<result column="update_user" property="updateUser"/>
|
|
<result column="update_user" property="updateUser"/>
|
|
@@ -28,39 +29,24 @@
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<select id="selectUserPage" resultMap="userResultMap">
|
|
<select id="selectUserPage" resultMap="userResultMap">
|
|
|
- select * from kd_user where is_deleted = 0
|
|
|
|
|
|
|
+ select
|
|
|
|
|
+ u.*, t.tenant_name
|
|
|
|
|
+ from kd_user u
|
|
|
|
|
+ left join kd_tenant t on t.tenant_id = u.tenant_id
|
|
|
|
|
+ where u.is_deleted = 0
|
|
|
<if test="tenantId!=null and tenantId != ''">
|
|
<if test="tenantId!=null and tenantId != ''">
|
|
|
- and tenant_id = #{tenantId}
|
|
|
|
|
|
|
+ and u.tenant_id = #{tenantId}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="user.tenantId!=null and user.tenantId != ''">
|
|
|
|
|
- and tenant_id = #{user.tenantId}
|
|
|
|
|
|
|
+ <if test="user.tenantName!=null and user.tenantName != ''">
|
|
|
|
|
+ and t.tenant_name like concat('%',#{user.tenantName},'%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="user.account!=null and user.account != ''">
|
|
<if test="user.account!=null and user.account != ''">
|
|
|
- and account = #{user.account}
|
|
|
|
|
|
|
+ and u.account = #{user.account}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="user.realName!=null and user.realName != ''">
|
|
<if test="user.realName!=null and user.realName != ''">
|
|
|
- and real_name = #{user.realName}
|
|
|
|
|
|
|
+ and u.real_name = #{user.realName}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="user.userType!=null and user.userType != ''">
|
|
|
|
|
- and user_type = #{user.userType}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="user.status!=null and user.status>=0">
|
|
|
|
|
- and status = #{user.status}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="deptIdList!=null and deptIdList.size>0">
|
|
|
|
|
- and id in (
|
|
|
|
|
- SELECT
|
|
|
|
|
- user_id
|
|
|
|
|
- FROM
|
|
|
|
|
- kd_user_dept
|
|
|
|
|
- WHERE
|
|
|
|
|
- dept_id IN
|
|
|
|
|
- <foreach collection="deptIdList" index="index" item="item" open="(" separator="," close=")">
|
|
|
|
|
- #{item}
|
|
|
|
|
- </foreach>
|
|
|
|
|
- )
|
|
|
|
|
- </if>
|
|
|
|
|
- ORDER BY id
|
|
|
|
|
|
|
+ ORDER BY u.id asc
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getUser" resultMap="userResultMap">
|
|
<select id="getUser" resultMap="userResultMap">
|