1、注解字段:
@Column(name = "phone", length = 100)
@ColumnTransformer(read = "AES_DECRYPT(UNHEX(phone), 'aes_phone')", write = "HEX(AES_ENCRYPT(?, 'aes_phone'))")
private String phone;
2、原生SQL 查询加密数据:
SELECT AES_DECRYPT(UNHEX(s.phone),'aes_phone') FROM TABLSE s
原创文章,作者:carmelaweatherly,如若转载,请注明出处:https://blog.ytso.com/187044.html