feat: 新增数据填报模块
This commit is contained in:
parent
410c5268c1
commit
5f2ad094c4
@ -0,0 +1,38 @@
|
|||||||
|
package com.yfd.platform.config;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||||
|
import org.apache.ibatis.reflection.MetaObject;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MyBatis-Plus 自动填充处理器
|
||||||
|
* 用于处理 @TableField(fill = FieldFill.INSERT/UPDATE) 注解
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入时自动填充
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void insertFill(MetaObject metaObject) {
|
||||||
|
Date now = new Date();
|
||||||
|
|
||||||
|
// 自动填充创建时间
|
||||||
|
this.strictInsertFill(metaObject, "createdAt", Date.class, now);
|
||||||
|
|
||||||
|
// 自动填充更新时间
|
||||||
|
this.strictInsertFill(metaObject, "updatedAt", Date.class, now);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时自动填充
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void updateFill(MetaObject metaObject) {
|
||||||
|
// 自动填充更新时间
|
||||||
|
this.strictUpdateFill(metaObject, "updatedAt", Date.class, new Date());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -56,6 +56,7 @@ public class SecurityConfig {
|
|||||||
.requestMatchers("/eng/**").permitAll()
|
.requestMatchers("/eng/**").permitAll()
|
||||||
.requestMatchers("/env/**").permitAll()
|
.requestMatchers("/env/**").permitAll()
|
||||||
.requestMatchers("/sw/**").permitAll()
|
.requestMatchers("/sw/**").permitAll()
|
||||||
|
.requestMatchers("/data/**").permitAll()
|
||||||
.requestMatchers(HttpMethod.GET, "/").permitAll()
|
.requestMatchers(HttpMethod.GET, "/").permitAll()
|
||||||
.requestMatchers(HttpMethod.GET,
|
.requestMatchers(HttpMethod.GET,
|
||||||
"/*.html",
|
"/*.html",
|
||||||
|
|||||||
@ -0,0 +1,124 @@
|
|||||||
|
package com.yfd.platform.data.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.yfd.platform.annotation.Log;
|
||||||
|
import com.yfd.platform.config.ResponseResult;
|
||||||
|
import com.yfd.platform.data.domain.SysUserDataScope;
|
||||||
|
import com.yfd.platform.data.service.ISysUserDataScopeService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据填报用户权限关系表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/data/userDataScope")
|
||||||
|
@Tag(name = "数据填报用户权限")
|
||||||
|
public class SysUserDataScopeController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysUserDataScopeService dataScopeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询数据填报权限列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/queryPageList")
|
||||||
|
@Operation(summary = "分页查询数据填报权限列表")
|
||||||
|
public ResponseResult queryPageList(
|
||||||
|
@RequestParam(required = false) String userId,
|
||||||
|
@RequestParam(required = false) String orgType,
|
||||||
|
@RequestParam(required = false) String orgId,
|
||||||
|
@RequestParam(required = false) Integer status,
|
||||||
|
@RequestParam(defaultValue = "1") Long pageNum,
|
||||||
|
@RequestParam(defaultValue = "10") Long pageSize) {
|
||||||
|
Page<SysUserDataScope> page = new Page<>(pageNum, pageSize);
|
||||||
|
Page<SysUserDataScope> result = dataScopeService.queryPageList(page, userId, orgType, orgId, status);
|
||||||
|
return ResponseResult.successData(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增数据填报权限
|
||||||
|
*/
|
||||||
|
// @Log(module = "数据填报权限", value = "新增数据填报权限")
|
||||||
|
@PostMapping("/add")
|
||||||
|
@Operation(summary = "新增数据填报权限")
|
||||||
|
public ResponseResult add(@RequestBody SysUserDataScope dataScope) {
|
||||||
|
boolean result = dataScopeService.addDataScope(dataScope);
|
||||||
|
return result ? ResponseResult.success("新增成功") : ResponseResult.error("新增失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据填报权限
|
||||||
|
*/
|
||||||
|
@Log(module = "数据填报权限", value = "修改数据填报权限")
|
||||||
|
@PostMapping("/update")
|
||||||
|
@Operation(summary = "修改数据填报权限")
|
||||||
|
public ResponseResult update(@RequestBody SysUserDataScope dataScope) {
|
||||||
|
if (dataScope.getId() == null || dataScope.getId().isEmpty()) {
|
||||||
|
return ResponseResult.error("缺少权限ID");
|
||||||
|
}
|
||||||
|
boolean result = dataScopeService.updateDataScope(dataScope);
|
||||||
|
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除数据填报权限
|
||||||
|
*/
|
||||||
|
@Log(module = "数据填报权限", value = "删除数据填报权限")
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@Operation(summary = "删除数据填报权限")
|
||||||
|
public ResponseResult delete(@RequestParam String id) {
|
||||||
|
boolean result = dataScopeService.deleteDataScope(id);
|
||||||
|
return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除数据填报权限
|
||||||
|
*/
|
||||||
|
@Log(module = "数据填报权限", value = "批量删除数据填报权限")
|
||||||
|
@PostMapping("/batchDelete")
|
||||||
|
@Operation(summary = "批量删除数据填报权限")
|
||||||
|
public ResponseResult batchDelete(@RequestBody List<String> ids) {
|
||||||
|
if (ids == null || ids.isEmpty()) {
|
||||||
|
return ResponseResult.error("请选择要删除的记录");
|
||||||
|
}
|
||||||
|
boolean result = dataScopeService.batchDeleteDataScope(ids);
|
||||||
|
return result ? ResponseResult.success("批量删除成功") : ResponseResult.error("批量删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询权限列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/getByUserId")
|
||||||
|
@Operation(summary = "根据用户ID查询权限列表")
|
||||||
|
public ResponseResult getByUserId(@RequestParam Long userId) {
|
||||||
|
List<SysUserDataScope> list = dataScopeService.getByUserId(userId);
|
||||||
|
return ResponseResult.successData(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据资源类型和资源编码查询
|
||||||
|
*/
|
||||||
|
@GetMapping("/getByOrg")
|
||||||
|
@Operation(summary = "根据资源类型和资源编码查询")
|
||||||
|
public ResponseResult getByOrg(@RequestParam String orgType, @RequestParam String orgId) {
|
||||||
|
List<SysUserDataScope> list = dataScopeService.getByOrg(orgType, orgId);
|
||||||
|
return ResponseResult.successData(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户有效权限(状态=1且在有效期内的)
|
||||||
|
*/
|
||||||
|
@GetMapping("/getValidPermissions")
|
||||||
|
@Operation(summary = "查询用户有效权限")
|
||||||
|
public ResponseResult getValidPermissions(@RequestParam String userId) {
|
||||||
|
List<SysUserDataScope> list = dataScopeService.getValidPermissions(userId);
|
||||||
|
return ResponseResult.successData(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,118 @@
|
|||||||
|
package com.yfd.platform.data.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据填报用户权限关系表
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("SYS_USER_DATA_SCOPE")
|
||||||
|
public class SysUserDataScope implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资源类型(BASIN/BASE/STATION)
|
||||||
|
*/
|
||||||
|
private String orgType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资源编码(流域编码/基地编码/电站编码)
|
||||||
|
*/
|
||||||
|
private String orgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上级资源编码(可选,用于层级追溯)
|
||||||
|
*/
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属站层级,默认空,后续使用
|
||||||
|
*/
|
||||||
|
private Long orgLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属站全路径(B001/BASE01/ST01),默认空,后续使用
|
||||||
|
*/
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限类型(READ/WRITE/ADMIN等),默认READ
|
||||||
|
*/
|
||||||
|
private String permissionType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色标识(可选,如调度员/管理员),默认空,后续使用
|
||||||
|
*/
|
||||||
|
private String roleCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据范围(ALL/SELF/CUSTOM),默认ALL,后续使用
|
||||||
|
*/
|
||||||
|
private String dataScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(1有效 0无效)默认有效
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生效时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失效时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Date createdAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Date updatedAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
private String updatedBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
package com.yfd.platform.data.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.yfd.platform.data.domain.SysUserDataScope;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据填报用户权限关系表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
public interface SysUserDataScopeMapper extends BaseMapper<SysUserDataScope> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询数据填报权限
|
||||||
|
*/
|
||||||
|
Page<SysUserDataScope> selectPageList(Page<SysUserDataScope> page,
|
||||||
|
@Param("userId") Long userId,
|
||||||
|
@Param("orgType") String orgType,
|
||||||
|
@Param("orgId") String orgId,
|
||||||
|
@Param("status") Integer status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询权限列表
|
||||||
|
*/
|
||||||
|
List<SysUserDataScope> selectByUserId(@Param("userId") Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据资源类型和资源编码查询
|
||||||
|
*/
|
||||||
|
List<SysUserDataScope> selectByOrg(@Param("orgType") String orgType, @Param("orgId") String orgId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*/
|
||||||
|
int batchDelete(@Param("ids") List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询有效权限(状态=1且在有效期内的)
|
||||||
|
*/
|
||||||
|
List<SysUserDataScope> selectValidPermissions(@Param("userId") Long userId);
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
package com.yfd.platform.data.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.yfd.platform.data.domain.SysUserDataScope;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据填报用户权限关系表 服务类
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
public interface ISysUserDataScopeService extends IService<SysUserDataScope> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询数据填报权限
|
||||||
|
*/
|
||||||
|
Page<SysUserDataScope> queryPageList(Page<SysUserDataScope> page, String userId, String orgType, String orgId, Integer status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增数据填报权限
|
||||||
|
*/
|
||||||
|
boolean addDataScope(SysUserDataScope dataScope);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据填报权限
|
||||||
|
*/
|
||||||
|
boolean updateDataScope(SysUserDataScope dataScope);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除数据填报权限
|
||||||
|
*/
|
||||||
|
boolean deleteDataScope(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除数据填报权限
|
||||||
|
*/
|
||||||
|
boolean batchDeleteDataScope(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询权限列表
|
||||||
|
*/
|
||||||
|
List<SysUserDataScope> getByUserId(Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据资源类型和资源编码查询
|
||||||
|
*/
|
||||||
|
List<SysUserDataScope> getByOrg(String orgType, String orgId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户有效权限(状态=1且在有效期内的)
|
||||||
|
*/
|
||||||
|
List<SysUserDataScope> getValidPermissions(String userId);
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
package com.yfd.platform.data.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.yfd.platform.data.domain.SysUserDataScope;
|
||||||
|
import com.yfd.platform.data.mapper.SysUserDataScopeMapper;
|
||||||
|
import com.yfd.platform.data.service.ISysUserDataScopeService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据填报用户权限关系表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysUserDataScopeServiceImpl extends ServiceImpl<SysUserDataScopeMapper, SysUserDataScope> implements ISysUserDataScopeService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<SysUserDataScope> queryPageList(Page<SysUserDataScope> page, String userId, String orgType, String orgId, Integer status) {
|
||||||
|
return this.page(page, this.lambdaQuery()
|
||||||
|
.eq(userId != null, SysUserDataScope::getUserId, userId)
|
||||||
|
.eq(orgType != null && !orgType.isEmpty(), SysUserDataScope::getOrgType, orgType)
|
||||||
|
.eq(orgId != null && !orgId.isEmpty(), SysUserDataScope::getOrgId, orgId)
|
||||||
|
.eq(status != null, SysUserDataScope::getStatus, status)
|
||||||
|
.orderByDesc(SysUserDataScope::getCreatedAt)
|
||||||
|
.getWrapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addDataScope(SysUserDataScope dataScope) {
|
||||||
|
return this.save(dataScope);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateDataScope(SysUserDataScope dataScope) {
|
||||||
|
return this.updateById(dataScope);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean deleteDataScope(String id) {
|
||||||
|
return this.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean batchDeleteDataScope(List<String> ids) {
|
||||||
|
return this.removeByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysUserDataScope> getByUserId(Long userId) {
|
||||||
|
return this.lambdaQuery()
|
||||||
|
.eq(SysUserDataScope::getUserId, userId)
|
||||||
|
.orderByDesc(SysUserDataScope::getCreatedAt)
|
||||||
|
.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysUserDataScope> getByOrg(String orgType, String orgId) {
|
||||||
|
return this.lambdaQuery()
|
||||||
|
.eq(SysUserDataScope::getOrgType, orgType)
|
||||||
|
.eq(SysUserDataScope::getOrgId, orgId)
|
||||||
|
.orderByDesc(SysUserDataScope::getCreatedAt)
|
||||||
|
.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysUserDataScope> getValidPermissions(String userId) {
|
||||||
|
return this.lambdaQuery()
|
||||||
|
.eq(SysUserDataScope::getUserId, userId)
|
||||||
|
.eq(SysUserDataScope::getStatus, 1)
|
||||||
|
.orderByDesc(SysUserDataScope::getCreatedAt)
|
||||||
|
.list();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -82,7 +82,8 @@ public class EngEqIntervalServiceImpl implements EngEqIntervalService {
|
|||||||
dataSourceResult.setData(list);
|
dataSourceResult.setData(list);
|
||||||
return dataSourceResult;
|
return dataSourceResult;
|
||||||
}
|
}
|
||||||
List<Map<String, Object>> mapList = dynamicSQLMapper.pageAllList(page, sql.toString(), params);
|
List<Map<String, Object>> mapList =new ArrayList<>();
|
||||||
|
// List<Map<String, Object>> mapList = dynamicSQLMapper.pageAllList(page, sql.toString(), params);
|
||||||
// List<MsEngEq> msEngEqs = convertToMsEngEqList(mapList);
|
// List<MsEngEq> msEngEqs = convertToMsEngEqList(mapList);
|
||||||
dataSourceResult.setData(mapList);
|
dataSourceResult.setData(mapList);
|
||||||
dataSourceResult.setTotal(ObjectUtil.isNotEmpty(page) ? page.getTotal() : (long) mapList.size());
|
dataSourceResult.setTotal(ObjectUtil.isNotEmpty(page) ? page.getTotal() : (long) mapList.size());
|
||||||
|
|||||||
@ -0,0 +1,75 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.yfd.platform.data.mapper.SysUserDataScopeMapper">
|
||||||
|
|
||||||
|
<resultMap id="BaseResultMap" type="com.yfd.platform.data.domain.SysUserDataScope">
|
||||||
|
<id column="ID" property="id"/>
|
||||||
|
<result column="USER_ID" property="userId"/>
|
||||||
|
<result column="ORG_TYPE" property="orgType"/>
|
||||||
|
<result column="ORG_ID" property="orgId"/>
|
||||||
|
<result column="PARENT_ID" property="parentId"/>
|
||||||
|
<result column="ORG_LEVEL" property="orgLevel"/>
|
||||||
|
<result column="PATH" property="path"/>
|
||||||
|
<result column="PERMISSION_TYPE" property="permissionType"/>
|
||||||
|
<result column="ROLE_CODE" property="roleCode"/>
|
||||||
|
<result column="DATA_SCOPE" property="dataScope"/>
|
||||||
|
<result column="STATUS" property="status"/>
|
||||||
|
<result column="START_TIME" property="startTime"/>
|
||||||
|
<result column="END_TIME" property="endTime"/>
|
||||||
|
<result column="CREATED_AT" property="createdAt"/>
|
||||||
|
<result column="CREATED_BY" property="createdBy"/>
|
||||||
|
<result column="UPDATED_AT" property="updatedAt"/>
|
||||||
|
<result column="UPDATED_BY" property="updatedBy"/>
|
||||||
|
<result column="REMARK" property="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectPageList" resultMap="BaseResultMap">
|
||||||
|
SELECT * FROM SYS_USER_DATA_SCOPE
|
||||||
|
WHERE 1=1
|
||||||
|
<if test="userId != null">
|
||||||
|
AND USER_ID = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="orgType != null and orgType != ''">
|
||||||
|
AND ORG_TYPE = #{orgType}
|
||||||
|
</if>
|
||||||
|
<if test="orgId != null and orgId != ''">
|
||||||
|
AND ORG_ID = #{orgId}
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
AND STATUS = #{status}
|
||||||
|
</if>
|
||||||
|
ORDER BY CREATED_AT DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByUserId" resultMap="BaseResultMap">
|
||||||
|
SELECT * FROM SYS_USER_DATA_SCOPE
|
||||||
|
WHERE USER_ID = #{userId}
|
||||||
|
ORDER BY CREATED_AT DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByOrg" resultMap="BaseResultMap">
|
||||||
|
SELECT * FROM SYS_USER_DATA_SCOPE
|
||||||
|
WHERE ORG_TYPE = #{orgType}
|
||||||
|
AND ORG_ID = #{orgId}
|
||||||
|
ORDER BY CREATED_AT DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="batchDelete">
|
||||||
|
DELETE FROM SYS_USER_DATA_SCOPE
|
||||||
|
WHERE ID IN
|
||||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectValidPermissions" resultMap="BaseResultMap">
|
||||||
|
SELECT * FROM SYS_USER_DATA_SCOPE
|
||||||
|
WHERE USER_ID = #{userId}
|
||||||
|
AND STATUS = 1
|
||||||
|
AND (START_TIME IS NULL OR START_TIME <= SYSDATE)
|
||||||
|
AND (END_TIME IS NULL OR END_TIME >= SYSDATE)
|
||||||
|
ORDER BY CREATED_AT DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
r.isvaild = 1
|
r.isvaild = 1
|
||||||
AND ru.userid = #{userId}
|
AND ru.userid = #{userId}
|
||||||
AND permission IS NOT NULL
|
AND permission IS NOT NULL
|
||||||
AND permission != ''
|
-- AND permission != ''
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectMenuByUserId"
|
<select id="selectMenuByUserId"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user