Browse Source

feat:[系统管理] [部门管理] 按照原型修改界面,增加部门分类字段

master
memorylkf 3 weeks ago
parent
commit
ad28bc2c28
3 changed files with 76 additions and 4 deletions
  1. +12
    -0
      hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDept.java
  2. +56
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/dept/DeptTypeEnum.java
  3. +8
    -4
      hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysDeptMapper.xml

+ 12
- 0
hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDept.java View File

@ -51,6 +51,9 @@ public class SysDept extends BaseEntity
/** 父部门名称 */
private String parentName;
/** 组织类型:1部门,3学科,5小组 */
private Integer type;
/** 子部门 */
private List<SysDept> children = new ArrayList<SysDept>();
@ -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;
}
}

+ 56
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/dept/DeptTypeEnum.java View File

@ -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;
}
}

+ 8
- 4
hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysDeptMapper.xml View File

@ -20,10 +20,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="type" column="type" />
</resultMap>
<sql id="selectDeptVo">
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
</sql>
@ -96,7 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phone != null and phone != ''">phone,</if>
<if test="email != null and email != ''">email,</if>
<if test="status != null">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="type != null and type != 0">`type`,</if>
create_time
)values(
<if test="deptId != null and deptId != 0">#{deptId},</if>
@ -108,7 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phone != null and phone != ''">#{phone},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="type != null and type != 0">#{type},</if>
sysdate()
)
</insert>
@ -124,7 +127,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phone != null">phone = #{phone},</if>
<if test="email != null">email = #{email},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="type != null and type != 0">`type` = #{type},</if>
update_time = sysdate()
</set>
where dept_id = #{deptId}

Loading…
Cancel
Save