Skip to content

Commit 8425a30

Browse files
author
Perkins
committed
resolve issue102
1 parent a333509 commit 8425a30

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/com/itfsw/mybatis/generator/plugins/SelectSelectivePlugin.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,6 @@ private XmlElement generateSelectSelectiveElement(String id, IntrospectedTable i
265265

266266
if (byExample) {
267267
selectSelectiveEle.addElement(new TextElement("select"));
268-
if (stringHasValue(introspectedTable.getSelectByExampleQueryId())) {
269-
selectSelectiveEle.addElement(new TextElement("'" + introspectedTable.getSelectByExampleQueryId() + "' as QUERYID,"));
270-
}
271268

272269
if (!selectOne) {
273270
// issues#20
@@ -276,6 +273,11 @@ private XmlElement generateSelectSelectiveElement(String id, IntrospectedTable i
276273
ifDistinctElement.addElement(new TextElement("distinct"));
277274
selectSelectiveEle.addElement(ifDistinctElement);
278275
}
276+
277+
//issue#102
278+
if (stringHasValue(introspectedTable.getSelectByExampleQueryId())) {
279+
selectSelectiveEle.addElement(new TextElement("'" + introspectedTable.getSelectByExampleQueryId() + "' as QUERYID,"));
280+
}
279281
} else {
280282
selectSelectiveEle.addElement(new TextElement("select"));
281283
if (stringHasValue(introspectedTable.getSelectByPrimaryKeyQueryId())) {

0 commit comments

Comments
 (0)