|
@@ -73,9 +73,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
select count(1) from sys_dept
|
|
|
where del_flag = '0' and parent_id = #{deptId} and rownum <![CDATA[ <= ]]> 1
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
|
|
|
- select * from sys_dept where find_in_set(#{deptId}, ancestors)
|
|
|
+ select * from sys_dept where instr(#{deptId}, ancestors) <![CDATA[ <> ]]> 0
|
|
|
</select>
|
|
|
|
|
|
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
|
|
@@ -88,6 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertDept" parameterType="SysDept">
|
|
|
+ <selectKey keyProperty="deptId" resultType="long" order="BEFORE">
|
|
|
+ SELECT seq_sys_dept.NEXTVAL as deptId FROM DUAL
|
|
|
+ </selectKey>
|
|
|
insert into sys_dept(
|
|
|
<if test="deptId != null and deptId != 0">dept_id,</if>
|
|
|
<if test="parentId != null and parentId != 0">parent_id,</if>
|
|
@@ -111,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="email != null and email != ''">#{email},</if>
|
|
|
<if test="status != null">#{status},</if>
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
- sysdate()
|
|
|
+ sysdate
|
|
|
)
|
|
|
</insert>
|
|
|
|
|
@@ -127,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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>
|
|
|
- update_time = sysdate()
|
|
|
+ update_time = sysdate
|
|
|
</set>
|
|
|
where dept_id = #{deptId}
|
|
|
</update>
|