|
|
|
@ -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="organCode" column="organ_code"/> |
|
|
|
|
</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.organ_code |
|
|
|
|
from sys_dept d |
|
|
|
|
</sql> |
|
|
|
|
|
|
|
|
@ -42,6 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
|
<if test="status != null and status != ''"> |
|
|
|
|
AND status = #{status} |
|
|
|
|
</if> |
|
|
|
|
<if test="organCode !=null and organCode !=''"> |
|
|
|
|
AND organ_code =#{organCode} |
|
|
|
|
</if> |
|
|
|
|
<!-- 数据范围过滤 --> |
|
|
|
|
${params.dataScope} |
|
|
|
|
order by d.parent_id, d.order_num |
|
|
|
@ -99,6 +103,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="organCode !=null and organCode !=''">organ_code,</if> |
|
|
|
|
create_time |
|
|
|
|
)values( |
|
|
|
|
<if test="deptId != null and deptId != 0">#{deptId},</if> |
|
|
|
@ -111,10 +116,43 @@ 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="organCode !=null and organCode !=''">#{organCode},</if> |
|
|
|
|
sysdate() |
|
|
|
|
) |
|
|
|
|
</insert> |
|
|
|
|
|
|
|
|
|
<insert id="insertDeptResultId" parameterType="SysDept"> |
|
|
|
|
<selectKey keyProperty="deptId" order="AFTER" resultType="Long"> |
|
|
|
|
SELECT LAST_INSERT_ID() |
|
|
|
|
</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> |
|
|
|
|
<if test="deptName != null and deptName != ''">dept_name,</if> |
|
|
|
|
<if test="ancestors != null and ancestors != ''">ancestors,</if> |
|
|
|
|
<if test="orderNum != null">order_num,</if> |
|
|
|
|
<if test="leader != null and leader != ''">leader,</if> |
|
|
|
|
<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="organCode !=null and organCode !=''">organ_code,</if> |
|
|
|
|
create_time |
|
|
|
|
)values( |
|
|
|
|
<if test="deptId != null and deptId != 0">#{deptId},</if> |
|
|
|
|
<if test="parentId != null and parentId != 0">#{parentId},</if> |
|
|
|
|
<if test="deptName != null and deptName != ''">#{deptName},</if> |
|
|
|
|
<if test="ancestors != null and ancestors != ''">#{ancestors},</if> |
|
|
|
|
<if test="orderNum != null">#{orderNum},</if> |
|
|
|
|
<if test="leader != null and leader != ''">#{leader},</if> |
|
|
|
|
<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="organCode !=null and organCode !=''">#{organCode},</if> |
|
|
|
|
sysdate() |
|
|
|
|
) |
|
|
|
|
</insert> |
|
|
|
|
|
|
|
|
|
<update id="updateDept" parameterType="SysDept"> |
|
|
|
|
update sys_dept |
|
|
|
|
<set> |
|
|
|
@ -127,6 +165,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="organCode !=null and organCode !=''">organ_code = #{organCode},</if> |
|
|
|
|
update_time = sysdate() |
|
|
|
|
</set> |
|
|
|
|
where dept_id = #{deptId} |
|
|
|
|