Search in sources :

Example 71 with QueryWrapper

use of com.baomidou.mybatisplus.core.conditions.query.QueryWrapper in project seckill by yt-King.

the class TOverdueRecordServiceImpl method detail.

public TOverdueRecord detail(String dataId) {
    QueryWrapper<TOverdueRecord> queryWrapper = new QueryWrapper<>();
    queryWrapper.eq("data_id", dataId);
    TOverdueRecord tOverdueRecord = tOverdueRecordMapper.selectOne(queryWrapper);
    if (null == tOverdueRecord)
        throw new RuntimeException("记录不存在");
    return tOverdueRecord;
}
Also used : QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) TOverdueRecord(com.yt.seckill.entity.TOverdueRecord)

Example 72 with QueryWrapper

use of com.baomidou.mybatisplus.core.conditions.query.QueryWrapper in project springboot-learning by lyb-geek.

the class BookServiceImpl method getBookByName.

@Override
@RedisCache(type = CacheOperateType.QUERY, expireTime = 180)
public BookDTO getBookByName(String bookName) {
    log.info("getBookByName走db");
    Wrapper<Book> wrapper = new QueryWrapper<>();
    ((QueryWrapper<Book>) wrapper).eq("book_name", bookName);
    Book book = bookMapper.selectOne(wrapper);
    if (ObjectUtils.isNotEmpty(book)) {
        return dozerMapper.map(book, BookDTO.class);
    }
    return null;
}
Also used : QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) Book(com.github.lybgeek.redis.model.Book) RedisCache(com.github.lybgeek.redis.annotation.RedisCache)

Example 73 with QueryWrapper

use of com.baomidou.mybatisplus.core.conditions.query.QueryWrapper in project forum by saysky.

the class TagServiceImpl method findTagByTagName.

@Override
public Tag findTagByTagName(String tagName) {
    QueryWrapper queryWrapper = new QueryWrapper();
    queryWrapper.eq("tag_name", tagName);
    return tagMapper.selectOne(queryWrapper);
}
Also used : QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper)

Example 74 with QueryWrapper

use of com.baomidou.mybatisplus.core.conditions.query.QueryWrapper in project forum by saysky.

the class UserServiceImpl method findByEmail.

@Override
public User findByEmail(String userEmail) {
    QueryWrapper queryWrapper = new QueryWrapper();
    queryWrapper.eq("user_email", userEmail);
    return userMapper.selectOne(queryWrapper);
}
Also used : QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper)

Example 75 with QueryWrapper

use of com.baomidou.mybatisplus.core.conditions.query.QueryWrapper in project forum by saysky.

the class UserServiceImpl method findByUserName.

@Override
public User findByUserName(String userName) {
    QueryWrapper queryWrapper = new QueryWrapper();
    queryWrapper.eq("user_name", userName);
    return userMapper.selectOne(queryWrapper);
}
Also used : QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper)

Aggregations

QueryWrapper (com.baomidou.mybatisplus.core.conditions.query.QueryWrapper)723 Transactional (org.springframework.transaction.annotation.Transactional)98 IPage (com.baomidou.mybatisplus.core.metadata.IPage)82 UserRolesVo (top.hcode.hoj.pojo.vo.UserRolesVo)74 LambdaQueryWrapper (com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper)72 Page (com.baomidou.mybatisplus.extension.plugins.pagination.Page)65 ArrayList (java.util.ArrayList)61 Session (org.apache.shiro.session.Session)61 StatusFailException (top.hcode.hoj.common.exception.StatusFailException)60 StatusForbiddenException (top.hcode.hoj.common.exception.StatusForbiddenException)55 Problem (top.hcode.hoj.pojo.entity.problem.Problem)50 UpdateWrapper (com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper)45 Date (java.util.Date)44 HttpServletRequest (javax.servlet.http.HttpServletRequest)35 HashMap (java.util.HashMap)34 RequiresAuthentication (org.apache.shiro.authz.annotation.RequiresAuthentication)34 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)34 ApiOperation (io.swagger.annotations.ApiOperation)32 HttpSession (javax.servlet.http.HttpSession)31 Judge (top.hcode.hoj.pojo.entity.judge.Judge)30