Home > Back-end >  MyBatisPlus JPA optimization
MyBatisPlus JPA optimization

Time:05-22

What should the optimization, use mybatis once found out, use JPA to change my, a great god about optimizing
@ Override
Public IPage FindAllByCompanyName (String company, PageQuery PageQuery) {
LambdaQueryWrapper QueryWrapper=new LambdaQueryWrapper<& gt; (a);
QueryWrapper. Eq (UpmsUser: : getCompany, company);
//in accordance with the date of positive sequence sorting
QueryWrapper. OrderByAsc (UpmsUser: : getCreatedDt);

IPage Page=new PageFactory (). CreatePage (pageQuery);
IPage Result=page (page, queryWrapper);

IPage PeopleManageVoIPage=new PageFactory (). CreatePage (pageQuery);
ArrayList List=new ArrayList<> (a);

For (UpmsUser record: result. GetRecords ()) {
PeopleManageVo PeopleManageVo=new PeopleManageVo ();
BeanUtils. CopyProperties (record, peopleManageVo);
List. The add (peopleManageVo);
}
PeopleManageVoIPage. SetRecords (list);
PeopleManageVoIPage. SetPages (result. GetPages ());
PeopleManageVoIPage. SetTotal (result. GetTotal ());
Return peopleManageVoIPage;
}
  • Related