diff --git a/src/main/java/com/zteits/oa/api/dto/asraop/param/AsraOpQueryReq.java b/src/main/java/com/zteits/oa/api/dto/asraop/param/AsraOpQueryReq.java index 95fca6d..71cafef 100644 --- a/src/main/java/com/zteits/oa/api/dto/asraop/param/AsraOpQueryReq.java +++ b/src/main/java/com/zteits/oa/api/dto/asraop/param/AsraOpQueryReq.java @@ -30,6 +30,16 @@ public class AsraOpQueryReq extends BaseRequest{ /**员工idlist*/ private List opIdLists; + /**员工idlist*/ + private List opParentIdLists; + + public List getOpParentIdLists() { + return opParentIdLists; + } + + public void setOpParentIdLists(List opParentIdLists) { + this.opParentIdLists = opParentIdLists; + } public List getOpIdLists() { return opIdLists; diff --git a/src/main/java/com/zteits/oa/api/service/report/query/AsraOpRelationsQueryService.java b/src/main/java/com/zteits/oa/api/service/report/query/AsraOpRelationsQueryService.java deleted file mode 100644 index 93233b5..0000000 --- a/src/main/java/com/zteits/oa/api/service/report/query/AsraOpRelationsQueryService.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.zteits.oa.api.service.report.query; - -import com.zteits.oa.api.base.bean.BizResult; -import com.zteits.oa.api.base.bean.PageBean; -import com.zteits.oa.api.dto.asraop.AsraOpDTO; -import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq; -import com.zteits.oa.api.dto.asraoprelations.AsraOpRelationsDTO; -import com.zteits.oa.api.dto.asraoprelations.param.AsraOpRelationsQueryReq; - -import java.util.List; - -/** - * 员工关系表查询service.
- * - * Copyright: Copyright (c) 2017 ZTE-ITS - * - * @ClassName: AmountUtils.java - * @Description: - * @version: v1.0.0 - * @author: wangfs - * @date: 2018年7月30日 - * Modification History: - * Date Author Version Description - *---------------------------------------------------------* - * 2018年7月30日 xiejp v1.0.0 创建 - */ -public interface AsraOpRelationsQueryService { - - /** - * 根据登录工号查询管理的员工信息 - * @param - * @return - * @Author: xiejianpeng - * @Date: 2018/7/31 10:33 - * - */ - BizResult> queryAsraOpRelations(AsraOpRelationsQueryReq asraOpRelationsQueryReq); -} diff --git a/src/main/java/com/zteits/oa/report/biz/AsraOpRelationsQueryServiceImpl.java b/src/main/java/com/zteits/oa/report/biz/AsraOpRelationsQueryServiceImpl.java deleted file mode 100644 index 03b33be..0000000 --- a/src/main/java/com/zteits/oa/report/biz/AsraOpRelationsQueryServiceImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.zteits.oa.report.biz; - -import com.xiaoleilu.hutool.util.CollectionUtil; -import com.zteits.oa.api.base.bean.BizResult; -import com.zteits.oa.api.dto.asraoprelations.AsraOpRelationsDTO; -import com.zteits.oa.api.dto.asraoprelations.param.AsraOpRelationsQueryReq; -import com.zteits.oa.api.service.report.query.AsraOpRelationsQueryService; -import com.zteits.oa.report.domain.AsraOpRelations; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; - -/** - * Copyright: Copyright (c) 2018 zteits - * - * @Description: - * @version: v1.0.0 - * @author: xiejianpeng - * @date: 2018/7/31 11 - * Modification History: - * Date Author Version Description - * ---------------------------------------------------------* - * 2018/7/31 xiejianpeng v1.0.0 创建 - */ -@Service -public class AsraOpRelationsQueryServiceImpl implements AsraOpRelationsQueryService { - - //@Autowired - //private AsraOpRelationsDao asraOpRelationsDao; - - @Override - public BizResult> queryAsraOpRelations(AsraOpRelationsQueryReq asraOpRelationsQueryReq) { - - List asraOpRelationsDTOs = new ArrayList<>(); - List asraOpRelationsList = null;//asraOpRelationsDao.queryAsraOpRelations(asraOpRelationsQueryReq.getParentId()); - if(CollectionUtil.isNotEmpty(asraOpRelationsList)) { - BeanUtils.copyProperties(asraOpRelationsList, asraOpRelationsDTOs, AsraOpRelationsDTO.class); - } - return new BizResult<>(asraOpRelationsDTOs); - } -} diff --git a/src/main/java/com/zteits/oa/report/dao/impl/AsraDailyDaoImpl.java b/src/main/java/com/zteits/oa/report/dao/impl/AsraDailyDaoImpl.java index 50dd97c..a59324d 100644 --- a/src/main/java/com/zteits/oa/report/dao/impl/AsraDailyDaoImpl.java +++ b/src/main/java/com/zteits/oa/report/dao/impl/AsraDailyDaoImpl.java @@ -8,14 +8,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.xiaoleilu.hutool.date.DateUtil; -import com.xiaoleilu.hutool.util.CollectionUtil; import com.zteits.oa.api.dto.asradaily.param.AsraDailyForTotalNumAndDetailReq; import com.zteits.oa.api.dto.asradaily.param.AsraDailyQueryReq; import com.zteits.oa.report.dao.AsraDailyDao; import com.zteits.oa.report.domain.AsraDaily; import com.zteits.oa.report.domain.AsraDailyExample; -import com.zteits.oa.report.domain.AsraOpRelations; -import com.zteits.oa.report.domain.AsraOpRelationsExample; import com.zteits.oa.report.domain.sdo.AsraDailyDO; import com.zteits.oa.report.domain.sdo.AsraDailyOpNumForCurrentDayDO; import com.zteits.oa.report.mapper.AsraDailyMapper; @@ -72,21 +69,6 @@ public class AsraDailyDaoImpl implements AsraDailyDao{ AsraDailyOpNumForCurrentDayDO asraDailyOpNumForCurrentDayDO = new AsraDailyOpNumForCurrentDayDO(); List opList = new ArrayList<>(); int employeeTotal = 0; -// //1.总人数获取 -// AsraOpRelationsExample example = new AsraOpRelationsExample(); -// example.createCriteria().andParentIdEqualTo(request.getOpId()); -// //List selectByExample = asraOpRelationsMapper.selectByExample(example); -// int employeeTotal = (CollectionUtil.isNotEmpty(selectByExample) ? selectByExample.size() +1 : 1); -// asraDailyOpNumForCurrentDayDO.setEmployeeTotal(employeeTotal); -// //获取员工人数 -// if(CollectionUtil.isNotEmpty(selectByExample)){ -// for(AsraOpRelations op:selectByExample){ -// if(op == null){ -// continue; -// } -// opList.add(op.getOpId()); -// } -// } opList.add(request.getOpId());//查询自己id //2.查询今日日报填写人数 AsraDailyExample exampleTwo = new AsraDailyExample(); diff --git a/src/main/java/com/zteits/oa/report/domain/AsraOpRelations.java b/src/main/java/com/zteits/oa/report/domain/AsraOpRelations.java deleted file mode 100644 index 17eb23c..0000000 --- a/src/main/java/com/zteits/oa/report/domain/AsraOpRelations.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.zteits.oa.report.domain; - -public class AsraOpRelations { - /**主键*/ - private Long id; - - /**父级ID*/ - private Long parentId; - - /**员工ID*/ - private Long opId; - - /**数据状态:1有效,0无效,2:锁定*/ - private Integer dataState; - - /**获取主键*/ - public Long getId() { - return id; - } - - /**设置主键*/ - public void setId(Long id) { - this.id = id; - } - - /**获取父级ID*/ - public Long getParentId() { - return parentId; - } - - /**设置父级ID*/ - public void setParentId(Long parentId) { - this.parentId = parentId; - } - - /**获取员工ID*/ - public Long getOpId() { - return opId; - } - - /**设置员工ID*/ - public void setOpId(Long opId) { - this.opId = opId; - } - - /**获取数据状态:1有效,0无效,2:锁定*/ - public Integer getDataState() { - return dataState; - } - - /**设置数据状态:1有效,0无效,2:锁定*/ - public void setDataState(Integer dataState) { - this.dataState = dataState; - } -} \ No newline at end of file diff --git a/src/main/java/com/zteits/oa/report/domain/AsraOpRelationsExample.java b/src/main/java/com/zteits/oa/report/domain/AsraOpRelationsExample.java deleted file mode 100644 index b97cb96..0000000 --- a/src/main/java/com/zteits/oa/report/domain/AsraOpRelationsExample.java +++ /dev/null @@ -1,440 +0,0 @@ -package com.zteits.oa.report.domain; - -import java.util.ArrayList; -import java.util.List; - -public class AsraOpRelationsExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public AsraOpRelationsExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andParentIdIsNull() { - addCriterion("parent_id is null"); - return (Criteria) this; - } - - public Criteria andParentIdIsNotNull() { - addCriterion("parent_id is not null"); - return (Criteria) this; - } - - public Criteria andParentIdEqualTo(Long value) { - addCriterion("parent_id =", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotEqualTo(Long value) { - addCriterion("parent_id <>", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdGreaterThan(Long value) { - addCriterion("parent_id >", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdGreaterThanOrEqualTo(Long value) { - addCriterion("parent_id >=", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdLessThan(Long value) { - addCriterion("parent_id <", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdLessThanOrEqualTo(Long value) { - addCriterion("parent_id <=", value, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdIn(List values) { - addCriterion("parent_id in", values, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotIn(List values) { - addCriterion("parent_id not in", values, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdBetween(Long value1, Long value2) { - addCriterion("parent_id between", value1, value2, "parentId"); - return (Criteria) this; - } - - public Criteria andParentIdNotBetween(Long value1, Long value2) { - addCriterion("parent_id not between", value1, value2, "parentId"); - return (Criteria) this; - } - - public Criteria andOpIdIsNull() { - addCriterion("op_id is null"); - return (Criteria) this; - } - - public Criteria andOpIdIsNotNull() { - addCriterion("op_id is not null"); - return (Criteria) this; - } - - public Criteria andOpIdEqualTo(Long value) { - addCriterion("op_id =", value, "opId"); - return (Criteria) this; - } - - public Criteria andOpIdNotEqualTo(Long value) { - addCriterion("op_id <>", value, "opId"); - return (Criteria) this; - } - - public Criteria andOpIdGreaterThan(Long value) { - addCriterion("op_id >", value, "opId"); - return (Criteria) this; - } - - public Criteria andOpIdGreaterThanOrEqualTo(Long value) { - addCriterion("op_id >=", value, "opId"); - return (Criteria) this; - } - - public Criteria andOpIdLessThan(Long value) { - addCriterion("op_id <", value, "opId"); - return (Criteria) this; - } - - public Criteria andOpIdLessThanOrEqualTo(Long value) { - addCriterion("op_id <=", value, "opId"); - return (Criteria) this; - } - - public Criteria andOpIdIn(List values) { - addCriterion("op_id in", values, "opId"); - return (Criteria) this; - } - - public Criteria andOpIdNotIn(List values) { - addCriterion("op_id not in", values, "opId"); - return (Criteria) this; - } - - public Criteria andOpIdBetween(Long value1, Long value2) { - addCriterion("op_id between", value1, value2, "opId"); - return (Criteria) this; - } - - public Criteria andOpIdNotBetween(Long value1, Long value2) { - addCriterion("op_id not between", value1, value2, "opId"); - return (Criteria) this; - } - - public Criteria andDataStateIsNull() { - addCriterion("data_state is null"); - return (Criteria) this; - } - - public Criteria andDataStateIsNotNull() { - addCriterion("data_state is not null"); - return (Criteria) this; - } - - public Criteria andDataStateEqualTo(Integer value) { - addCriterion("data_state =", value, "dataState"); - return (Criteria) this; - } - - public Criteria andDataStateNotEqualTo(Integer value) { - addCriterion("data_state <>", value, "dataState"); - return (Criteria) this; - } - - public Criteria andDataStateGreaterThan(Integer value) { - addCriterion("data_state >", value, "dataState"); - return (Criteria) this; - } - - public Criteria andDataStateGreaterThanOrEqualTo(Integer value) { - addCriterion("data_state >=", value, "dataState"); - return (Criteria) this; - } - - public Criteria andDataStateLessThan(Integer value) { - addCriterion("data_state <", value, "dataState"); - return (Criteria) this; - } - - public Criteria andDataStateLessThanOrEqualTo(Integer value) { - addCriterion("data_state <=", value, "dataState"); - return (Criteria) this; - } - - public Criteria andDataStateIn(List values) { - addCriterion("data_state in", values, "dataState"); - return (Criteria) this; - } - - public Criteria andDataStateNotIn(List values) { - addCriterion("data_state not in", values, "dataState"); - return (Criteria) this; - } - - public Criteria andDataStateBetween(Integer value1, Integer value2) { - addCriterion("data_state between", value1, value2, "dataState"); - return (Criteria) this; - } - - public Criteria andDataStateNotBetween(Integer value1, Integer value2) { - addCriterion("data_state not between", value1, value2, "dataState"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/src/main/java/com/zteits/oa/report/web/AsraOpController.java b/src/main/java/com/zteits/oa/report/web/AsraOpController.java index ebe5510..aeab69c 100644 --- a/src/main/java/com/zteits/oa/report/web/AsraOpController.java +++ b/src/main/java/com/zteits/oa/report/web/AsraOpController.java @@ -1,31 +1,23 @@ package com.zteits.oa.report.web; import com.alibaba.fastjson.JSONObject; -import com.xiaoleilu.hutool.util.CollectionUtil; import com.zteits.oa.api.base.bean.BizResult; import com.zteits.oa.api.base.bean.PageBean; import com.zteits.oa.api.base.constants.SessionEnum; import com.zteits.oa.api.dto.asraop.AsraOpDTO; import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq; -import com.zteits.oa.api.dto.asraoprelations.AsraOpRelationsDTO; -import com.zteits.oa.api.dto.asraoprelations.param.AsraOpRelationsQueryReq; import com.zteits.oa.api.service.report.query.AsraOpQueryService; -import com.zteits.oa.api.service.report.query.AsraOpRelationsQueryService; import com.zteits.oa.report.web.vo.EasyUIDataGridVO; import io.swagger.annotations.Api; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cglib.core.CollectionUtils; 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 javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import java.util.ArrayList; -import java.util.List; @Api(value = "日报系统-员工管理", description = "日报系统-员工管理") @RestController @@ -38,15 +30,12 @@ public class AsraOpController extends BizController { private AsraOpQueryService asraOpQueryService; - - - @RequestMapping(value="/queryAsraOpPage",method = RequestMethod.POST) public BizResult> queryAsraOpPage(@RequestBody AsraOpQueryReq asraOpQueryReq, HttpServletRequest request) throws IllegalAccessException, InstantiationException { logger.info("日报系统-员工管理-根据登录人分页查询员工信息入参:{}", JSONObject.toJSON(asraOpQueryReq)); /**1.根据当前登录人查询登录人下面管理的员工-缓存中获取*/ AsraOpDTO asraOpDTO = (AsraOpDTO)request.getSession().getAttribute(SessionEnum.USER_INFO.key()); - asraOpQueryReq.setId(asraOpDTO.getId()); + asraOpQueryReq.setOpIdLists(asraOpDTO.getOpIds()); BizResult> result = asraOpQueryService.queryAsraOpForPage(asraOpQueryReq); logger.info("日报系统-员工管理-根据登录人分页查询员工信息结果:{}", JSONObject.toJSON(result)); return returnJqGridData(result, AsraOpDTO.class); diff --git a/src/main/java/com/zteits/oa/report/web/OAuthController.java b/src/main/java/com/zteits/oa/report/web/OAuthController.java index f3a985b..8e0d21a 100644 --- a/src/main/java/com/zteits/oa/report/web/OAuthController.java +++ b/src/main/java/com/zteits/oa/report/web/OAuthController.java @@ -6,6 +6,8 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import com.xiaoleilu.hutool.util.CollectionUtil; +import com.zteits.oa.api.base.bean.PageBean; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -92,8 +94,10 @@ public class OAuthController { List opIds = new ArrayList<>(); opIds.add(asraOpDTO.getId()); + List opParentIds = new ArrayList<>(); + opParentIds.add(asraOpDTO.getId()); /**递归查询员工ids.*/ - opIds = queryOpTreeByOpId(asraOpDTO.getParentId(),opIds); + opIds = queryOpTreeByOpId(opParentIds,opIds); logger.info("---获取到的opIds={}",JSONObject.toJSON(opIds)); asraOpDTO.setOpIds(opIds); HttpSession session = request.getSession(); @@ -115,7 +119,7 @@ public class OAuthController { } /** * 退出登录 - * @param req + * @param * @return * 2018年7月31日 wangfs.
*/ @@ -135,27 +139,35 @@ public class OAuthController { /** * 递归查询员工id.
- * @param parentOpId + * @param * @param opList * @return * 2018年8月2日 wangfs.
*/ - private List queryOpTreeByOpId(Long parentOpId,List opList){ - if(parentOpId != null && !parentOpId.equals(-1L)){ + private List queryOpTreeByOpId(List queryOpList,List opList){ + if(queryOpList != null && CollectionUtil.isNotEmpty(queryOpList)){ AsraOpQueryReq asraOpQueryRe = new AsraOpQueryReq(); - asraOpQueryRe.setId(parentOpId); - BizResult asraOpReult = asraOpQueryService.queryAsraOp(asraOpQueryRe); + asraOpQueryRe.setOpParentIdLists(queryOpList); + asraOpQueryRe.getBaseRequest().setPageNum(1); + asraOpQueryRe.getBaseRequest().setPageSize(0); + BizResult> asraOpReult = asraOpQueryService.queryAsraOpForPage(asraOpQueryRe); if(asraOpReult != null && asraOpReult.getData() != null){ - AsraOpDTO data = asraOpReult.getData(); - if(data != null){ - opList.add(data.getId()); + queryOpList.clear(); + List data = asraOpReult.getData().getDataList(); + if(CollectionUtil.isNotEmpty(data)){ + for(AsraOpDTO dto:data){ + queryOpList.add(dto.getId()); + opList.add(dto.getId()); + } } - queryOpTreeByOpId(data.getParentId(),opList); + queryOpTreeByOpId(queryOpList,opList); } } - return opList; } - + + + + } diff --git a/src/main/resources/mybatis/smapper/AsraOpSmapper.xml b/src/main/resources/mybatis/smapper/AsraOpSmapper.xml index d6d298a..bc1112d 100644 --- a/src/main/resources/mybatis/smapper/AsraOpSmapper.xml +++ b/src/main/resources/mybatis/smapper/AsraOpSmapper.xml @@ -19,43 +19,43 @@ + - id, login_code, login_password, op_name, email, role_id, city_id, city_name, - is_remind_email, data_state, create_empid, create_emp_name, create_date, modfiy_empid, - modfiy_emp_name, modfiy_date, remark + id, login_code, login_password, op_name, email, role_id, city_id, city_name, is_remind_email, + data_state, create_empid, create_emp_name, create_date, modfiy_empid, modfiy_emp_name, + modfiy_date, remark, parent_id - select - ap.id id, - ap.login_code loginCode, - ap.op_name opName, - ap.email email, - ap.role_id roleId, - ap.city_id cityId, - ap.city_name cityName, - ap.is_remind_email isRemindEmail - from asra_op ap left join asra_op_relations apr on ap.id = apr.op_id + + from asra_op where 1=1 - and (apr.parent_id = #{id} or ap.id = #{id}) + id = #{id} - and ap.login_code = #{loginCode,jdbcType=VARCHAR} + and login_code = #{loginCode,jdbcType=VARCHAR} - and ap.op_name like concat('%','${opName}','%') + and op_name like concat('%','${opName}','%') - and ap.email = #{email,jdbcType=VARCHAR} + and email = #{email,jdbcType=VARCHAR} - and ap.id in + and id in #{opId} + + and parent_id in + + #{opId} + + \ No newline at end of file