import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
更新
LambdaUpdateWrapper<ClueInfoBase> updateWrapper = Wrappers.lambdaUpdate();
updateWrapper.set(ClueInfoBase::getSaleId, saleId)
.set(ClueInfoBase::getDeptSalId,deptId)
.in(ClueInfoBase::getId, clueIds);
this.update(updateWrapper);
查询单条
LambdaUpdateWrapper<CompanyBusinessRelation> queryWrapper = Wrappers.lambdaUpdate();
queryWrapper.eq(CompanyBusinessRelation::getBusinessCode, businessCode)
.eq(CompanyBusinessRelation::getClueId, clueId)
.eq(CompanyBusinessRelation::getIsLocking, 1)
.eq(CompanyBusinessRelation::getStatus, 1);
return this.getOne(queryWrapper);
列表
LambdaQueryWrapper<ClueInfoBase> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(ClueInfoBase::getStatus, 1)
.ne(ClueInfoBase::getTraceStatus, traceStatus)
.eq(ClueInfoBase::getSaleId, saleId);
return this.list(queryWrapper);
另一种查询,mapper外写sql
QueryWrapper<ProjectInfoExtend> collectionWrapper = new QueryWrapper<>();
collectionWrapper.select("id","multiple_salary","project_id").
eq("project_id", projectId);
return projectInfoExtendMapper.selectOne(collectionWrapper);