sharding-jdbc与mybatis的分页查询条数不兼容?

使用环境:

sharding-jdbc5.0 + mybatis Plus3.4 + spring boot

spring.shardingsphere.encrypt.tables.person.columns.credentials_number.plainColumn=credentials_number
spring.shardingsphere.encrypt.tables.person.columns.credentials_number.cipherColumn=credentials_number_ency
spring.shardingsphere.encrypt.tables.person.columns.credentials_number.encryptor=custom_encryptor_aes
spring.shardingsphere.props.query.with.cipher.column=true

场景、问题:

在使用sharding对数据库证件号字段加密之后, 根据证件号查询,计算count时并没有将sql逻辑列转为密文列。

而查询单条记录时,会将逻辑列sql转为密文列。

结论

在使用mybatis的分页查询时,对加密字段不兼容

5.0.0 还不支持子查询中的加密列改写,请尝试下最新的 5.1.1。

1 个赞

好的,感谢大佬,我这边升级试下

客气,有问题欢迎反馈。

已升级到5.1.1,问题已解决。:+1:

京ICP备2021015875号