diff --git a/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDept.java b/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDept.java index 5c5508b..89ee20d 100644 --- a/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDept.java +++ b/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDept.java @@ -51,6 +51,9 @@ public class SysDept extends BaseEntity /** 父部门名称 */ private String parentName; + + /** 组织类型:1部门,3学科,5小组 */ + private Integer type; /** 子部门 */ private List children = new ArrayList(); @@ -198,6 +201,15 @@ public class SysDept extends BaseEntity .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) + .append("type", getType()) .toString(); } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/dept/DeptTypeEnum.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/dept/DeptTypeEnum.java new file mode 100644 index 0000000..2f8bd72 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/dept/DeptTypeEnum.java @@ -0,0 +1,56 @@ +package com.hxhq.business.enums.dept; + +/** + * 组织类型:1部门,3学科,5小组 + * @author tanfei + */ +public enum DeptTypeEnum { + + /** + * 部门 + */ + dept(1, "部门"), + + /** + * 学科 + */ + subject(3, "学科"), + + /** + * 小组 + */ + team(5, "小组"); + + private int value; + private String text; + + DeptTypeEnum(int value, String text) { + this.value = value; + this.text = text; + } + + public int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public static DeptTypeEnum getEnumByValue(int type) { + for (DeptTypeEnum bt : values()) { + if (bt.value == type) { + return bt; + } + } + return null; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysDeptMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysDeptMapper.xml index 740a6a2..b8529a1 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -20,10 +20,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time + select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time, d.type from sys_dept d @@ -96,7 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" phone, email, status, - create_by, + create_by, + `type`, create_time )values( #{deptId}, @@ -108,7 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{phone}, #{email}, #{status}, - #{createBy}, + #{createBy}, + #{type}, sysdate() ) @@ -124,7 +127,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" phone = #{phone}, email = #{email}, status = #{status}, - update_by = #{updateBy}, + update_by = #{updateBy}, + `type` = #{type}, update_time = sysdate() where dept_id = #{deptId}