18
11/22
Expected one result (or null) to be returned by selectOne(), but found: 2
mybatis-plus中getOne方法只能取一条数据,如果取得多条数据会报错,要么换其他方法,要么只选择其中一条,在条件构造器Wrapper结尾加上.last(“limit 1”)即可只选一条(第一条) //根据时间获取gift private Gift generateGift(String openid) { LambdaQueryWrapper<Gift> query = new LambdaQueryWrapper<>(); query.eq(Gift::getUsed, 0); query.le(Gift::getWintime, TimeUtil.getNowTimeDate()); query.last("limit 1"); boolean fl...