Kaynağa Gözat

加入查询上级组织

wuxw 6 yıl önce
ebeveyn
işleme
37c2bdfae8

+ 81 - 0
Api/src/main/java/com/java110/api/listener/org/ListParentOrgsListener.java

@@ -0,0 +1,81 @@
+package com.java110.api.listener.org;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.listener.AbstractServiceApiListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.smo.org.IOrgInnerServiceSMO;
+import com.java110.dto.org.OrgDto;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.ServiceCodeOrgConstant;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.api.org.ApiOrgDataVo;
+import com.java110.vo.api.org.ApiOrgVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 查询上级组织侦听类
+ */
+@Java110Listener("listParentOrgsListener")
+public class ListParentOrgsListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private IOrgInnerServiceSMO orgInnerServiceSMOImpl;
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeOrgConstant.LIST_PARENT_ORGS;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.GET;
+    }
+
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public IOrgInnerServiceSMO getOrgInnerServiceSMOImpl() {
+        return orgInnerServiceSMOImpl;
+    }
+
+    public void setOrgInnerServiceSMOImpl(IOrgInnerServiceSMO orgInnerServiceSMOImpl) {
+        this.orgInnerServiceSMOImpl = orgInnerServiceSMOImpl;
+    }
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        OrgDto orgDto = BeanConvertUtil.covertBean(reqJson, OrgDto.class);
+
+
+
+        List<ApiOrgDataVo> parentOrgs = BeanConvertUtil.covertBeanList(orgInnerServiceSMOImpl.queryParentOrgs(orgDto), ApiOrgDataVo.class);
+
+
+        ApiOrgVo apiOrgVo = new ApiOrgVo();
+
+        apiOrgVo.setOrgs(parentOrgs);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiOrgVo), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+
+    }
+}

+ 9 - 0
UserService/src/main/java/com/java110/user/dao/IOrgServiceDao.java

@@ -60,6 +60,15 @@ public interface IOrgServiceDao {
      */
     List<Map> getOrgInfo(Map info) throws DAOException;
 
+    /**
+     * 查询上级组织信息(instance过程)
+     * 根据bId 查询组织信息
+     * @param info bId 信息
+     * @return 组织信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getParentOrgInfo(Map info) throws DAOException;
+
 
 
     /**

+ 8 - 0
UserService/src/main/java/com/java110/user/dao/impl/OrgServiceDaoImpl.java

@@ -91,6 +91,14 @@ public class OrgServiceDaoImpl extends BaseServiceDao implements IOrgServiceDao
         return businessOrgInfos;
     }
 
+    @Override
+    public List<Map> getParentOrgInfo(Map info) throws DAOException {
+        logger.debug("查询上级组织信息 getParentOrgInfo 入参 info : {}",info);
+
+        List<Map> businessOrgInfos = sqlSessionTemplate.selectList("orgServiceDaoImpl.getParentOrgInfo",info);
+
+        return businessOrgInfos;    }
+
 
     /**
      * 修改组织信息

+ 21 - 0
UserService/src/main/java/com/java110/user/smo/impl/OrgInnerServiceSMOImpl.java

@@ -11,6 +11,8 @@ import com.java110.user.dao.IOrgServiceDao;
 import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.ArrayList;
@@ -56,6 +58,25 @@ public class OrgInnerServiceSMOImpl extends BaseServiceSMO implements IOrgInnerS
         return orgServiceDaoImpl.queryOrgsCount(BeanConvertUtil.beanCovertMap(orgDto));
     }
 
+
+    /**
+     * <p>查询上级组织信息</p>
+     *
+     *
+     * @param orgDto 数据对象分享
+     * @return OrgDto 对象数据
+     */
+    @Override
+    public List<OrgDto> queryParentOrgs(@RequestBody OrgDto orgDto) {
+
+        //校验是否传了 分页信息
+
+        List<OrgDto> orgs = BeanConvertUtil.covertBeanList(orgServiceDaoImpl.getOrgInfo(BeanConvertUtil.beanCovertMap(orgDto)), OrgDto.class);
+
+
+        return orgs;
+    }
+
     public IOrgServiceDao getOrgServiceDaoImpl() {
         return orgServiceDaoImpl;
     }

+ 17 - 0
WebService/src/main/java/com/java110/web/components/org/OrgManageComponent.java

@@ -3,6 +3,7 @@ package com.java110.web.components.org;
 
 import com.java110.core.context.IPageData;
 import com.java110.web.smo.org.IListOrgsSMO;
+import com.java110.web.smo.org.IListParentOrgsSMO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
@@ -21,6 +22,9 @@ public class OrgManageComponent {
     @Autowired
     private IListOrgsSMO listOrgsSMOImpl;
 
+    @Autowired
+    private IListParentOrgsSMO listParentOrgsSMOImpl;
+
     /**
      * 查询组织管理列表
      * @param pd 页面数据封装
@@ -30,6 +34,10 @@ public class OrgManageComponent {
         return listOrgsSMOImpl.listOrgs(pd);
     }
 
+    public ResponseEntity<String> getParentOrg(IPageData pd){
+        return listParentOrgsSMOImpl.listParentOrgs(pd);
+    }
+
     public IListOrgsSMO getListOrgsSMOImpl() {
         return listOrgsSMOImpl;
     }
@@ -37,4 +45,13 @@ public class OrgManageComponent {
     public void setListOrgsSMOImpl(IListOrgsSMO listOrgsSMOImpl) {
         this.listOrgsSMOImpl = listOrgsSMOImpl;
     }
+
+
+    public IListParentOrgsSMO getListParentOrgsSMOImpl() {
+        return listParentOrgsSMOImpl;
+    }
+
+    public void setListParentOrgsSMOImpl(IListParentOrgsSMO listParentOrgsSMOImpl) {
+        this.listParentOrgsSMOImpl = listParentOrgsSMOImpl;
+    }
 }

+ 22 - 0
WebService/src/main/java/com/java110/web/smo/org/IListParentOrgsSMO.java

@@ -0,0 +1,22 @@
+package com.java110.web.smo.org;
+
+import com.java110.core.context.IPageData;
+import com.java110.utils.exception.SMOException;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 组织管理管理服务接口类
+ * <p>
+ * add by wuxw 2019-06-29
+ */
+public interface IListParentOrgsSMO {
+
+    /**
+     * 查询组织管理信息
+     *
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象数据
+     * @throws SMOException 业务代码层
+     */
+    ResponseEntity<String> listParentOrgs(IPageData pd) throws SMOException;
+}

+ 66 - 0
WebService/src/main/java/com/java110/web/smo/org/impl/ListParentOrgsSMOImpl.java

@@ -0,0 +1,66 @@
+package com.java110.web.smo.org.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.context.IPageData;
+import com.java110.entity.component.ComponentValidateResult;
+import com.java110.utils.constant.PrivilegeCodeConstant;
+import com.java110.utils.constant.ServiceConstant;
+import com.java110.utils.exception.SMOException;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.web.core.AbstractComponentSMO;
+import com.java110.web.smo.org.IListParentOrgsSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Map;
+
+/**
+ * 查询上级org服务类
+ */
+@Service("listParentOrgsSMOImpl")
+public class ListParentOrgsSMOImpl extends AbstractComponentSMO implements IListParentOrgsSMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    public ResponseEntity<String> listParentOrgs(IPageData pd) throws SMOException {
+        return businessProcess(pd);
+    }
+
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+
+        super.validatePageInfo(pd);
+
+        super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.LIST_ORG);
+    }
+
+    @Override
+    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
+        ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate);
+
+        Map paramMap = BeanConvertUtil.beanCovertMap(result);
+        paramIn.putAll(paramMap);
+
+        String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/org.listParentOrgs" + mapToUrlParam(paramIn);
+
+
+        ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, "",
+                apiUrl,
+                HttpMethod.GET);
+
+        return responseEntity;
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 2 - 6
WebService/src/main/resources/components/orgPackage/org-manage/orgManage.html

@@ -26,13 +26,11 @@
                             <div class="form-group">
                                 <select class="custom-select" v-model="orgManageInfo.conditions.parentOrgId">
                                     <option selected disabled value="">必填,请选择上级组织</option>
-                                    <option value="1">核桃公司</option>
-                                    <option value="2">核桃青海公司</option>
-                                    <option value="3">核桃甘肃公司</option>
+                                    <option v-for="parentOrg in orgManageInfo.parentOrg" :value="parentOrg.orgId">{{parentOrg.parentOrgName}}</option>
                                 </select>
                             </div>
                         </div>
-                        <div class="col-sm-4">
+                        <div class="col-sm-3">
                             <div class="form-group">
                                 <input type="text" placeholder="请输入组织名称" v-model="orgManageInfo.conditions.orgName"
                                        class=" form-control">
@@ -83,8 +81,6 @@
                             <th class="text-center">组织级别</th>
                             <th class="text-center">上级组织</th>
                             <th class="text-center">操作</th>
-
-
                         </tr>
                         </thead>
                         <tbody>

+ 31 - 1
WebService/src/main/resources/components/orgPackage/org-manage/orgManage.js

@@ -12,15 +12,23 @@
                 records:1,
                 moreCondition:false,
                 orgName:'',
+                parentOrg:[],
                 conditions:{
                     orgId:'',
                     orgName:'',
                     orgLevel:'',
                     parentOrgId:'',
-
                 }
             }
         },
+        watch:{
+            "orgManageInfo.conditions.orgLevel":{//深度监听,可监听到对象、数组的变化
+                handler(val, oldVal){
+                   vc.component._parentOrgInfo();
+                },
+                deep:true
+            }
+         },
         _initMethod:function(){
             vc.component._listOrgs(DEFAULT_PAGE, DEFAULT_ROWS);
         },
@@ -79,6 +87,28 @@
                 }else{
                     vc.component.orgManageInfo.moreCondition = true;
                 }
+            },
+
+            _parentOrgInfo:function(){
+
+                var param = {
+                    params:{
+                        orgLevel:vc.component.orgManageInfo.conditions.orgLevel
+                    }
+                 };
+
+               //发送get请求
+               vc.http.get('orgManage',
+                            'getParentOrg',
+                             param,
+                             function(json,res){
+                                var _orgManageInfo=JSON.parse(json);
+                                vc.component.orgManageInfo.parentOrg = _orgManageInfo.orgs;
+
+                             },function(errInfo,error){
+                                console.log('请求失败处理');
+                             }
+                           );
             }
 
              

+ 12 - 0
java110-core/src/main/java/com/java110/core/smo/org/IOrgInnerServiceSMO.java

@@ -39,4 +39,16 @@ public interface IOrgInnerServiceSMO {
      */
     @RequestMapping(value = "/queryOrgsCount", method = RequestMethod.POST)
     int queryOrgsCount(@RequestBody OrgDto orgDto);
+
+
+
+    /**
+     * <p>查询上级组织信息</p>
+     *
+     *
+     * @param orgDto 数据对象分享
+     * @return OrgDto 对象数据
+     */
+    @RequestMapping(value = "/queryParentOrgs", method = RequestMethod.POST)
+    List<OrgDto> queryParentOrgs(@RequestBody OrgDto orgDto);
 }

+ 164 - 153
java110-db/src/main/resources/mapper/user/OrgServiceDaoImplMapper.xml

@@ -5,182 +5,193 @@
 <mapper namespace="orgServiceDaoImpl">
 
     <!-- 保存组织信息 add by wuxw 2018-07-03 -->
-       <insert id="saveBusinessOrgInfo" parameterType="Map">
-           insert into business_org(
-org_name,operate,parent_org_id,description,org_level,store_id,b_id,org_id
-) values (
-#{orgName},#{operate},#{parentOrgId},#{description},#{orgLevel},#{storeId},#{bId},#{orgId}
-)
-       </insert>
-
-
-       <!-- 查询组织信息(Business) add by wuxw 2018-07-03 -->
-       <select id="getBusinessOrgInfo" parameterType="Map" resultType="Map">
-           select  t.org_name,t.org_name orgName,t.operate,t.parent_org_id,t.parent_org_id parentOrgId,t.description,t.org_level,t.org_level orgLevel,t.store_id,t.store_id storeId,t.b_id,t.b_id bId,t.org_id,t.org_id orgId 
-from business_org t 
-where 1 =1 
-<if test="orgName !=null and orgName != ''">
-   and t.org_name= #{orgName}
-</if> 
-<if test="operate !=null and operate != ''">
-   and t.operate= #{operate}
-</if> 
-<if test="parentOrgId !=null and parentOrgId != ''">
-   and t.parent_org_id= #{parentOrgId}
-</if> 
-<if test="description !=null and description != ''">
-   and t.description= #{description}
-</if> 
-<if test="orgLevel !=null and orgLevel != ''">
-   and t.org_level= #{orgLevel}
-</if> 
-<if test="storeId !=null and storeId != ''">
-   and t.store_id= #{storeId}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="orgId !=null and orgId != ''">
-   and t.org_id= #{orgId}
-</if> 
-
-       </select>
+    <insert id="saveBusinessOrgInfo" parameterType="Map">
+        insert into business_org(
+        org_name,operate,parent_org_id,description,org_level,store_id,b_id,org_id
+        ) values (
+        #{orgName},#{operate},#{parentOrgId},#{description},#{orgLevel},#{storeId},#{bId},#{orgId}
+        )
+    </insert>
 
 
+    <!-- 查询组织信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessOrgInfo" parameterType="Map" resultType="Map">
+        select t.org_name,t.org_name orgName,t.operate,t.parent_org_id,t.parent_org_id
+        parentOrgId,t.description,t.org_level,t.org_level orgLevel,t.store_id,t.store_id storeId,t.b_id,t.b_id
+        bId,t.org_id,t.org_id orgId
+        from business_org t
+        where 1 =1
+        <if test="orgName !=null and orgName != ''">
+            and t.org_name= #{orgName}
+        </if>
+        <if test="operate !=null and operate != ''">
+            and t.operate= #{operate}
+        </if>
+        <if test="parentOrgId !=null and parentOrgId != ''">
+            and t.parent_org_id= #{parentOrgId}
+        </if>
+        <if test="description !=null and description != ''">
+            and t.description= #{description}
+        </if>
+        <if test="orgLevel !=null and orgLevel != ''">
+            and t.org_level= #{orgLevel}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            and t.store_id= #{storeId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="orgId !=null and orgId != ''">
+            and t.org_id= #{orgId}
+        </if>
 
+    </select>
 
 
     <!-- 保存组织信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveOrgInfoInstance" parameterType="Map">
         insert into u_org(
-org_name,parent_org_id,description,org_level,status_cd,store_id,b_id,org_id
-) select t.org_name,t.parent_org_id,t.description,t.org_level,'0',t.store_id,t.b_id,t.org_id from business_org t where 1=1
-<if test="orgName !=null and orgName != ''">
-   and t.org_name= #{orgName}
-</if> 
-   and t.operate= 'ADD'
-<if test="parentOrgId !=null and parentOrgId != ''">
-   and t.parent_org_id= #{parentOrgId}
-</if> 
-<if test="description !=null and description != ''">
-   and t.description= #{description}
-</if> 
-<if test="orgLevel !=null and orgLevel != ''">
-   and t.org_level= #{orgLevel}
-</if> 
-<if test="storeId !=null and storeId != ''">
-   and t.store_id= #{storeId}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="orgId !=null and orgId != ''">
-   and t.org_id= #{orgId}
-</if> 
+        org_name,parent_org_id,description,org_level,status_cd,store_id,b_id,org_id
+        ) select t.org_name,t.parent_org_id,t.description,t.org_level,'0',t.store_id,t.b_id,t.org_id from business_org t
+        where 1=1
+        <if test="orgName !=null and orgName != ''">
+            and t.org_name= #{orgName}
+        </if>
+        and t.operate= 'ADD'
+        <if test="parentOrgId !=null and parentOrgId != ''">
+            and t.parent_org_id= #{parentOrgId}
+        </if>
+        <if test="description !=null and description != ''">
+            and t.description= #{description}
+        </if>
+        <if test="orgLevel !=null and orgLevel != ''">
+            and t.org_level= #{orgLevel}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            and t.store_id= #{storeId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="orgId !=null and orgId != ''">
+            and t.org_id= #{orgId}
+        </if>
 
     </insert>
 
 
-
     <!-- 查询组织信息 add by wuxw 2018-07-03 -->
     <select id="getOrgInfo" parameterType="Map" resultType="Map">
-        select  t.org_name,t.org_name orgName,t.parent_org_id,t.parent_org_id parentOrgId,t.description,t.org_level,t.org_level orgLevel,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id storeId,t.b_id,t.b_id bId,t.org_id,t.org_id orgId 
-from u_org t 
-where 1 =1 
-<if test="orgName !=null and orgName != ''">
-   and t.org_name= #{orgName}
-</if> 
-<if test="parentOrgId !=null and parentOrgId != ''">
-   and t.parent_org_id= #{parentOrgId}
-</if> 
-<if test="description !=null and description != ''">
-   and t.description= #{description}
-</if> 
-<if test="orgLevel !=null and orgLevel != ''">
-   and t.org_level= #{orgLevel}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="storeId !=null and storeId != ''">
-   and t.store_id= #{storeId}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="orgId !=null and orgId != ''">
-   and t.org_id= #{orgId}
-</if> 
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.org_name,t.org_name orgName,t.parent_org_id,t.parent_org_id
+        parentOrgId,t.description,t.org_level,t.org_level orgLevel,t.status_cd,t.status_cd
+        statusCd,t.store_id,t.store_id storeId,t.b_id,t.b_id bId,t.org_id,t.org_id orgId
+        from u_org t
+        where 1 =1
+        <if test="orgName !=null and orgName != ''">
+            and t.org_name= #{orgName}
+        </if>
+        <if test="parentOrgId !=null and parentOrgId != ''">
+            and t.parent_org_id= #{parentOrgId}
+        </if>
+        <if test="description !=null and description != ''">
+            and t.description= #{description}
+        </if>
+        <if test="orgLevel !=null and orgLevel != ''">
+            and t.org_level= #{orgLevel}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            and t.store_id= #{storeId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="orgId !=null and orgId != ''">
+            and t.org_id= #{orgId}
+        </if>
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
 
     </select>
 
 
-
-
     <!-- 修改组织信息 add by wuxw 2018-07-03 -->
     <update id="updateOrgInfoInstance" parameterType="Map">
-        update  u_org t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="orgName !=null and orgName != ''">
-, t.org_name= #{orgName}
-</if> 
-<if test="parentOrgId !=null and parentOrgId != ''">
-, t.parent_org_id= #{parentOrgId}
-</if> 
-<if test="description !=null and description != ''">
-, t.description= #{description}
-</if> 
-<if test="orgLevel !=null and orgLevel != ''">
-, t.org_level= #{orgLevel}
-</if> 
-<if test="storeId !=null and storeId != ''">
-, t.store_id= #{storeId}
-</if> 
- where 1=1 <if test="bId !=null and bId != ''">
-and t.b_id= #{bId}
-</if> 
-<if test="orgId !=null and orgId != ''">
-and t.org_id= #{orgId}
-</if> 
+        update u_org t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="orgName !=null and orgName != ''">
+            , t.org_name= #{orgName}
+        </if>
+        <if test="parentOrgId !=null and parentOrgId != ''">
+            , t.parent_org_id= #{parentOrgId}
+        </if>
+        <if test="description !=null and description != ''">
+            , t.description= #{description}
+        </if>
+        <if test="orgLevel !=null and orgLevel != ''">
+            , t.org_level= #{orgLevel}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            , t.store_id= #{storeId}
+        </if>
+        where 1=1
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="orgId !=null and orgId != ''">
+            and t.org_id= #{orgId}
+        </if>
 
     </update>
 
     <!-- 查询组织数量 add by wuxw 2018-07-03 -->
-     <select id="queryOrgsCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from u_org t 
-where 1 =1 
-<if test="orgName !=null and orgName != ''">
-   and t.org_name= #{orgName}
-</if> 
-<if test="parentOrgId !=null and parentOrgId != ''">
-   and t.parent_org_id= #{parentOrgId}
-</if> 
-<if test="description !=null and description != ''">
-   and t.description= #{description}
-</if> 
-<if test="orgLevel !=null and orgLevel != ''">
-   and t.org_level= #{orgLevel}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="storeId !=null and storeId != ''">
-   and t.store_id= #{storeId}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="orgId !=null and orgId != ''">
-   and t.org_id= #{orgId}
-</if> 
-
-
-     </select>
+    <select id="queryOrgsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from u_org t
+        where 1 =1
+        <if test="orgName !=null and orgName != ''">
+            and t.org_name= #{orgName}
+        </if>
+        <if test="parentOrgId !=null and parentOrgId != ''">
+            and t.parent_org_id= #{parentOrgId}
+        </if>
+        <if test="description !=null and description != ''">
+            and t.description= #{description}
+        </if>
+        <if test="orgLevel !=null and orgLevel != ''">
+            and t.org_level= #{orgLevel}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            and t.store_id= #{storeId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="orgId !=null and orgId != ''">
+            and t.org_id= #{orgId}
+        </if>
+
+
+    </select>
+    <!-- 查询上级组织信息 -->
+    <select id="getParentOrgInfo" parameterType="Map" resultType="Map">
+        SELECT t.org_name,t.org_name orgName,t.parent_org_id,t.parent_org_id
+        parentOrgId,t.description,t.org_level,t.org_level orgLevel,t.status_cd,t.status_cd
+        statusCd,t.store_id,t.store_id storeId,t.b_id,t.b_id bId,t.org_id,t.org_id orgId
+        FROM u_org o,u_org t
+        WHERE o.`org_level` = #{orgLevel}
+        AND o.`store_id` = t.`store_id`
+        AND o.`parent_org_id` = t.`org_id`
+        AND o.`store_id` = #{storeId}
+    </select>
 
 </mapper>

+ 5 - 0
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeOrgConstant.java

@@ -27,5 +27,10 @@ public class ServiceCodeOrgConstant {
      */
     public static final String LIST_ORGS = "org.listOrgs";
 
+    /**
+     * 查询 上级组织管理
+     */
+    public static final String LIST_PARENT_ORGS = "org.listParentOrgs";
+
 
 }