<sql id="getKey">
'${@com.xx.xxx.xx.xx.utils.AesUtil@getKey()}'
</sql>
<sql id="Base_Column_List">
id, name, parent_id, company_id, CONVERT(AES_DECRYPT(FROM_BASE64(phone),<include refid="getKey"/>) USING UTF8) as phone, description, delete_flag, create_by, create_time,
modified_by, modified_time
</sql>
TO_BASE64(AES_ENCRYPT(#{phone,jdbcType=VARCHAR},<include refid="getKey"/>)),
@Component
@ConfigurationProperties(prefix = "aes")
public class AesUtil {
private String key;
private static String aesKey = "";
public static String getKey() {
return aesKey;
}
public void setKey(String key) {
this.aesKey = key;
}
public static String getAesKey() {
return aesKey;
}
public static void setAesKey(String aesKey) {
AesUtil.aesKey = aesKey;
}
}