Ver código fonte

优化组织查询功能

java110 6 anos atrás
pai
commit
9a69cdc683

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/org/OrgDto.java

@@ -24,6 +24,7 @@ public class OrgDto extends PageDto implements Serializable {
     private String belongCommunityId;
     private String belongCommunityName;
     private String allowOperation;
+    private String staffId;
 
     private String parentOrgName;
 
@@ -140,4 +141,12 @@ public class OrgDto extends PageDto implements Serializable {
     public void setAllowOperation(String allowOperation) {
         this.allowOperation = allowOperation;
     }
+
+    public String getStaffId() {
+        return staffId;
+    }
+
+    public void setStaffId(String staffId) {
+        this.staffId = staffId;
+    }
 }

+ 9 - 0
java110-bean/src/main/java/com/java110/vo/api/org/ApiOrgDataVo.java

@@ -14,6 +14,7 @@ public class ApiOrgDataVo implements Serializable {
     private String belongCommunityName;
     private String description;
     private String allowOperation;
+    private String staffId;
 
     private String orgLevelName;
 
@@ -96,4 +97,12 @@ public class ApiOrgDataVo implements Serializable {
     public void setAllowOperation(String allowOperation) {
         this.allowOperation = allowOperation;
     }
+
+    public String getStaffId() {
+        return staffId;
+    }
+
+    public void setStaffId(String staffId) {
+        this.staffId = staffId;
+    }
 }

+ 16 - 0
java110-db/src/main/resources/mapper/user/OrgServiceDaoImplMapper.xml

@@ -103,12 +103,20 @@
         t.belong_community_id ,t.belong_community_id belongCommunityId,
         t.allow_operation ,t.allow_operation allowOperation
         from u_org t,t_dict td,u_org uo
+        <if test="staffId != null and staffId !=''">
+            ,u_org_staff_rel uosr
+        </if>
         where 1 =1
         and t.org_level = td.status_cd
         and td.table_name='u_org'
         and td.table_columns = 'org_level'
         and t.parent_org_id = uo.org_id
         and uo.status_cd = '0'
+        <if test="staffId != null and staffId !=''">
+            and uosr.org_id = uo.org_id
+            and uosr.staff_id = #{staffId}
+            and uosr.status_cd = '0'
+        </if>
         <if test="orgName !=null and orgName != ''">
             and t.org_name= #{orgName}
         </if>
@@ -187,12 +195,20 @@
     <select id="queryOrgsCount" parameterType="Map" resultType="Map">
         select count(1) count
         from u_org t,t_dict td,u_org uo
+        <if test="staffId != null and staffId !=''">
+            ,u_org_staff_rel uosr
+        </if>
         where 1 =1
         and t.org_level = td.status_cd
         and td.table_name='u_org'
         and td.table_columns = 'org_level'
         and t.parent_org_id = uo.org_id
         and uo.status_cd = '0'
+        <if test="staffId != null and staffId !=''">
+            and uosr.org_id = uo.org_id
+            and uosr.staff_id = #{staffId}
+            and uosr.status_cd = '0'
+        </if>
         <if test="orgName !=null and orgName != ''">
             and t.org_name= #{orgName}
         </if>