feat 新建LambdaQueryWrapperX,改成使用lambda的方式选择字段

This commit is contained in:
zefeng.zeng
2022-01-21 14:32:52 +08:00
parent 70fe3d31bd
commit 43ae3c8124
16 changed files with 295 additions and 125 deletions

View File

@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Mapper;
public interface InfFileCoreMapper extends BaseMapperX<InfFileDO> {
default Integer selectCountById(String id) {
return selectCount("id", id);
return selectCount(InfFileDO::getId, id);
}
/**

View File

@ -11,7 +11,7 @@ import java.util.Date;
public interface PayChannelCoreMapper extends BaseMapperX<PayChannelDO> {
default PayChannelDO selectByAppIdAndCode(Long appId, String code) {
return selectOne("app_id", appId, "code", code);
return selectOne(PayChannelDO::getAppId, appId, PayChannelDO::getCode, code);
}
@Select("SELECT id FROM pay_channel WHERE update_time > #{maxUpdateTime} LIMIT 1")

View File

@ -2,19 +2,19 @@ package cn.iocoder.yudao.coreservice.modules.pay.dal.mysql.order;
import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.order.PayOrderExtensionDO;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PayOrderExtensionCoreMapper extends BaseMapperX<PayOrderExtensionDO> {
default PayOrderExtensionDO selectByNo(String no) {
return selectOne("no", no);
return selectOne(PayOrderExtensionDO::getNo, no);
}
default int updateByIdAndStatus(Long id, Integer status, PayOrderExtensionDO update) {
return update(update, new QueryWrapper<PayOrderExtensionDO>()
.eq("id", id).eq("status", status));
return update(update, new LambdaQueryWrapper<PayOrderExtensionDO>()
.eq(PayOrderExtensionDO::getId, id).eq(PayOrderExtensionDO::getStatus, status));
}
}