瀏覽代碼

修复bug

zhouhao 6 年之前
父節點
當前提交
b053cab219

+ 8 - 9
hsweb-system/hsweb-system-organizational/README.md

@@ -17,14 +17,13 @@ createQuery().where("orgId","org-child-in","1234").list();
 2. org-child`(-not)`-in : 参数`(不)`在指定的机构以及子节点中
 3. dept-child`(-not)`-in: 参数`(不)`在指定的部门以及子节点中
 3. pos-child`(-not)`-in: 参数`(不)`在指定的岗位以及子节点中
-4. person`(-not)`-in-position: 人员ID`(不)`在岗位中
-5. user`(-not)`-in-position`(-child)`: 用户ID`(不)`在岗位中`(包含子级岗位)`
-6. user`(-not)`-in-department`(-child)`: 用户ID`(不)`在部门中`(包含子级岗位)`
-7. user`(-not)`-in-org`(-child)`: 用户ID`(不)`在机构中`(包含子级岗位)`
-8. user`(-not)`-in-dist`(-child)`: 用户ID`(不)`在行政区域中`(包含子级岗位)`
-9. person`(-not)`-in-position`(-child)`: 人员ID`(不)`在岗位中`(包含子级岗位)`
-10. person`(-not)`-in-department`(-child)`: 人员ID`(不)`在部门中`(包含子级岗位)`
-11. person`(-not)`-in-org`(-child)`: 人员ID`(不)`在机构中`(包含子级岗位)`
-12. person`(-not)`-in-dist`(-child)`: 人员ID`(不)`在行政区域中`(包含子级岗位)`
+4. user`(-not)`-in-position`(-child)`: 用户ID`(不)`在岗位中`(包含子级岗位)`
+5. user`(-not)`-in-department`(-child)`: 用户ID`(不)`在部门中`(包含子级岗位)`
+6. user`(-not)`-in-org`(-child)`: 用户ID`(不)`在机构中`(包含子级岗位)`
+7. user`(-not)`-in-dist`(-child)`: 用户ID`(不)`在行政区域中`(包含子级岗位)`
+8. person`(-not)`-in-position`(-child)`: 人员ID`(不)`在岗位中`(包含子级岗位)`
+9. person`(-not)`-in-department`(-child)`: 人员ID`(不)`在部门中`(包含子级岗位)`
+10. person`(-not)`-in-org`(-child)`: 人员ID`(不)`在机构中`(包含子级岗位)`
+11. person`(-not)`-in-dist`(-child)`: 人员ID`(不)`在行政区域中`(包含子级岗位)`
 
 注意: 括号中的内容是可选的

+ 0 - 11
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/src/main/java/org/hswebframework/web/service/organizational/simple/terms/CustomSqlTermConfiguration.java

@@ -24,7 +24,6 @@ public class CustomSqlTermConfiguration {
         return new InServiceTreeInSqlTerm<>(districtService, "dist", "s_district", true);
     }
 
-
     @Bean
     public InServiceTreeInSqlTerm<String> orgInSqlTerm(OrganizationalService organizationalService) {
         return new InServiceTreeInSqlTerm<>(organizationalService, "org", "s_organization", false);
@@ -45,16 +44,6 @@ public class CustomSqlTermConfiguration {
         return new InServiceTreeInSqlTerm<>(departmentService, "dept", "s_department", true);
     }
 
-    @Bean
-    public InServiceTreeInSqlTerm<String> positionInSqlTerm(PositionService positionService) {
-        return new InServiceTreeInSqlTerm<>(positionService, "pos", "s_position", false);
-    }
-
-    @Bean
-    public InServiceTreeInSqlTerm<String> positionNotInSqlTerm(PositionService positionService) {
-        return new InServiceTreeInSqlTerm<>(positionService, "pos", "s_position", true);
-    }
-
     @Bean
     public PersonInPositionSqlTerm personInPositionSqlTerm() {
         return new PersonInPositionSqlTerm(false);

+ 3 - 3
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/src/main/java/org/hswebframework/web/service/organizational/simple/terms/UserInPositionSqlTerm.java

@@ -36,7 +36,7 @@ public class UserInPositionSqlTerm extends UserInSqlTerm {
         ChangedTermValue termValue = createChangedTermValue(term);
 
         SqlAppender appender = new SqlAppender();
-        appender.addSpc(not ? "not" : "", "exists(select 1 from s_person_position tmp_");
+        appender.addSpc(not ? "not" : "", "exists(select 1 from s_person_position _tmp");
         if (isChild()) {
             appender.addSpc(",s_position _pos");
         }
@@ -46,10 +46,10 @@ public class UserInPositionSqlTerm extends UserInSqlTerm {
 
         appender.addSpc("where ",
                 createColumnName(column, tableAlias), "=",
-                isForPerson() ? " _tmp.person_id" : "_person.user_id and _person.u_id=tmp_.person_id");
+                isForPerson() ? " _tmp.person_id" : "_person.user_id and _person.u_id=_tmp.person_id");
 
         if (isChild()) {
-            appender.addSpc("and _pos.u_id=tmp_.position_id");
+            appender.addSpc("and _pos.u_id=_tmp.position_id");
         }
 
         List<Object> positionIdList = BoostTermTypeMapper.convertList(column, termValue.getOld());