部门删除
This commit is contained in:
parent
12ccd21279
commit
bc58622536
|
|
@ -56,7 +56,7 @@ public class DepartmentController extends ControllerBase {
|
||||||
*/
|
*/
|
||||||
@GetMapping("getChild")
|
@GetMapping("getChild")
|
||||||
@ApiMark(moduleName = "部门管理", apiName = "获取子级")
|
@ApiMark(moduleName = "部门管理", apiName = "获取子级")
|
||||||
public ApiResult<List<TBaseDepartment>> getChild(@RequestParam("parentId") Integer parentId ){
|
public ApiResult<List<TBaseDepartment>> getChild(@RequestParam("parentId") Long parentId ){
|
||||||
|
|
||||||
return ApiResult.success(departmentService.getChildByParentId(parentId));
|
return ApiResult.success(departmentService.getChildByParentId(parentId));
|
||||||
}
|
}
|
||||||
|
|
@ -99,7 +99,7 @@ public class DepartmentController extends ControllerBase {
|
||||||
@PostMapping("del")
|
@PostMapping("del")
|
||||||
@MethodInfoMark(value = "删除",menuName = "部门管理")
|
@MethodInfoMark(value = "删除",menuName = "部门管理")
|
||||||
@ApiMark(moduleName = "部门管理", apiName = "删除")
|
@ApiMark(moduleName = "部门管理", apiName = "删除")
|
||||||
public ApiResult<Boolean> add(@RequestBody List<Integer> ids ){
|
public ApiResult<Boolean> add(@RequestBody List<Long> ids ){
|
||||||
VUtils.trueThrowBusinessError(CollUtil.isEmpty(ids)).throwMessage("请选择要删除的数据");
|
VUtils.trueThrowBusinessError(CollUtil.isEmpty(ids)).throwMessage("请选择要删除的数据");
|
||||||
departmentService.del(ids);
|
departmentService.del(ids);
|
||||||
return ApiResult.success(true);
|
return ApiResult.success(true);
|
||||||
|
|
|
||||||
|
|
@ -20,5 +20,5 @@ public interface TBaseDepartmentMapper extends BaseMapper<TBaseDepartment> {
|
||||||
|
|
||||||
Page<TBaseDepartment> selectListByPage(@Param("page") Page<PageBaseQuery> page,@Param("query") PageBaseQuery query );
|
Page<TBaseDepartment> selectListByPage(@Param("page") Page<PageBaseQuery> page,@Param("query") PageBaseQuery query );
|
||||||
|
|
||||||
void del(@Param("ids") List<Integer> ids);
|
void del(@Param("ids") List<Long> ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,9 @@ public interface ITBaseDepartmentService extends IService<TBaseDepartment> {
|
||||||
Boolean saveDepartment(TBaseDepartment department);
|
Boolean saveDepartment(TBaseDepartment department);
|
||||||
|
|
||||||
|
|
||||||
void del(List<Integer> ids);
|
void del(List<Long> ids);
|
||||||
|
|
||||||
List<TBaseDepartment> getChildByParentId(Integer id);
|
List<TBaseDepartment> getChildByParentId(Long id);
|
||||||
|
|
||||||
List<DepartmentSimpleVO> getSimpleDepartments();
|
List<DepartmentSimpleVO> getSimpleDepartments();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,11 @@ public class TBaseDepartmentServiceImpl extends ServiceImpl<TBaseDepartmentMappe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void del(List<Integer> ids) {
|
public void del(List<Long> ids) {
|
||||||
this.getBaseMapper().del(ids);
|
this.getBaseMapper().del(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TBaseDepartment> getChildByParentId(Integer id) {
|
public List<TBaseDepartment> getChildByParentId(Long id) {
|
||||||
return this.lambdaQuery().eq(TBaseDepartment::getDeptParentId, id).list();
|
return this.lambdaQuery().eq(TBaseDepartment::getDeptParentId, id).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,10 @@
|
||||||
<include refid="whr"/>
|
<include refid="whr"/>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="del">
|
<delete id="del">
|
||||||
update t_base_department set data_valid_status=0 where id in
|
delete from t_base_department where id in
|
||||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue