轉自:http://www.68idc.cn/help/jiabenmake/qita/20140821125261.html
在mybatis的映射xml文件調用java類的方法:
1.
SELECT * FROM EC_CORE_USER WHERE (user_name=#{userName} or mail =#{userName} or mobile_phone = '${@net.ytoec.framework.security.EncryptionDecryption@dSecret(userName)}') and user_password=#{userPassword}
入上面代碼所示。此處應注意,方法必須為靜態方法。
2.獲取類里面的常量:
r.czmc='${@com.ytoxl.module.datahub.kernel.dataobject.EcSystemLog@THE_AUDIT}'
3.判斷是否為null:
<iftest="@org.apache.commons.lang.StringUtils@isNotBlank(province)">andjdo.province=#{province}</if>