|
@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="parentId" column="parent_id" />
|
|
<result property="parentId" column="parent_id" />
|
|
|
<result property="ancestors" column="ancestors" />
|
|
<result property="ancestors" column="ancestors" />
|
|
|
<result property="deptName" column="dept_name" />
|
|
<result property="deptName" column="dept_name" />
|
|
|
|
|
+ <result property="deptType" column="deptType" />
|
|
|
<result property="orderNum" column="order_num" />
|
|
<result property="orderNum" column="order_num" />
|
|
|
<result property="leader" column="leader" />
|
|
<result property="leader" column="leader" />
|
|
|
<result property="phone" column="phone" />
|
|
<result property="phone" column="phone" />
|
|
@@ -23,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectDeptVo">
|
|
<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.deptType, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
|
|
|
from sys_dept d
|
|
from sys_dept d
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
@@ -47,6 +48,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="deptName != null and deptName != ''">
|
|
<if test="deptName != null and deptName != ''">
|
|
|
AND dept_name like concat('%', #{deptName}, '%')
|
|
AND dept_name like concat('%', #{deptName}, '%')
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="deptType != null and deptType != ''">
|
|
|
|
|
+ AND deptType = #{deptType}
|
|
|
|
|
+ </if>
|
|
|
<if test="status != null and status != ''">
|
|
<if test="status != null and status != ''">
|
|
|
AND status = #{status}
|
|
AND status = #{status}
|
|
|
</if>
|
|
</if>
|
|
@@ -72,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
|
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
|
|
- select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
|
|
|
|
|
|
|
+ select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.deptType, d.order_num, d.leader, d.phone, d.email, d.status,
|
|
|
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
|
|
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
|
|
|
from sys_dept d
|
|
from sys_dept d
|
|
|
where d.dept_id = #{deptId}
|
|
where d.dept_id = #{deptId}
|
|
@@ -86,11 +90,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
|
|
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
- <insert id="insertDept" parameterType="SysDept">
|
|
|
|
|
|
|
+ <insert id="insertDept" parameterType="SysDept" useGeneratedKeys="true" keyProperty="deptId">
|
|
|
insert into sys_dept(
|
|
insert into sys_dept(
|
|
|
<if test="deptId != null and deptId != 0">dept_id,</if>
|
|
<if test="deptId != null and deptId != 0">dept_id,</if>
|
|
|
<if test="parentId != null and parentId != 0">parent_id,</if>
|
|
<if test="parentId != null and parentId != 0">parent_id,</if>
|
|
|
<if test="deptName != null and deptName != ''">dept_name,</if>
|
|
<if test="deptName != null and deptName != ''">dept_name,</if>
|
|
|
|
|
+ <if test="deptType != null and deptType != ''">deptType,</if>
|
|
|
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
|
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
|
|
<if test="orderNum != null">order_num,</if>
|
|
<if test="orderNum != null">order_num,</if>
|
|
|
<if test="leader != null and leader != ''">leader,</if>
|
|
<if test="leader != null and leader != ''">leader,</if>
|
|
@@ -103,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
|
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
|
|
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
|
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
|
|
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
|
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
|
|
|
|
+ <if test="deptType != null and deptType != ''">#{deptType},</if>
|
|
|
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
|
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
|
|
<if test="orderNum != null">#{orderNum},</if>
|
|
<if test="orderNum != null">#{orderNum},</if>
|
|
|
<if test="leader != null and leader != ''">#{leader},</if>
|
|
<if test="leader != null and leader != ''">#{leader},</if>
|
|
@@ -119,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<set>
|
|
<set>
|
|
|
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
|
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
|
|
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
|
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
|
|
|
|
+ <if test="deptType != null and deptType != ''">deptType = #{deptType},</if>
|
|
|
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
|
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
|
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
|
|
<if test="leader != null">leader = #{leader},</if>
|
|
<if test="leader != null">leader = #{leader},</if>
|