Sfoglia il codice sorgente

根据组织ID和角色编码列表查询用户列表

chenshudong 4 mesi fa
parent
commit
69f51dca52

+ 11 - 2
airport-system/src/main/java/com/sundot/airport/system/mapper/SysUserMapper.java

@@ -171,11 +171,11 @@ public interface SysUserMapper {
171 171
      * @return 用户列表
172 172
      */
173 173
     public List<SysUser> selectUserListByRoleKey(@Param("list") List<String> list);
174
-    
174
+
175 175
     /**
176 176
      * 根据角色标识和站点ID查询用户列表
177 177
      *
178
-     * @param list 角色标识
178
+     * @param list      角色标识
179 179
      * @param stationId 站点ID
180 180
      * @return 用户列表
181 181
      */
@@ -203,4 +203,13 @@ public interface SysUserMapper {
203 203
      * @return 用户信息集合
204 204
      */
205 205
     public List<SysUser> selectUserAll();
206
+
207
+    /**
208
+     * 根据组织ID和角色编码列表查询用户列表
209
+     *
210
+     * @param deptId 组织ID
211
+     * @param list   角色编码列表
212
+     * @return 用户信息集合
213
+     */
214
+    public List<SysUser> selectUserByDeptIdAndRoleKeyList(@Param("deptId") Long deptId, @Param("list") List<String> list);
206 215
 }

+ 20 - 8
airport-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -618,25 +618,25 @@
618 618
             #{subordinateEvaluationGrowthPotential},
619 619
         </if>
620 620
         <if test="schooling != null and schooling != ''">
621
-             #{schooling},
621
+            #{schooling},
622 622
         </if>
623 623
         <if test="politicalReviewSituation != null and politicalReviewSituation != ''">
624
-             #{politicalReviewSituation},
624
+            #{politicalReviewSituation},
625 625
         </if>
626 626
         <if test="startWorkingDate != null">
627
-             #{startWorkingDate},
627
+            #{startWorkingDate},
628 628
         </if>
629 629
         <if test="securityCheckStartDate != null">
630
-             #{securityCheckStartDate},
630
+            #{securityCheckStartDate},
631 631
         </if>
632 632
         <if test="securityInspectionPosition != null and securityInspectionPosition != ''">
633
-             #{securityInspectionPosition},
633
+            #{securityInspectionPosition},
634 634
         </if>
635 635
         <if test="workRewardsNumber != null ">
636
-             #{workRewardsNumber},
636
+            #{workRewardsNumber},
637 637
         </if>
638 638
         <if test="workPenaltiesNumber != null">
639
-             #{workPenaltiesNumber},
639
+            #{workPenaltiesNumber},
640 640
         </if>
641 641
         sysdate()
642 642
         )
@@ -969,10 +969,22 @@
969 969
         and su.status = '0'
970 970
         and sr.del_flag = '0'
971 971
         and sr.status = '0'
972
-        and (su.dept_id = #{deptId} OR d.parent_id = #{deptId} OR d.ancestors like concat('%,', #{deptId}, ',%') OR d.ancestors like concat(#{deptId}, ',%') OR d.ancestors like concat('%,', #{deptId}))
972
+        and (su.dept_id = #{deptId} OR d.parent_id = #{deptId} OR d.ancestors like concat('%,', #{deptId}, ',%') OR
973
+        d.ancestors like concat(#{deptId}, ',%') OR d.ancestors like concat('%,', #{deptId}))
973 974
         and sr.role_key in
974 975
         <foreach collection="list" item="item" open="(" separator="," close=")">
975 976
             #{item}
976 977
         </foreach>
977 978
     </select>
979
+
980
+    <select id="selectUserByDeptIdAndRoleKeyList" resultMap="SysUserResult">
981
+        <include refid="selectUserVo"/>
982
+        where (u.dept_id = #{deptId} OR u.dept_id IN (
983
+        SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors)))
984
+        and u.del_flag = '0'
985
+        and r.role_key in
986
+        <foreach collection="list" item="item" open="(" separator="," close=")">
987
+            #{item}
988
+        </foreach>
989
+    </select>
978 990
 </mapper>