File tree Expand file tree Collapse file tree 2 files changed +30
-7
lines changed
src/main/java/org/apache/ibatis/annotations Expand file tree Collapse file tree 2 files changed +30
-7
lines changed Original file line number Diff line number Diff line change 106106 <name >Tomáš Neuberg</name >
107107 <email >neuberg@m-atelier.cz</email >
108108 </contributor >
109+ <contributor >
110+ <name >DevDengChao</name >
111+ <email >devdengchao@qq.com</email >
112+ </contributor >
109113 </contributors >
110114
111115 <scm >
Original file line number Diff line number Diff line change 2626 * The annotation that specify an SQL for retrieving record(s).
2727 * <p>
2828 * <b>How to use:</b>
29- *
30- * <pre>
31- * public interface UserMapper {
32- * @Select("SELECT id, name FROM users WHERE id = #{id}")
33- * User selectById(int id);
34- * }
35- * </pre>
29+ * <br/>
30+ * <ul>
31+ * <li>
32+ * Simple:
33+ * <pre>
34+ * public interface UserMapper {
35+ * @Select("SELECT id, name FROM users WHERE id = #{id}")
36+ * User selectById(int id);
37+ * }
38+ * </pre>
39+ * </li>
40+ * <li>
41+ * Dynamic SQL:
42+ * <pre>
43+ * public interface UserMapper {
44+ * @Select({"<script>",
45+ * "select * from users",
46+ * "where name = #{name}",
47+ * "<if test="age != null"> age = #{age} </if>",
48+ * "</script>"})
49+ * User select(@NotNull String name, @Nullable Intger age);
50+ * }
51+ * </pre>
52+ * </li>
53+ * </ul>
3654 *
3755 * @author Clinton Begin
56+ * @see <a href="https://mybatis.org/mybatis-3/dynamic-sql.html">How to use Dynamic SQL</a>
3857 */
3958@ Documented
4059@ Retention (RetentionPolicy .RUNTIME )
You can’t perform that action at this time.
0 commit comments