Skip to content

Commit

Permalink
Merge pull request #2069 from zxyle/master
Browse files Browse the repository at this point in the history
Modify 2 Chinese words translations in dynamic-sql.xml
  • Loading branch information
harawata committed Sep 24, 2020
2 parents c47afd6 + 4e33224 commit 3609b85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/site/zh/xdoc/dynamic-sql.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</subsection>
<subsection name="choose、when、otherwise" id="chooseWhenOtherwise">
<p>有时候,我们不想使用所有的条件,而只是想从多个条件中选择一个使用。针对这种情况,MyBatis 提供了 choose 元素,它有点像 Java 中的 switch 语句。</p>
<p>还是上面的例子,但是策略变为:传入了 “title” 就按 “title” 查找,传入了 “author” 就按 “author” 查找的情形。若两者都没有传入,就返回标记为 featured 的 BLOG(这可能是管理员认为,与其返回大量的无意义随机 Blog,还不如返回一些由管理员挑选的 Blog)。</p>
<p>还是上面的例子,但是策略变为:传入了 “title” 就按 “title” 查找,传入了 “author” 就按 “author” 查找的情形。若两者都没有传入,就返回标记为 featured 的 BLOG(这可能是管理员认为,与其返回大量的无意义随机 Blog,还不如返回一些由管理员精选的 Blog)。</p>
<source><![CDATA[<select id="findActiveBlogLike"
resultType="Blog">
SELECT * FROM BLOG WHERE state = ‘ACTIVE’
Expand All @@ -81,7 +81,7 @@
</select>]]></source>
</subsection>
<subsection name="trim、where、set" id="trimWhereSet">
<p>前面几个例子已经合宜地解决了一个臭名昭著的动态 SQL 问题。现在回到之前的 “if” 示例,这次我们将 “state = ‘ACTIVE’” 设置成动态条件,看看会发生什么。</p>
<p>前面几个例子已经方便地解决了一个臭名昭著的动态 SQL 问题。现在回到之前的 “if” 示例,这次我们将 “state = ‘ACTIVE’” 设置成动态条件,看看会发生什么。</p>
<source><![CDATA[<select id="findActiveBlogLike"
resultType="Blog">
SELECT * FROM BLOG
Expand Down

0 comments on commit 3609b85

Please sign in to comment.