Search in sources :

Example 46 with LambdaUpdateWrapper

use of com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper in project RuoYi-Cloud-Plus by JavaLionLi.

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;
}
Also used : LambdaUpdateWrapper(com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper) SysOssConfig(com.ruoyi.resource.domain.SysOssConfig) Transactional(org.springframework.transaction.annotation.Transactional)

Example 47 with LambdaUpdateWrapper

use of com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper in project kykms by mahonelau.

the class SysAnnouncementSendController method editById.

/**
 * @功能:更新用户系统消息阅读状态
 * @param json
 * @return
 */
@PutMapping(value = "/editByAnntIdAndUserId")
public Result<SysAnnouncementSend> editById(@RequestBody JSONObject json) {
    Result<SysAnnouncementSend> result = new Result<SysAnnouncementSend>();
    String anntId = json.getString("anntId");
    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 ='" + anntId + "' and user_id ='" + userId + "'");
    SysAnnouncementSend announcementSend = new SysAnnouncementSend();
    sysAnnouncementSendService.update(announcementSend, updateWrapper);
    result.setSuccess(true);
    return result;
}
Also used : SysAnnouncementSend(org.jeecg.modules.system.entity.SysAnnouncementSend) UpdateWrapper(com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper) LambdaUpdateWrapper(com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper) LoginUser(org.jeecg.common.system.vo.LoginUser) Date(java.util.Date) Result(org.jeecg.common.api.vo.Result) PutMapping(org.springframework.web.bind.annotation.PutMapping)

Aggregations

LambdaUpdateWrapper (com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper)47 Transactional (org.springframework.transaction.annotation.Transactional)11 UpdateWrapper (com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper)10 Date (java.util.Date)7 Result (org.jeecg.common.api.vo.Result)6 LoginUser (org.jeecg.common.system.vo.LoginUser)6 SysAnnouncementSend (org.jeecg.modules.system.entity.SysAnnouncementSend)6 Test (org.junit.jupiter.api.Test)6 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)6 PutMapping (org.springframework.web.bind.annotation.PutMapping)6 OrderItem (cn.lili.modules.order.order.entity.dos.OrderItem)5 LambdaQueryWrapper (com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper)5 User (com.maxqiu.demo.entity.User)5 DateTime (cn.hutool.core.date.DateTime)4 UserFile (com.qiwenshare.file.domain.UserFile)4 ServiceException (cn.lili.common.exception.ServiceException)3 Order (cn.lili.modules.order.order.entity.dos.Order)3 SysOssConfig (com.ruoyi.system.domain.SysOssConfig)3 DistributionOrder (cn.lili.modules.distribution.entity.dos.DistributionOrder)2 GoodsSku (cn.lili.modules.goods.entity.dos.GoodsSku)2