mybatis-plus Included in BaseMapper,Iservice Two interfaces and ServiceImpl class ,BaseMapper in the light of dao Encapsulation method of layer
CRUD,IService Encapsulation for business logic layer , Need to specify Dao Layer class and corresponding entity class , It's in BaseMapper Strengthening on the basis of ,ServiceImpl
Implementation of business logic layer , Understand the relationship between the three can understand how to use ;

  In general, typical use examples ,XxImpl Class inherits from ServiceImpl class , And instantiate BaseMapper Subclass of XxMapper And persistence bean class , Implement custom XxService Interface ( inherit IService Interface ), stay XxImpl Class implementation CRUD The function of adding, deleting, modifying and checking , And rewrite in XxService Methods of interface definition ;
@Slf4j @Service @DS("ads") public class TbAdsZtCgrxxDayImpl extends
ServiceImpl<TbAdsZtCgrxxDayMapper,TbAdsZtCgrxxDay> implements
TbAdsZtCgrxxDayService { @Autowired private GetResponse getResponse; @Override
public List<TbAdsZtCgrxxDay> selectAllList() { return
this.baseMapper.selectAllList(); } @Override public Future<Boolean>
updateBaseInfo(TbAdsZtCgrxxDay cgr) { String ztmc=cgr.getZzmc();" What is the purchaser currently processing |{}",ztmc ); try{ String legalname
=getResponse.getBaseInfo(ztmc).get(0).getData().get(0).getLegalName(); String
cgr.setFrmc(legalname); cgr.setXydm(socialcode); }catch (Exception ex){
log.error(" Legal person or credit code available {}",ex.getMessage()); }finally {" Mission in progress , The number of tasks remaining in the thread pool is |{}",
int result = this.baseMapper.updateBaseInfo(cgr); return
AsyncResult.forValue(result>0); } } }
The relationship is as follows :

ServiceImpl Class holding BaseMapper An example of this interface , And it has been realized Iservice This interface ,
therefore XxImpl class ( Where the main business logic is implemented ) In succession ServiceImpl Class can be specified BaseMapper To instantiate ( That's the example TdAdsZtCgrxxDayMapper), and TbAdsZtCgrxxDayService yes Iservice Sub interface of interface ,XxImpl Class TdAdsZtCgrxxDaySerivice This interface defines several business logic functions ;

©2019-2020 Toolsou All rights reserved,
VUE+Canvas Achieve desktop Pinball brick elimination games C/C++ Memory model 2019PHP Interview questions ( Continuously updated )PHPspringboot2 Separation of front and rear platforms ,token Put in header Pit for verification Vue SpringBoot conduct Excel download element-ui Step on pit record 45 The 12-year-old programmer was turned down , Is the workplace wrong ?Python Web frame Pandas Fundamentals of statistical analysis _ data processing (DataFrame Common operations )Java Misunderstanding —— Method overloading is a manifestation of polymorphism ?