LambdaQueryWrapper<MeasureField> lqw = Wrappers.<MeasureField>query().lambda().eq(MeasureField::getName, measure.getName());
Long cnt = baseMapper.selectCount((Func.isEmpty(measure.getId())) ? lqw : lqw.notIn(MeasureField::getId, measure.getId()));
通过以上代码查询 MeasureField, 租户ID没有自动添加。 MeasureField 继承了 TenantEntity, 其他都是默认的
============== Sql Start ==============
Execute SQL : select count(*) as total from measure_field where is_deleted = 0 and (name = 'sssss1')
Execute Time: 6.447ms
============== Sql End ==============
扫一扫访问 Blade技术社区 移动端