From ad28bc2c28c276061efd8b2b8f6f4c0d6c51e779 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Fri, 19 Dec 2025 11:16:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:[=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86]=20[?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=AE=A1=E7=90=86]=20=E6=8C=89=E7=85=A7?= =?UTF-8?q?=E5=8E=9F=E5=9E=8B=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=83=A8=E9=97=A8=E5=88=86=E7=B1=BB=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hxhq/system/api/domain/SysDept.java | 12 +++++ .../com/hxhq/business/enums/dept/DeptTypeEnum.java | 56 ++++++++++++++++++++++ .../main/resources/mapper/system/SysDeptMapper.xml | 12 +++-- 3 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/dept/DeptTypeEnum.java 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}