【org】更新职务改为updateById的方式

pull/3/head
fengshuonan 2021-01-04 22:12:58 +08:00
parent cd877d3102
commit cb4a3126fb
1 changed files with 2 additions and 5 deletions

View File

@ -16,7 +16,6 @@ import cn.stylefeng.roses.kernel.system.modular.organization.mapper.HrPositionMa
import cn.stylefeng.roses.kernel.system.modular.organization.service.HrPositionService;
import cn.stylefeng.roses.kernel.system.pojo.organization.HrPositionRequest;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@ -86,11 +85,9 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
// 先查询有没有这条记录,再更新
HrPosition sysPosition = this.querySysPosition(hrPositionRequest);
LambdaUpdateWrapper<HrPosition> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(HrPosition::getPositionId, sysPosition.getPositionId());
updateWrapper.set(HrPosition::getStatusFlag, hrPositionRequest.getStatusFlag());
sysPosition.setStatusFlag(hrPositionRequest.getStatusFlag());
this.update(updateWrapper);
this.updateById(sysPosition);
}
@Override