|
|
|
@ -20,10 +20,12 @@ 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="deptType" column="dept_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.dept_type
|
|
|
|
|
from sys_dept d
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
@ -42,6 +44,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="status != null and status != ''">
|
|
|
|
|
AND status = #{status}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deptType != null and deptType != ''">
|
|
|
|
|
AND (dept_Type = #{deptType} or dept_Type ='0')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deptIds != null and deptIds != ''">
|
|
|
|
|
and dept_id in ( ${deptIds} )
|
|
|
|
|
</if>
|
|
|
|
@ -82,7 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
order by d.order_num
|
|
|
|
|
</select>
|
|
|
|
|
<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.order_num, d.leader, d.phone, d.email,d.dept_type, d.status,
|
|
|
|
|
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
|
|
|
|
|
from sys_dept d
|
|
|
|
|
where d.dept_id = #{deptId}
|
|
|
|
@ -122,6 +127,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 != ''">create_by,</if>
|
|
|
|
|
<if test="deptType != null and deptType != ''">dept_Type,</if>
|
|
|
|
|
create_time
|
|
|
|
|
)values(
|
|
|
|
|
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
|
|
|
@ -134,6 +140,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>
|
|
|
|
|
<if test="deptType != null and deptType != ''">#{deptType},</if>
|
|
|
|
|
sysdate()
|
|
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
@ -150,6 +157,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>
|
|
|
|
|
<if test="deptType != null and deptType != ''">dept_Type = #{deptType},</if>
|
|
|
|
|
update_time = sysdate()
|
|
|
|
|
</set>
|
|
|
|
|
where dept_id = #{deptId}
|
|
|
|
|