Skip to content

Commit 8b70974

Browse files
authored
Merge pull request #103 from perkins4j2/master
resolve issue102
2 parents a333509 + 8425a30 commit 8b70974

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)