Browse Source

修改部门接口代码

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
e16b4ffca4
3 changed files with 16 additions and 10 deletions
  1. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/update/UpdateDeptService.java
  2. +7
    -4
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/RoadDeptMapper.xml
  3. +7
    -4
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/SectionDeptMapper.xml

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/update/UpdateDeptService.java View File

@@ -93,11 +93,11 @@ public class UpdateDeptService {
return JsonResult.error(EditDeptCodeEnum.DEPT_NAME_IS_NOT_NULL.getCode(), EditDeptCodeEnum.DEPT_NAME_IS_NOT_NULL.getMsg());
}

if (oldEditDeptRequest.getId().equals(newEditDeptRequest.getId())) {
if (!oldEditDeptRequest.getId().equals(newEditDeptRequest.getId())) {
return JsonResult.error(EditDeptCodeEnum.DEPT_ID_IS_NOT_SAME.getCode(), EditDeptCodeEnum.DEPT_ID_IS_NOT_SAME.getMsg());
}

if (oldEditDeptRequest.getPid().equals(newEditDeptRequest.getPid())) {
if (!oldEditDeptRequest.getPid().equals(newEditDeptRequest.getPid())) {
return JsonResult.error(EditDeptCodeEnum.DEPT_PID_IS_NOT_SAME.getCode(), EditDeptCodeEnum.DEPT_PID_IS_NOT_SAME.getMsg());
}


+ 7
- 4
tuoheng-service/tuoheng-admin/src/main/resources/mapper/RoadDeptMapper.xml View File

@@ -27,10 +27,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 批量删除数据 -->
<delete id="deleteBatchByMap" parameterType="hashmap">
delete from th_road_dept
where tenant_id = #{tenantId} and dept_id = #{deptId} and road_id in
<foreach collection="roadIdList" item="roadId" separator="," open="(" close=")">
#{roadId}
</foreach>
where tenant_id = #{tenantId} and dept_id = #{deptId}
<if test="roadIdList != null and roadIdList.size() >0 ">
and road_id in
<foreach collection="roadIdList" item="roadId" separator="," open="(" close=")">
#{roadId}
</foreach>
</if>
</delete>
</mapper>

+ 7
- 4
tuoheng-service/tuoheng-admin/src/main/resources/mapper/SectionDeptMapper.xml View File

@@ -26,10 +26,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 批量删除数据 -->
<delete id="deleteBatchByMap" parameterType="hashmap">
delete from th_section_dept
where tenant_id = #{tenantId} and dept_id = #{deptId} and section_id in
<foreach collection="sectionIdList" item="sectionId" separator="," open="(" close=")">
#{sectionId}
</foreach>
where tenant_id = #{tenantId} and dept_id = #{deptId}
<if test="sectionIdList != null and sectionIdList.size() >0 ">
and section_id in
<foreach collection="sectionIdList" item="sectionId" separator="," open="(" close=")">
#{sectionId}
</foreach>
</if>
</delete>
</mapper>

Loading…
Cancel
Save