test: test and close #I7VAG8

This commit is contained in:
开源海哥 2023-08-23 17:21:14 +08:00
parent ba41596a7d
commit 5d83749edf
2 changed files with 30 additions and 0 deletions

View File

@ -54,6 +54,9 @@ public class Account extends BaseEntity implements Serializable, AgeAware {
private List<Article> articles; private List<Article> articles;
@Column(ignore = true)
private String title;
public Long getId() { public Long getId() {
return id; return id;
@ -120,6 +123,14 @@ public class Account extends BaseEntity implements Serializable, AgeAware {
this.articles = articles; this.articles = articles;
} }
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Override @Override
public String toString() { public String toString() {
return "Account{" + return "Account{" +
@ -130,6 +141,7 @@ public class Account extends BaseEntity implements Serializable, AgeAware {
", options=" + options + ", options=" + options +
", isDelete=" + isDelete + ", isDelete=" + isDelete +
", articles=" + articles + ", articles=" + articles +
", title=" + title +
'}'; '}';
} }

View File

@ -141,6 +141,24 @@ public class AccountTester {
} }
/**
* issues https://gitee.com/mybatis-flex/mybatis-flex/issues/I7VAG8
*/
@Test
public void testLeftJoinSelectWithIgnoreColumn() {
QueryWrapper queryWrapper = QueryWrapper.create();
queryWrapper
.select(ACCOUNT.ID,ACCOUNT.AGE,ARTICLE.TITLE)
.from(ACCOUNT)
.leftJoin(ARTICLE).on(ACCOUNT.ID.eq(ARTICLE.ACCOUNT_ID))
.where(ACCOUNT.ID.ge(1));
List<Account> accounts = accountMapper.selectListByQuery(queryWrapper);
System.out.println(accounts);
}
@Test @Test
public void testSelectAsToDTO() { public void testSelectAsToDTO() {
List<AccountDTO> accountDTOS = accountMapper.selectListByQueryAs(QueryWrapper.create(), AccountDTO.class); List<AccountDTO> accountDTOS = accountMapper.selectListByQueryAs(QueryWrapper.create(), AccountDTO.class);