use of com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper in project jeecg-boot by jeecgboot.
the class SysBaseApiImpl method updateSysAnnounReadFlag.
@Override
public void updateSysAnnounReadFlag(String busType, String busId) {
SysAnnouncement announcement = sysAnnouncementMapper.selectOne(new QueryWrapper<SysAnnouncement>().eq("bus_type", busType).eq("bus_id", busId));
if (announcement != null) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String userId = sysUser.getId();
LambdaUpdateWrapper<SysAnnouncementSend> updateWrapper = new UpdateWrapper().lambda();
updateWrapper.set(SysAnnouncementSend::getReadFlag, CommonConstant.HAS_READ_FLAG);
updateWrapper.set(SysAnnouncementSend::getReadTime, new Date());
updateWrapper.last("where annt_id ='" + announcement.getId() + "' and user_id ='" + userId + "'");
SysAnnouncementSend announcementSend = new SysAnnouncementSend();
sysAnnouncementSendMapper.update(announcementSend, updateWrapper);
}
}
use of com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper in project RuoYi-Flowable-Plus by KonBAI-Q.
the class SysOssConfigServiceImpl method updateByBo.
@Override
public Boolean updateByBo(SysOssConfigBo bo) {
SysOssConfig config = BeanUtil.toBean(bo, SysOssConfig.class);
validEntityBeforeSave(config);
LambdaUpdateWrapper<SysOssConfig> luw = new LambdaUpdateWrapper<>();
luw.set(StringUtils.isBlank(config.getPrefix()), SysOssConfig::getPrefix, "");
luw.set(StringUtils.isBlank(config.getRegion()), SysOssConfig::getRegion, "");
luw.set(StringUtils.isBlank(config.getExt1()), SysOssConfig::getExt1, "");
luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId());
return setConfigCache(baseMapper.update(config, luw) > 0, config);
}
use of com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper in project RuoYi-Flowable-Plus by KonBAI-Q.
the class SysOssConfigServiceImpl method updateOssConfigStatus.
/**
* 启用禁用状态
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int updateOssConfigStatus(SysOssConfigBo bo) {
SysOssConfig sysOssConfig = BeanUtil.toBean(bo, SysOssConfig.class);
int row = baseMapper.update(null, new LambdaUpdateWrapper<SysOssConfig>().set(SysOssConfig::getStatus, "1"));
row += baseMapper.updateById(sysOssConfig);
if (row > 0) {
RedisUtils.setCacheObject(OssConstant.CACHE_CONFIG_KEY, sysOssConfig.getConfigKey());
}
return row;
}
use of com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper in project demo-SpringBoot by Max-Qiu.
the class TestUserMapper method update.
/**
* 条件更新
*/
@Test
void update() {
// UPDATE smp_user SET email=? WHERE (username = ?)
// 构造WHERE条件
LambdaUpdateWrapper<User> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(User::getUsername, "xxxxxx");
// 构造 SET 值
User user = new User().setEmail("123@126.com");
int i = userMapper.update(user, wrapper);
System.out.println("影响记录数:" + i);
}
use of com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper in project demo-SpringBoot by Max-Qiu.
the class TestUser method update1.
@Test
void update1() {
// UPDATE smp_user SET email=? WHERE (username = ?)
// 构造WHERE条件
LambdaUpdateWrapper<User> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(User::getUsername, "xxxxxx");
// 构造 SET 值
User user = new User();
user.setEmail("123@126.com");
boolean i = user.update(wrapper);
System.out.println("更新结果:" + i);
}
Aggregations