项目管理接口相关逻辑补充,部门添加型行政区划树状层级业务等
This commit is contained in:
@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</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, d.dept_type, d.dept_user_id,
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.dept_type, d.dept_user_id,d.administrative_area_code,
|
||||
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
|
||||
from sys_dept d
|
||||
where d.dept_id = #{deptId}
|
||||
@ -121,54 +121,137 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="SysDept" useGeneratedKeys="true" keyProperty="deptId">
|
||||
insert into sys_dept(
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="deptUserId != null and deptUserId != 0">dept_user_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="deptType != null and deptType != ''">dept_type,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||
<if test="deptUserId != null and deptUserId != 0">#{deptUserId},</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="deptType != null and deptType != ''">#{deptType},</if>
|
||||
sysdate()
|
||||
)
|
||||
<!-- <insert id="insertDept" parameterType="SysDept" useGeneratedKeys="true" keyProperty="deptId">-->
|
||||
<!-- insert into sys_dept(-->
|
||||
<!-- <if test="deptId != null and deptId != 0">dept_id,</if>-->
|
||||
<!-- <if test="deptUserId != null and deptUserId != 0">dept_user_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="deptType != null and deptType != ''">dept_type,</if>-->
|
||||
<!-- create_time-->
|
||||
<!-- )values(-->
|
||||
<!-- <if test="deptId != null and deptId != 0">#{deptId},</if>-->
|
||||
<!-- <if test="deptUserId != null and deptUserId != 0">#{deptUserId},</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="deptType != null and deptType != ''">#{deptType},</if>-->
|
||||
<!-- sysdate()-->
|
||||
<!-- )-->
|
||||
<!-- </insert>-->
|
||||
<insert id="insertDept" parameterType="SysDept" useGeneratedKeys="true" keyProperty="deptId">
|
||||
insert into sys_dept
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deptUserId != null">dept_user_id,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="leader != null and leader != ''">leader,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="email != null">email,</if>
|
||||
<if test="deptType != null">dept_type,</if>
|
||||
<if test="administrativeArea != null">administrative_area,</if>
|
||||
<if test="administrativeAreaCode != null">administrative_area_code,</if>
|
||||
<if test="provinceCode != null">province_code,</if>
|
||||
<if test="cityCode != null">city_code,</if>
|
||||
<if test="countyCode != null">county_code,</if>
|
||||
<if test="townCode != null">town_code,</if>
|
||||
<if test="villageCode != null">village_code,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deptUserId != null">#{deptUserId},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="leader != null and leader != ''">#{leader},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="email != null">#{email},</if>
|
||||
<if test="deptType != null">#{deptType},</if>
|
||||
<if test="administrativeArea != null">#{administrativeArea},</if>
|
||||
<if test="administrativeAreaCode != null">#{administrativeAreaCode},</if>
|
||||
<if test="provinceCode != null">#{provinceCode},</if>
|
||||
<if test="cityCode != null">#{cityCode},</if>
|
||||
<if test="countyCode != null">#{countyCode},</if>
|
||||
<if test="townCode != null">#{townCode},</if>
|
||||
<if test="villageCode != null">#{villageCode},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- <update id="updateDept" parameterType="SysDept">-->
|
||||
<!-- update sys_dept-->
|
||||
<!-- <set>-->
|
||||
<!-- <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>-->
|
||||
<!-- <if test="deptUserId != null and deptUserId != 0">dept_user_id = #{deptUserId},</if>-->
|
||||
<!-- <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>-->
|
||||
<!-- <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>-->
|
||||
<!-- <if test="orderNum != null">order_num = #{orderNum},</if>-->
|
||||
<!-- <if test="leader != null">leader = #{leader},</if>-->
|
||||
<!-- <if test="phone != null">phone = #{phone},</if>-->
|
||||
<!-- <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()-->
|
||||
<!-- </set>-->
|
||||
<!-- where dept_id = #{deptId}-->
|
||||
<!-- </update>-->
|
||||
|
||||
<update id="updateDept" parameterType="SysDept">
|
||||
update sys_dept
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
<if test="deptUserId != null and deptUserId != 0">dept_user_id = #{deptUserId},</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="leader != null">leader = #{leader},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<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()
|
||||
</set>
|
||||
where dept_id = #{deptId}
|
||||
update sys_dept
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deptUserId != null">dept_user_id = #{deptUserId},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="leader != null and leader != ''">leader = #{leader},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="email != null">email = #{email},</if>
|
||||
<if test="deptType != null">dept_type = #{deptType},</if>
|
||||
<if test="administrativeArea != null">administrative_area = #{administrativeArea},</if>
|
||||
<if test="administrativeAreaCode != null">administrative_area_code = #{administrativeAreaCode},</if>
|
||||
<if test="provinceCode != null">province_code = #{provinceCode},</if>
|
||||
<if test="cityCode != null">city_code = #{cityCode},</if>
|
||||
<if test="countyCode != null">county_code = #{countyCode},</if>
|
||||
<if test="townCode != null">town_code = #{townCode},</if>
|
||||
<if test="villageCode != null">village_code = #{villageCode},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
</trim>
|
||||
where dept_id = #{deptId}
|
||||
</update>
|
||||
|
||||
<update id="updateDeptChildren" parameterType="java.util.List">
|
||||
|
Reference in New Issue
Block a user