mybatis-plus Wrapper+sql语句条件查询

@Select("select * from tb_test as test left join tb_test1 as test1 ${ew.customSqlSegment}")   //${ew.customSqlSegment} 吧wrapper条件拼接在sql上
IPage<CompanyTableVo> queryCompanyPage(@Param("page") Page page, @Param(Constants.WRAPPER) Wrapper wrapper);

使用 queryWrapper.eq()方法:这里的eq中的test1可以是你sql中写的其他表名称/别名
eq("test1.id",3)

猜你喜欢

转载自www.cnblogs.com/Zhusi/p/12525515.html