| | |
| | | left join "SJZT_MD"."att_res_base" arb on ctc.waterCode = arb."code" |
| | | left join "SJZT_MD"."att_ad_base" aab on aab."guid" = concat(arb."ad_guid",'000000') |
| | | where 1=1 and aab."ad_name" is not null |
| | | <if test="callTaskStatistic.createTime!=null and callTaskStatistic.createTime!=''"> |
| | | and date_format(ctr."gmt_create",'%Y-%m-%d') = #{callTaskStatistic.createTime} |
| | | </if> |
| | | group by DATE_FORMAT(ctr."gmt_create",'%Y-%m-%d'),aab."ad_name",aab."guid",aab."ad_grad",aab."p_ad_code" |
| | | ) a |
| | | on aab."guid" = a."p_ad_code" where aab."p_ad_code" = #{callTaskStatistic.adCode} |
| | |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.annotation.PreAuth; |
| | | import org.springblade.core.secure.constant.AuthConstant; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | |
| | | @ApiOperation(value = "列表", notes = "传入role") |
| | | public R<List<RoleVO>> list(@ApiIgnore @RequestParam Map<String, Object> role, BladeUser bladeUser) { |
| | | QueryWrapper<Role> queryWrapper = Condition.getQueryWrapper(role, Role.class); |
| | | // 不是超级管理员,排除超级管理员查询 |
| | | if (!AuthUtil.isAdministrator()){ |
| | | queryWrapper.ne("ROLE_ALIAS", "administrator"); |
| | | } |
| | | List<Role> list = roleService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Role::getTenantId, bladeUser.getTenantId()) : queryWrapper); |
| | | return R.data(RoleWrapper.build().listNodeVO(list)); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 授权树形结构 |
| | | * |
| | | * @param param 查询参数 |
| | | * @return |
| | | */ |
| | | List<TreeNode> grantTree(); |
| | | List<TreeNode> grantTree(@Param("param")Map<String, Object> param); |
| | | |
| | | /** |
| | | * 授权树形结构 |
| | |
| | | List<WebMenuVO> getChildrenListById(@Param("id")String id,@Param("roleId") String roleId); |
| | | |
| | | List<MenuVO> getButtonList(@Param("roleIds") List<Long> roleIds); |
| | | |
| | | /** |
| | | * 查询菜单列表(排除 web,app 之外的菜单) |
| | | * @return |
| | | */ |
| | | List<TreeNode> grantTreeNew(); |
| | | } |
| | |
| | | blade_menu menu |
| | | WHERE menu.is_deleted = 0 |
| | | <if test="param1!=null"> |
| | | and menu.parent_id = #{param1} |
| | | <choose> |
| | | <when test="param2.super!=null and param1==0"> |
| | | and menu.parent_id = #{param1} and (menu.name = 'web' or menu.name = 'app') |
| | | </when> |
| | | <otherwise> |
| | | and menu.parent_id = #{param1} |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="param2.name!=null and param2.name!=''"> |
| | | and menu.name like concat(concat('%', #{param2.name}),'%') |
| | |
| | | AND M.CATEGORY = 2 AND M.IS_DELETED = 0 AND M.BUTTON_REMARK = 'WEB' |
| | | </select> |
| | | |
| | | <!--查询菜单列表(排除 web,app 之外的菜单)--> |
| | | <select id="grantTreeNew" resultMap="treeNodeResultMap"> |
| | | select id, parent_id, name as title, id as "value", id as "key" from blade_menu |
| | | where is_deleted = 0 start with name = 'web' CONNECT BY PRIOR id = parent_id |
| | | union all |
| | | ( |
| | | select id, parent_id, name as title, id as "value", id as "key" from blade_menu |
| | | where is_deleted = 0 start with name = 'app' CONNECT BY PRIOR id = parent_id |
| | | ) |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | if (Func.isEmpty(Func.toStr(param.get(PARENT_ID)))) { |
| | | parentId = null; |
| | | } |
| | | // 如果不是超级管理员 |
| | | if (!AuthUtil.isAdministrator()){ |
| | | param.put("super",1); |
| | | } |
| | | return baseMapper.lazyList(parentId, param); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<TreeNode> grantTree(BladeUser user) { |
| | | List<TreeNode> menuTree = user.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? baseMapper.grantTree() : baseMapper.grantTreeByRole(Func.toLongList(user.getRoleId())); |
| | | Map<String, Object> param = new HashMap<>(1); |
| | | // 如果不是超级管理员 |
| | | if(!AuthUtil.isAdministrator()){ |
| | | return ForestNodeMerger.merge(tenantPackageTree(baseMapper.grantTreeNew(), user.getTenantId())); |
| | | } |
| | | List<TreeNode> menuTree = user.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? baseMapper.grantTree(param) : baseMapper.grantTreeByRole(Func.toLongList(user.getRoleId())); |
| | | return ForestNodeMerger.merge(tenantPackageTree(menuTree, user.getTenantId())); |
| | | } |
| | | |