zoukankan      html  css  js  c++  java
  • mybatisPlus or 使用

    /**
         * 查询是否有权限
         */
        @GetMapping(API_PREFIX+"/getPermissionLogCount")
        @Override
        public Integer getPermissionLogCount(String openId
            ,@RequestParam(value = "tournamentId",required = false,defaultValue = "") String tournamentId
            ,@RequestParam(value = "applicationType",required = false,defaultValue = "") String applicationType) {
            return permissionLogService.count(
                new LambdaQueryWrapper<PermissionLog>()
              //相当于 select count(id)
    PermissionLog from where getApplicantOpenid = openId and ((getRoleType = "SYSTEM") or (getRoleType = "TOURNAMENT") or (getTournamentId = tournamentId and getApplicationType = applicationType and getIsApproved = “Y” ))
              .eq(org.springblade.competition.entity.PermissionLog::getApplicantOpenid, openId)
                    .and(
    wrapper1 -> wrapper1.eq(org.springblade.competition.entity.PermissionLog::getRoleType,"SYSTEM") // 赛事创建者 .or(wrapper -> wrapper.eq(org.springblade.competition.entity.PermissionLog::getRoleType,"TOURNAMENT") .eq(org.springblade.competition.entity.PermissionLog::getTournamentId,tournamentId) ) // TOURNAMENT/ACCOUNT/ALBUM .or(w->w.eq(org.springblade.competition.entity.PermissionLog::getTournamentId,tournamentId) .eq (org.springblade.competition.entity.PermissionLog::getApplicationType, applicationType) .eq(org.springblade.competition.entity.PermissionLog::getIsApproved,"Y") ) ) ); }

    复杂一点的单表 最好还是写一条sql 

  • 相关阅读:
    CodeForces
    CodeForces
    sort自定义cmp函数
    The 2015 China Collegiate Programming Contest Sudoku
    G
    docker
    在容器内获取Pod信息(Downward API)
    k8s Pod定义详解
    Pod和容器的生命周期管理
    GoAccess日志分析工具
  • 原文地址:https://www.cnblogs.com/-mzh/p/13084752.html
Copyright © 2011-2022 走看看