|
@@ -203,6 +203,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</if>
|
|
|
</where>
|
|
|
|
|
|
+ </select>
|
|
|
+ <select id="findUserListByType" resultType="com.huaxu.entity.UserEntity">
|
|
|
+ select a.id,a.DEPT_ORG_ID,a.COMPANY_ORG_ID,
|
|
|
+ a.USERNAME,company.ORG_NAME
|
|
|
+ companyOrgName,department.ORG_NAME deptOrgName from uims_user a
|
|
|
+ left join uims_org company on a.COMPANY_ORG_ID=company.ID
|
|
|
+ left join uims_org department on a.DEPT_ORG_ID=department.ID
|
|
|
+ <where>
|
|
|
+ a.status=1 and a.user_type = #{user.userType}
|
|
|
+ <if test="user.tenantId != null and user.tenantId != ''"> and a.tenant_id = #{user.tenantId} </if>
|
|
|
+
|
|
|
+ <if test="user.deptOrgId != null and user.deptOrgId != ''">
|
|
|
+ and (a.DEPT_ORG_ID = #{user.deptOrgId}
|
|
|
+ or a.COMPANY_ORG_ID = #{user.companyOrgId}
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="user.userType!=null and user.userType!=-999 and user.userType!=-9999 and user.programItems != null and user.programItems.size() > 0">
|
|
|
+ <if test="user.permissonType == 5 or user.permissonType == 2">
|
|
|
+ and ( a.DEPT_ORG_ID in
|
|
|
+ <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ or
|
|
|
+ a.COMPANY_ORG_ID in
|
|
|
+ <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="user.permissonType == 4 or user.permissonType == 3">
|
|
|
+ and a.DEPT_ORG_ID in
|
|
|
+ <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="user.permissonType == 1">
|
|
|
+ and a.COMPANY_ORG_ID in
|
|
|
+ <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ and (a.DEPT_ORG_ID is null or a.DEPT_ORG_ID =0)
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+
|
|
|
</select>
|
|
|
<select id="findUserIdsByUserIds" resultType="com.huaxu.entity.UserEntity">
|
|
|
SELECT
|