Commit 682c8294 by zhengxj

finish 返回父节点名 on 20190224 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@17710 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 5c9495ba
...@@ -118,4 +118,12 @@ public class OrganizationController extends BaseController{ ...@@ -118,4 +118,12 @@ public class OrganizationController extends BaseController{
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg()); return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg());
} }
@RequestMapping(value = "/selectDetailById", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject selectDetailById(@RequestParam(value = "id", required = false) Integer id) {
if (id == null) {
return new ResultObject(ResultCodeEnum.FAIL.getCode(), ResultCodeEnum.FAIL);
}
return new ResultObject(ResultCodeEnum.SUCCESS.getCode() , ResultCodeEnum.SUCCESS.getMsg(), organizationService.selectDetailById(id));
}
} }
...@@ -4,7 +4,6 @@ package com.glsx.usercenter.mapper; ...@@ -4,7 +4,6 @@ package com.glsx.usercenter.mapper;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.glsx.usercenter.pojo.user.SysUser;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.glsx.usercenter.pojo.menu.SysOrganization; import com.glsx.usercenter.pojo.menu.SysOrganization;
...@@ -39,4 +38,6 @@ public interface SysOrganizationMapper { ...@@ -39,4 +38,6 @@ public interface SysOrganizationMapper {
List<SysOrganization> getAllGroup(@Param("id")Integer id,@Param("parentId")Integer parentId); List<SysOrganization> getAllGroup(@Param("id")Integer id,@Param("parentId")Integer parentId);
SysOrganization selectDetailById(Integer id);
} }
\ No newline at end of file \ No newline at end of file
package com.glsx.usercenter.pojo.menu; package com.glsx.usercenter.pojo.menu;
import com.glsx.usercenter.pojo.user.SysUser;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.glsx.usercenter.pojo.user.SysUser;
public class SysOrganization { public class SysOrganization {
private Integer id; private Integer id;
...@@ -33,6 +33,8 @@ public class SysOrganization { ...@@ -33,6 +33,8 @@ public class SysOrganization {
private String orgGroup; private String orgGroup;
private String parentName;
private List<SysOrganization> children; private List<SysOrganization> children;
private List<SysUser> sysUserList = new ArrayList<>(); private List<SysUser> sysUserList = new ArrayList<>();
...@@ -156,4 +158,18 @@ public class SysOrganization { ...@@ -156,4 +158,18 @@ public class SysOrganization {
public void setSysUserList(List<SysUser> sysUserList) { public void setSysUserList(List<SysUser> sysUserList) {
this.sysUserList = sysUserList; this.sysUserList = sysUserList;
} }
/**
* @return the parentName
*/
public String getParentName() {
return parentName;
}
/**
* @param parentName the parentName to set
*/
public void setParentName(String parentName) {
this.parentName = parentName;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -33,4 +33,6 @@ public interface ISysOrganizationService { ...@@ -33,4 +33,6 @@ public interface ISysOrganizationService {
List<SysOrganization> findOrgById(Integer id); List<SysOrganization> findOrgById(Integer id);
SysOrganization selectDetailById(Integer id);
} }
...@@ -35,7 +35,7 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService{ ...@@ -35,7 +35,7 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService{
private SysOrganizationMapper orgDao; private SysOrganizationMapper orgDao;
/** /**
* * SysOrganization selectDetailById(Integer id);
*/ */
@Override @Override
public long countByExample(SysOrganizationExample example) { public long countByExample(SysOrganizationExample example) {
...@@ -367,4 +367,14 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService{ ...@@ -367,4 +367,14 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService{
return resultList; return resultList;
} }
/* (non-Javadoc)
* @see com.glsx.usercenter.service.ISysOrganizationService#selectDetailById(java.lang.Integer)
*/
@Override
public SysOrganization selectDetailById(Integer id) {
// TODO Auto-generated method stub
return orgDao.selectDetailById(id);
}
} }
...@@ -279,4 +279,16 @@ ...@@ -279,4 +279,16 @@
AND so.parent_id = #{parentId,jdbcType=TINYINT} AND so.parent_id = #{parentId,jdbcType=TINYINT}
AND so.org_status = 1 AND so.org_status = 1
</select> </select>
<select id="selectDetailById" resultType="com.glsx.usercenter.pojo.menu.SysOrganization">
SELECT
sor.*,so.name parentName
FROM
sys_organization so
INNER JOIN sys_organization sor ON so.id = sor.parent_id
WHERE
sor.id = #{id}
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!