!547 有几个会报错的地方

Merge pull request !547 from wcz/master
This commit is contained in:
芋道源码 2023-07-28 11:37:13 +00:00 committed by Gitee
commit 48f5d3f0e2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 11 additions and 5 deletions

View File

@ -103,8 +103,15 @@ public interface BaseMapperX<T> extends BaseMapper<T> {
update(update, new QueryWrapper<>());
}
default void updateBatch(Collection<T> entities) {
Db.updateBatchById(entities);
}
default void updateBatch(Collection<T> entities, int size) {
Db.updateBatchById(entities, size);
}
default void saveOrUpdateBatch(Collection<T> collection) {
Db.saveOrUpdateBatch(collection);
}
}

View File

@ -19,10 +19,10 @@ public interface TradeCartMapper extends BaseMapperX<TradeCartDO> {
default TradeCartDO selectByUserIdAndSkuId(Long userId, Long skuId,
Boolean addStatus, Boolean orderStatus) {
return selectOne(TradeCartDO::getUserId, userId,
TradeCartDO::getSkuId, skuId,
TradeCartDO::getAddStatus, addStatus,
TradeCartDO::getOrderStatus, orderStatus);
return selectOne(new LambdaQueryWrapper<TradeCartDO>().eq(TradeCartDO::getUserId, userId)
.eq(TradeCartDO::getSkuId, skuId)
.eq(TradeCartDO::getAddStatus, addStatus)
.eq(TradeCartDO::getOrderStatus, orderStatus));
}
default Integer selectSumByUserId(Long userId) {