部门删除

This commit is contained in:
luolm 2025-02-15 19:06:06 +08:00
parent 12ccd21279
commit bc58622536
5 changed files with 10 additions and 10 deletions

View File

@ -56,7 +56,7 @@ public class DepartmentController extends ControllerBase {
*/
@GetMapping("getChild")
@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));
}
@ -99,7 +99,7 @@ public class DepartmentController extends ControllerBase {
@PostMapping("del")
@MethodInfoMark(value = "删除",menuName = "部门管理")
@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("请选择要删除的数据");
departmentService.del(ids);
return ApiResult.success(true);

View File

@ -20,5 +20,5 @@ public interface TBaseDepartmentMapper extends BaseMapper<TBaseDepartment> {
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);
}

View File

@ -25,9 +25,9 @@ public interface ITBaseDepartmentService extends IService<TBaseDepartment> {
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();
}

View File

@ -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);
}
public List<TBaseDepartment> getChildByParentId(Integer id) {
public List<TBaseDepartment> getChildByParentId(Long id) {
return this.lambdaQuery().eq(TBaseDepartment::getDeptParentId, id).list();
}

View File

@ -20,10 +20,10 @@
<include refid="whr"/>
</select>
<update id="del">
update t_base_department set data_valid_status=0 where id in
<delete id="del">
delete from t_base_department where id in
<foreach collection="ids" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
</delete>
</mapper>