This commit is contained in:
sxu 2025-02-27 18:45:35 +08:00
parent f8d3762aca
commit 2f1714b4da
2 changed files with 1 additions and 2 deletions

View File

@ -308,7 +308,6 @@ public class SysDeptServiceImpl implements ISysDeptService
@Transactional(rollbackFor = Exception.class)
public int insertDept(SysDept dept)
{
dept.setDeptId(Id.next());
//增加根公司的处理
if (dept.getParentId() == null){
dept.setParentId(0L);

View File

@ -188,7 +188,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
</select>
<insert id="insertDept" parameterType="com.bonus.system.api.domain.SysDept">
<insert id="insertDept" parameterType="com.bonus.system.api.domain.SysDept" useGeneratedKeys="true" keyProperty="deptId">
insert into sys_dept(
<if test="deptId != null and deptId != 0">dept_id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>