wuxw лет назад: 6
Родитель
Сommit
871ba18093

+ 20 - 0
java110-bean/src/main/java/com/java110/dto/UserDto.java

@@ -36,6 +36,10 @@ public class UserDto extends PageDto implements Serializable {
 
     private String orgName;
 
+    private String parentOrgId;
+
+    private String orgId;
+
 
     public String getUserId() {
         return userId;
@@ -132,4 +136,20 @@ public class UserDto extends PageDto implements Serializable {
     public void setOrgName(String orgName) {
         this.orgName = orgName;
     }
+
+    public String getParentOrgId() {
+        return parentOrgId;
+    }
+
+    public void setParentOrgId(String parentOrgId) {
+        this.parentOrgId = parentOrgId;
+    }
+
+    public String getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(String orgId) {
+        this.orgId = orgId;
+    }
 }

+ 17 - 12
java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml

@@ -443,7 +443,10 @@
             and a.user_id = uosr.staff_id
             and uosr.store_id = #{storeId}
             and uosr.org_id = uo.org_id
+        <if test="parentOrgId !=null and parentOrgId != ''">
             and uo.parent_org_id = #{parentOrgId}
+        </if>
+            and a.status_cd = '0'
             and uo.status_cd = '0'
             and uosr.status_cd = '0'
         <if test="tel !=null and tel != ''">
@@ -460,19 +463,21 @@
     <!-- 查询员工总量 -->
     <select id="getStaffs" parameterType="Map" resultType="Map">
         select uo.org_name,uo.org_name orgName,u.user_id, u.user_id userId,u.name,u.name userName,u.email,u.address,u.password,u.location_cd,u.location_cd locationCd,
-        u.age,u.sex,u.tel,u.level_cd,u.b_id
+            u.age,u.sex,u.tel,u.level_cd,u.b_id
         from
-        u_user a
-        ,u_org uo
-        ,u_org_staff_rel uosr
-        where a.level_cd = '01'
-        and a.user_id = uosr.staff_id
-        and uosr.store_id = #{storeId}
-        and uosr.org_id = uo.org_id
-        and uo.parent_org_id = #{parentOrgId}
-        and a.status_cd = '0'
-        and uo.status_cd = '0'
-        and uosr.status_cd = '0'
+            u_user a
+            ,u_org uo
+            ,u_org_staff_rel uosr
+            where a.level_cd = '01'
+            and a.user_id = uosr.staff_id
+            and uosr.store_id = #{storeId}
+            and uosr.org_id = uo.org_id
+        <if test="parentOrgId !=null and parentOrgId != ''">
+            and uo.parent_org_id = #{parentOrgId}
+        </if>
+            and a.status_cd = '0'
+            and uo.status_cd = '0'
+            and uosr.status_cd = '0'
         <if test="tel !=null and tel != ''">
             and a.tel= #{tel}
         </if>