1、子查询
// 管理主管查询 Integer manageSupervisor = query.getManageSupervisor(); if (manageSupervisor != null) { queryWrapper .apply("account IN (SELECT account FROM t_account_beneficiary WHERE platform = 58 AND supervisor_manager = " + manageSupervisor + ")"); }
2、数据库切换就近原则
@DS("")
3、springboot缓存
@Caching(put = {@CachePut(key = "#result.id", condition = CacheCondition.ADD_TO_ALL), @CachePut(key = "#result.account")})
4、排序
// 排序方式 switch (query.getOrderBy()) { // 价格升序 case "PRICE_ASC": queryWrapper.orderByAsc(CdiscountOffer::getPrice); break; // 价格降序 case "PRICE_DESC": queryWrapper.orderByDesc(CdiscountOffer::getPrice); break; // 库存升序 case "STOCK_ASC": queryWrapper.orderByAsc(CdiscountOffer::getStock); break; // 库存降序 case "STOCK_DESC": queryWrapper.orderByDesc(CdiscountOffer::getStock); break; default: break; }
5.insql
queryWrapper.inSql(sb.length() > 0, CdiscountOffer::getSystemSku, PRODUCT_SQL + sb);
标签:case,queryWrapper,account,CdiscountOffer,查询,break,plus,Mybatis,manageSupervisor From: https://www.cnblogs.com/zrboke/p/16710972.html