mybatis-plus问题解决

mybatis where 中in使用mybatis

AND id IN
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
    #{id}
</foreach>

新增后取得新增idapp

baseMapper.insert(property);
propertyId = property.getId();

MySql实现根据某个条件去重求和code

COUNT(DISTINCT pr.id) 'property_right_number',
LEFT JOIN assets_property_right AS pr ON pr.id = pu.property_right_num_id AND pr.is_deleted=0 AND pu.is_deleted=0

根据条件批量删除get

LambdaUpdateWrapper<Property> deletePropertyWrapper = Wrappers.<Property>lambdaUpdate();
deletePropertyWrapper.in(Property::getOrgId, orgIds).eq(Property::getPropertyType, 1);
int unitRow = baseMapper.delete(deletePropertyWrapper);
相关文章
相关标签/搜索