S2Dao的一些技巧

 在SQL里写条件判断

@Sql("SELECT mobile_user.mobile_user_id from mobile_user " +
"INNER JOIN mobile_device_user ON mobile_user.mobile_user_id = mobile_device_user.mobile_user_id " +
"/BEGIN/" +
" WHERE /IF userName != null/mobile_user.user_name LIKE /userName/'%name%'/END/" +
"/END/" +
"ORDER BY mobile_user.mobile_user_id asc;")

重点是BEGIN和END的部分。

原文地址:https://www.cnblogs.com/likwo/p/1932552.html