parent
e461342d4f
commit
d9a1b4ed55
@ -1,18 +0,0 @@
|
||||
package com.bwie.ruoyi.mapper;
|
||||
|
||||
import com.bwie.ruoyi.pojo.TbPerm;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_perm(权限表)】的数据库操作Mapper
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
* @Entity com.bwie.ruoyi.pojo.TbPerm
|
||||
*/
|
||||
public interface TbPermMapper extends BaseMapper<TbPerm> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,18 +0,0 @@
|
||||
package com.bwie.ruoyi.mapper;
|
||||
|
||||
import com.bwie.ruoyi.pojo.TbRole;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_role(角色表)】的数据库操作Mapper
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
* @Entity com.bwie.ruoyi.pojo.TbRole
|
||||
*/
|
||||
public interface TbRoleMapper extends BaseMapper<TbRole> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,18 +0,0 @@
|
||||
package com.bwie.ruoyi.mapper;
|
||||
|
||||
import com.bwie.ruoyi.pojo.TbRolePerm;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_role_perm(角色权限表)】的数据库操作Mapper
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
* @Entity com.bwie.ruoyi.pojo.TbRolePerm
|
||||
*/
|
||||
public interface TbRolePermMapper extends BaseMapper<TbRolePerm> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,18 +0,0 @@
|
||||
package com.bwie.ruoyi.mapper;
|
||||
|
||||
import com.bwie.ruoyi.pojo.TbUserBankcard;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_user_bankcard(账户表)】的数据库操作Mapper
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
* @Entity com.bwie.ruoyi.pojo.TbUserBankcard
|
||||
*/
|
||||
public interface TbUserBankcardMapper extends BaseMapper<TbUserBankcard> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,18 +0,0 @@
|
||||
package com.bwie.ruoyi.mapper;
|
||||
|
||||
import com.bwie.ruoyi.pojo.TbUserRole;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_user_role(用户类型表)】的数据库操作Mapper
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
* @Entity com.bwie.ruoyi.pojo.TbUserRole
|
||||
*/
|
||||
public interface TbUserRoleMapper extends BaseMapper<TbUserRole> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
package com.bwie.ruoyi.service;
|
||||
|
||||
import com.bwie.ruoyi.pojo.TbPerm;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_perm(权限表)】的数据库操作Service
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
*/
|
||||
public interface TbPermService extends IService<TbPerm> {
|
||||
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package com.bwie.ruoyi.service;
|
||||
|
||||
import com.bwie.ruoyi.pojo.TbRolePerm;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_role_perm(角色权限表)】的数据库操作Service
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
*/
|
||||
public interface TbRolePermService extends IService<TbRolePerm> {
|
||||
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package com.bwie.ruoyi.service;
|
||||
|
||||
import com.bwie.ruoyi.pojo.TbRole;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_role(角色表)】的数据库操作Service
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
*/
|
||||
public interface TbRoleService extends IService<TbRole> {
|
||||
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package com.bwie.ruoyi.service;
|
||||
|
||||
import com.bwie.ruoyi.pojo.TbUserBankcard;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_user_bankcard(账户表)】的数据库操作Service
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
*/
|
||||
public interface TbUserBankcardService extends IService<TbUserBankcard> {
|
||||
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package com.bwie.ruoyi.service;
|
||||
|
||||
import com.bwie.ruoyi.pojo.TbUserRole;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_user_role(用户类型表)】的数据库操作Service
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
*/
|
||||
public interface TbUserRoleService extends IService<TbUserRole> {
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package com.bwie.ruoyi.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bwie.ruoyi.pojo.TbPerm;
|
||||
import com.bwie.ruoyi.service.TbPermService;
|
||||
import com.bwie.ruoyi.mapper.TbPermMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_perm(权限表)】的数据库操作Service实现
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
*/
|
||||
@Service
|
||||
public class TbPermServiceImpl extends ServiceImpl<TbPermMapper, TbPerm>
|
||||
implements TbPermService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
package com.bwie.ruoyi.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bwie.ruoyi.pojo.TbRolePerm;
|
||||
import com.bwie.ruoyi.service.TbRolePermService;
|
||||
import com.bwie.ruoyi.mapper.TbRolePermMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_role_perm(角色权限表)】的数据库操作Service实现
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
*/
|
||||
@Service
|
||||
public class TbRolePermServiceImpl extends ServiceImpl<TbRolePermMapper, TbRolePerm>
|
||||
implements TbRolePermService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
package com.bwie.ruoyi.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bwie.ruoyi.pojo.TbRole;
|
||||
import com.bwie.ruoyi.service.TbRoleService;
|
||||
import com.bwie.ruoyi.mapper.TbRoleMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_role(角色表)】的数据库操作Service实现
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
*/
|
||||
@Service
|
||||
public class TbRoleServiceImpl extends ServiceImpl<TbRoleMapper, TbRole>
|
||||
implements TbRoleService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
package com.bwie.ruoyi.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bwie.ruoyi.pojo.TbUserBankcard;
|
||||
import com.bwie.ruoyi.service.TbUserBankcardService;
|
||||
import com.bwie.ruoyi.mapper.TbUserBankcardMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_user_bankcard(账户表)】的数据库操作Service实现
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
*/
|
||||
@Service
|
||||
public class TbUserBankcardServiceImpl extends ServiceImpl<TbUserBankcardMapper, TbUserBankcard>
|
||||
implements TbUserBankcardService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
package com.bwie.ruoyi.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bwie.ruoyi.pojo.TbUserRole;
|
||||
import com.bwie.ruoyi.service.TbUserRoleService;
|
||||
import com.bwie.ruoyi.mapper.TbUserRoleMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 海龙
|
||||
* @description 针对表【tb_user_role(用户类型表)】的数据库操作Service实现
|
||||
* @createDate 2023-01-13 14:34:44
|
||||
*/
|
||||
@Service
|
||||
public class TbUserRoleServiceImpl extends ServiceImpl<TbUserRoleMapper, TbUserRole>
|
||||
implements TbUserRoleService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,48 +1,43 @@
|
||||
package com.bwie.ruoyi.config;
|
||||
package com.bwie.user.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.service.Contact;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* @author 冰烆
|
||||
* @version 1.0
|
||||
* @description: TODO
|
||||
* @date 2022/10/21 20:15
|
||||
* @Description //TODO
|
||||
* @Author 王辉
|
||||
* @Date 2022/11/13 19:53
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2WebMvc
|
||||
@EnableSwagger2
|
||||
public class Knife4jConfiguration {
|
||||
@Bean(value = "dockerBean")
|
||||
public Docket dockerBean() {
|
||||
//指定使用Swagger2规范
|
||||
Docket docket = new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(webApiInfo())
|
||||
@Bean(value = "defaultApi2")
|
||||
public Docket defaultApi2() {
|
||||
String groupName="3.X版本";
|
||||
Docket docket=new Docket(DocumentationType.OAS_30)
|
||||
.apiInfo(new ApiInfoBuilder()
|
||||
.title("这是User API ")
|
||||
.description("# 这里记录服务端所有的接口的入参,出参等等信息")
|
||||
.termsOfServiceUrl("https://www.shenmazong.com")
|
||||
.contact(new Contact("shl","http://bwie.com","1447562585@qq.com"))
|
||||
.version("3.0")
|
||||
.build())
|
||||
//分组名称
|
||||
.groupName("WebApi")
|
||||
.groupName(groupName)
|
||||
.select()
|
||||
//这里指定Controller扫描包路径
|
||||
.apis(RequestHandlerSelectors.basePackage("com.bwie"))
|
||||
.apis(RequestHandlerSelectors.basePackage("com.bwie.user"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
return docket;
|
||||
}
|
||||
|
||||
private ApiInfo webApiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
//描述字段支持Markdown语法
|
||||
.title("Weekly-API")
|
||||
.contact(new Contact("苏海龙", "https://www.bwie.net/", "bwie@bwie.com"))
|
||||
.description("考试服务端API-version1.0")
|
||||
.version("1.0")
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package com.bwie.ruoyi.controller;
|
||||
package com.bwie.user.controller;
|
||||
|
||||
import com.bwie.ruoyi.service.TbUserService;
|
||||
import com.bwie.user.service.TbUserService;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.system.api.model.PhoneVo;
|
||||
import io.swagger.annotations.Api;
|
@ -0,0 +1,105 @@
|
||||
package com.bwie.user.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.bwie.user.domain.TbMyrole;
|
||||
import com.bwie.user.service.ITbMyroleService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 角色Controller
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/myrole")
|
||||
public class TbMyroleController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITbMyroleService tbMyroleService;
|
||||
|
||||
/**
|
||||
* 查询角色列表
|
||||
*/
|
||||
@RequiresPermissions("myrole:myrole:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbMyrole tbMyrole)
|
||||
{
|
||||
startPage();
|
||||
List<TbMyrole> list = tbMyroleService.selectTbMyroleList(tbMyrole);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出角色列表
|
||||
*/
|
||||
@RequiresPermissions("myrole:myrole:export")
|
||||
@Log(title = "角色", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbMyrole tbMyrole)
|
||||
{
|
||||
List<TbMyrole> list = tbMyroleService.selectTbMyroleList(tbMyrole);
|
||||
ExcelUtil<TbMyrole> util = new ExcelUtil<TbMyrole>(TbMyrole.class);
|
||||
util.exportExcel(response, list, "角色数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色详细信息
|
||||
*/
|
||||
@RequiresPermissions("myrole:myrole:query")
|
||||
@GetMapping(value = "/{roleId}")
|
||||
public AjaxResult getInfo(@PathVariable("roleId") Long roleId)
|
||||
{
|
||||
return success(tbMyroleService.selectTbMyroleByRoleId(roleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色
|
||||
*/
|
||||
@RequiresPermissions("myrole:myrole:add")
|
||||
@Log(title = "角色", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbMyrole tbMyrole)
|
||||
{
|
||||
return toAjax(tbMyroleService.insertTbMyrole(tbMyrole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色
|
||||
*/
|
||||
@RequiresPermissions("myrole:myrole:edit")
|
||||
@Log(title = "角色", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbMyrole tbMyrole)
|
||||
{
|
||||
return toAjax(tbMyroleService.updateTbMyrole(tbMyrole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
@RequiresPermissions("myrole:myrole:remove")
|
||||
@Log(title = "角色", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{roleIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] roleIds)
|
||||
{
|
||||
return toAjax(tbMyroleService.deleteTbMyroleByRoleIds(roleIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.bwie.user.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.bwie.user.domain.TbPerm;
|
||||
import com.bwie.user.service.ITbPermService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 权限Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/perm")
|
||||
public class TbPermController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITbPermService tbPermService;
|
||||
|
||||
/**
|
||||
* 查询权限列表
|
||||
*/
|
||||
@RequiresPermissions("perm:perm:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbPerm tbPerm)
|
||||
{
|
||||
startPage();
|
||||
List<TbPerm> list = tbPermService.selectTbPermList(tbPerm);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出权限列表
|
||||
*/
|
||||
@RequiresPermissions("perm:perm:export")
|
||||
@Log(title = "权限", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbPerm tbPerm)
|
||||
{
|
||||
List<TbPerm> list = tbPermService.selectTbPermList(tbPerm);
|
||||
ExcelUtil<TbPerm> util = new ExcelUtil<TbPerm>(TbPerm.class);
|
||||
util.exportExcel(response, list, "权限数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取权限详细信息
|
||||
*/
|
||||
@RequiresPermissions("perm:perm:query")
|
||||
@GetMapping(value = "/{permId}")
|
||||
public AjaxResult getInfo(@PathVariable("permId") Long permId)
|
||||
{
|
||||
return success(tbPermService.selectTbPermByPermId(permId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增权限
|
||||
*/
|
||||
@RequiresPermissions("perm:perm:add")
|
||||
@Log(title = "权限", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbPerm tbPerm)
|
||||
{
|
||||
return toAjax(tbPermService.insertTbPerm(tbPerm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改权限
|
||||
*/
|
||||
@RequiresPermissions("perm:perm:edit")
|
||||
@Log(title = "权限", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbPerm tbPerm)
|
||||
{
|
||||
return toAjax(tbPermService.updateTbPerm(tbPerm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除权限
|
||||
*/
|
||||
@RequiresPermissions("perm:perm:remove")
|
||||
@Log(title = "权限", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{permIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] permIds)
|
||||
{
|
||||
return toAjax(tbPermService.deleteTbPermByPermIds(permIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.bwie.user.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.bwie.user.domain.TbRolePerm;
|
||||
import com.bwie.user.service.ITbRolePermService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 角色权限Controller
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/roleperm")
|
||||
public class TbRolePermController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITbRolePermService tbRolePermService;
|
||||
|
||||
/**
|
||||
* 查询角色权限列表
|
||||
*/
|
||||
@RequiresPermissions("roleperm:roleperm:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbRolePerm tbRolePerm)
|
||||
{
|
||||
startPage();
|
||||
List<TbRolePerm> list = tbRolePermService.selectTbRolePermList(tbRolePerm);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出角色权限列表
|
||||
*/
|
||||
@RequiresPermissions("roleperm:roleperm:export")
|
||||
@Log(title = "角色权限", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbRolePerm tbRolePerm)
|
||||
{
|
||||
List<TbRolePerm> list = tbRolePermService.selectTbRolePermList(tbRolePerm);
|
||||
ExcelUtil<TbRolePerm> util = new ExcelUtil<TbRolePerm>(TbRolePerm.class);
|
||||
util.exportExcel(response, list, "角色权限数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色权限详细信息
|
||||
*/
|
||||
@RequiresPermissions("roleperm:roleperm:query")
|
||||
@GetMapping(value = "/{rolePermId}")
|
||||
public AjaxResult getInfo(@PathVariable("rolePermId") Long rolePermId)
|
||||
{
|
||||
return success(tbRolePermService.selectTbRolePermByRolePermId(rolePermId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色权限
|
||||
*/
|
||||
@RequiresPermissions("roleperm:roleperm:add")
|
||||
@Log(title = "角色权限", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbRolePerm tbRolePerm)
|
||||
{
|
||||
return toAjax(tbRolePermService.insertTbRolePerm(tbRolePerm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色权限
|
||||
*/
|
||||
@RequiresPermissions("roleperm:roleperm:edit")
|
||||
@Log(title = "角色权限", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbRolePerm tbRolePerm)
|
||||
{
|
||||
return toAjax(tbRolePermService.updateTbRolePerm(tbRolePerm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色权限
|
||||
*/
|
||||
@RequiresPermissions("roleperm:roleperm:remove")
|
||||
@Log(title = "角色权限", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{rolePermIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] rolePermIds)
|
||||
{
|
||||
return toAjax(tbRolePermService.deleteTbRolePermByRolePermIds(rolePermIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.bwie.user.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.bwie.user.domain.TbUserRole;
|
||||
import com.bwie.user.service.ITbUserRoleService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户类型Controller
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/userrole")
|
||||
public class TbUserRoleController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITbUserRoleService tbUserRoleService;
|
||||
|
||||
/**
|
||||
* 查询用户类型列表
|
||||
*/
|
||||
@RequiresPermissions("userrole:userrole:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbUserRole tbUserRole)
|
||||
{
|
||||
startPage();
|
||||
List<TbUserRole> list = tbUserRoleService.selectTbUserRoleList(tbUserRole);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户类型列表
|
||||
*/
|
||||
@RequiresPermissions("userrole:userrole:export")
|
||||
@Log(title = "用户类型", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbUserRole tbUserRole)
|
||||
{
|
||||
List<TbUserRole> list = tbUserRoleService.selectTbUserRoleList(tbUserRole);
|
||||
ExcelUtil<TbUserRole> util = new ExcelUtil<TbUserRole>(TbUserRole.class);
|
||||
util.exportExcel(response, list, "用户类型数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户类型详细信息
|
||||
*/
|
||||
@RequiresPermissions("userrole:userrole:query")
|
||||
@GetMapping(value = "/{userRoleId}")
|
||||
public AjaxResult getInfo(@PathVariable("userRoleId") Long userRoleId)
|
||||
{
|
||||
return success(tbUserRoleService.selectTbUserRoleByUserRoleId(userRoleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户类型
|
||||
*/
|
||||
@RequiresPermissions("userrole:userrole:add")
|
||||
@Log(title = "用户类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TbUserRole tbUserRole)
|
||||
{
|
||||
return toAjax(tbUserRoleService.insertTbUserRole(tbUserRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户类型
|
||||
*/
|
||||
@RequiresPermissions("userrole:userrole:edit")
|
||||
@Log(title = "用户类型", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TbUserRole tbUserRole)
|
||||
{
|
||||
return toAjax(tbUserRoleService.updateTbUserRole(tbUserRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户类型
|
||||
*/
|
||||
@RequiresPermissions("userrole:userrole:remove")
|
||||
@Log(title = "用户类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{userRoleIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] userRoleIds)
|
||||
{
|
||||
return toAjax(tbUserRoleService.deleteTbUserRoleByUserRoleIds(userRoleIds));
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.bwie.ruoyi.pojo;
|
||||
package com.bwie.user.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
@ -0,0 +1,61 @@
|
||||
package com.bwie.user.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bwie.user.domain.TbMyrole;
|
||||
|
||||
/**
|
||||
* 角色Mapper接口
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
public interface TbMyroleMapper
|
||||
{
|
||||
/**
|
||||
* 查询角色
|
||||
*
|
||||
* @param roleId 角色主键
|
||||
* @return 角色
|
||||
*/
|
||||
public TbMyrole selectTbMyroleByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 查询角色列表
|
||||
*
|
||||
* @param tbMyrole 角色
|
||||
* @return 角色集合
|
||||
*/
|
||||
public List<TbMyrole> selectTbMyroleList(TbMyrole tbMyrole);
|
||||
|
||||
/**
|
||||
* 新增角色
|
||||
*
|
||||
* @param tbMyrole 角色
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbMyrole(TbMyrole tbMyrole);
|
||||
|
||||
/**
|
||||
* 修改角色
|
||||
*
|
||||
* @param tbMyrole 角色
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbMyrole(TbMyrole tbMyrole);
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*
|
||||
* @param roleId 角色主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbMyroleByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 批量删除角色
|
||||
*
|
||||
* @param roleIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbMyroleByRoleIds(Long[] roleIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.bwie.user.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bwie.user.domain.TbPerm;
|
||||
|
||||
/**
|
||||
* 权限Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
public interface TbPermMapper
|
||||
{
|
||||
/**
|
||||
* 查询权限
|
||||
*
|
||||
* @param permId 权限主键
|
||||
* @return 权限
|
||||
*/
|
||||
public TbPerm selectTbPermByPermId(Long permId);
|
||||
|
||||
/**
|
||||
* 查询权限列表
|
||||
*
|
||||
* @param tbPerm 权限
|
||||
* @return 权限集合
|
||||
*/
|
||||
public List<TbPerm> selectTbPermList(TbPerm tbPerm);
|
||||
|
||||
/**
|
||||
* 新增权限
|
||||
*
|
||||
* @param tbPerm 权限
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbPerm(TbPerm tbPerm);
|
||||
|
||||
/**
|
||||
* 修改权限
|
||||
*
|
||||
* @param tbPerm 权限
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbPerm(TbPerm tbPerm);
|
||||
|
||||
/**
|
||||
* 删除权限
|
||||
*
|
||||
* @param permId 权限主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbPermByPermId(Long permId);
|
||||
|
||||
/**
|
||||
* 批量删除权限
|
||||
*
|
||||
* @param permIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbPermByPermIds(Long[] permIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.bwie.user.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bwie.user.domain.TbRolePerm;
|
||||
|
||||
/**
|
||||
* 角色权限Mapper接口
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
public interface TbRolePermMapper
|
||||
{
|
||||
/**
|
||||
* 查询角色权限
|
||||
*
|
||||
* @param rolePermId 角色权限主键
|
||||
* @return 角色权限
|
||||
*/
|
||||
public TbRolePerm selectTbRolePermByRolePermId(Long rolePermId);
|
||||
|
||||
/**
|
||||
* 查询角色权限列表
|
||||
*
|
||||
* @param tbRolePerm 角色权限
|
||||
* @return 角色权限集合
|
||||
*/
|
||||
public List<TbRolePerm> selectTbRolePermList(TbRolePerm tbRolePerm);
|
||||
|
||||
/**
|
||||
* 新增角色权限
|
||||
*
|
||||
* @param tbRolePerm 角色权限
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbRolePerm(TbRolePerm tbRolePerm);
|
||||
|
||||
/**
|
||||
* 修改角色权限
|
||||
*
|
||||
* @param tbRolePerm 角色权限
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbRolePerm(TbRolePerm tbRolePerm);
|
||||
|
||||
/**
|
||||
* 删除角色权限
|
||||
*
|
||||
* @param rolePermId 角色权限主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbRolePermByRolePermId(Long rolePermId);
|
||||
|
||||
/**
|
||||
* 批量删除角色权限
|
||||
*
|
||||
* @param rolePermIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbRolePermByRolePermIds(Long[] rolePermIds);
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package com.bwie.ruoyi.mapper;
|
||||
package com.bwie.user.mapper;
|
||||
|
||||
import com.bwie.ruoyi.pojo.TbUser;
|
||||
import com.bwie.user.domain.TbUser;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
@ -0,0 +1,61 @@
|
||||
package com.bwie.user.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bwie.user.domain.TbUserRole;
|
||||
|
||||
/**
|
||||
* 用户类型Mapper接口
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
public interface TbUserRoleMapper
|
||||
{
|
||||
/**
|
||||
* 查询用户类型
|
||||
*
|
||||
* @param userRoleId 用户类型主键
|
||||
* @return 用户类型
|
||||
*/
|
||||
public TbUserRole selectTbUserRoleByUserRoleId(Long userRoleId);
|
||||
|
||||
/**
|
||||
* 查询用户类型列表
|
||||
*
|
||||
* @param tbUserRole 用户类型
|
||||
* @return 用户类型集合
|
||||
*/
|
||||
public List<TbUserRole> selectTbUserRoleList(TbUserRole tbUserRole);
|
||||
|
||||
/**
|
||||
* 新增用户类型
|
||||
*
|
||||
* @param tbUserRole 用户类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbUserRole(TbUserRole tbUserRole);
|
||||
|
||||
/**
|
||||
* 修改用户类型
|
||||
*
|
||||
* @param tbUserRole 用户类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbUserRole(TbUserRole tbUserRole);
|
||||
|
||||
/**
|
||||
* 删除用户类型
|
||||
*
|
||||
* @param userRoleId 用户类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbUserRoleByUserRoleId(Long userRoleId);
|
||||
|
||||
/**
|
||||
* 批量删除用户类型
|
||||
*
|
||||
* @param userRoleIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbUserRoleByUserRoleIds(Long[] userRoleIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.bwie.user.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.bwie.user.domain.TbMyrole;
|
||||
|
||||
/**
|
||||
* 角色Service接口
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
public interface ITbMyroleService
|
||||
{
|
||||
/**
|
||||
* 查询角色
|
||||
*
|
||||
* @param roleId 角色主键
|
||||
* @return 角色
|
||||
*/
|
||||
public TbMyrole selectTbMyroleByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 查询角色列表
|
||||
*
|
||||
* @param tbMyrole 角色
|
||||
* @return 角色集合
|
||||
*/
|
||||
public List<TbMyrole> selectTbMyroleList(TbMyrole tbMyrole);
|
||||
|
||||
/**
|
||||
* 新增角色
|
||||
*
|
||||
* @param tbMyrole 角色
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbMyrole(TbMyrole tbMyrole);
|
||||
|
||||
/**
|
||||
* 修改角色
|
||||
*
|
||||
* @param tbMyrole 角色
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbMyrole(TbMyrole tbMyrole);
|
||||
|
||||
/**
|
||||
* 批量删除角色
|
||||
*
|
||||
* @param roleIds 需要删除的角色主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbMyroleByRoleIds(Long[] roleIds);
|
||||
|
||||
/**
|
||||
* 删除角色信息
|
||||
*
|
||||
* @param roleId 角色主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbMyroleByRoleId(Long roleId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.bwie.user.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.bwie.user.domain.TbPerm;
|
||||
|
||||
/**
|
||||
* 权限Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
public interface ITbPermService
|
||||
{
|
||||
/**
|
||||
* 查询权限
|
||||
*
|
||||
* @param permId 权限主键
|
||||
* @return 权限
|
||||
*/
|
||||
public TbPerm selectTbPermByPermId(Long permId);
|
||||
|
||||
/**
|
||||
* 查询权限列表
|
||||
*
|
||||
* @param tbPerm 权限
|
||||
* @return 权限集合
|
||||
*/
|
||||
public List<TbPerm> selectTbPermList(TbPerm tbPerm);
|
||||
|
||||
/**
|
||||
* 新增权限
|
||||
*
|
||||
* @param tbPerm 权限
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbPerm(TbPerm tbPerm);
|
||||
|
||||
/**
|
||||
* 修改权限
|
||||
*
|
||||
* @param tbPerm 权限
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbPerm(TbPerm tbPerm);
|
||||
|
||||
/**
|
||||
* 批量删除权限
|
||||
*
|
||||
* @param permIds 需要删除的权限主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbPermByPermIds(Long[] permIds);
|
||||
|
||||
/**
|
||||
* 删除权限信息
|
||||
*
|
||||
* @param permId 权限主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbPermByPermId(Long permId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.bwie.user.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.bwie.user.domain.TbRolePerm;
|
||||
|
||||
/**
|
||||
* 角色权限Service接口
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
public interface ITbRolePermService
|
||||
{
|
||||
/**
|
||||
* 查询角色权限
|
||||
*
|
||||
* @param rolePermId 角色权限主键
|
||||
* @return 角色权限
|
||||
*/
|
||||
public TbRolePerm selectTbRolePermByRolePermId(Long rolePermId);
|
||||
|
||||
/**
|
||||
* 查询角色权限列表
|
||||
*
|
||||
* @param tbRolePerm 角色权限
|
||||
* @return 角色权限集合
|
||||
*/
|
||||
public List<TbRolePerm> selectTbRolePermList(TbRolePerm tbRolePerm);
|
||||
|
||||
/**
|
||||
* 新增角色权限
|
||||
*
|
||||
* @param tbRolePerm 角色权限
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbRolePerm(TbRolePerm tbRolePerm);
|
||||
|
||||
/**
|
||||
* 修改角色权限
|
||||
*
|
||||
* @param tbRolePerm 角色权限
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbRolePerm(TbRolePerm tbRolePerm);
|
||||
|
||||
/**
|
||||
* 批量删除角色权限
|
||||
*
|
||||
* @param rolePermIds 需要删除的角色权限主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbRolePermByRolePermIds(Long[] rolePermIds);
|
||||
|
||||
/**
|
||||
* 删除角色权限信息
|
||||
*
|
||||
* @param rolePermId 角色权限主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbRolePermByRolePermId(Long rolePermId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.bwie.user.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.bwie.user.domain.TbUserRole;
|
||||
|
||||
/**
|
||||
* 用户类型Service接口
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
public interface ITbUserRoleService
|
||||
{
|
||||
/**
|
||||
* 查询用户类型
|
||||
*
|
||||
* @param userRoleId 用户类型主键
|
||||
* @return 用户类型
|
||||
*/
|
||||
public TbUserRole selectTbUserRoleByUserRoleId(Long userRoleId);
|
||||
|
||||
/**
|
||||
* 查询用户类型列表
|
||||
*
|
||||
* @param tbUserRole 用户类型
|
||||
* @return 用户类型集合
|
||||
*/
|
||||
public List<TbUserRole> selectTbUserRoleList(TbUserRole tbUserRole);
|
||||
|
||||
/**
|
||||
* 新增用户类型
|
||||
*
|
||||
* @param tbUserRole 用户类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTbUserRole(TbUserRole tbUserRole);
|
||||
|
||||
/**
|
||||
* 修改用户类型
|
||||
*
|
||||
* @param tbUserRole 用户类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTbUserRole(TbUserRole tbUserRole);
|
||||
|
||||
/**
|
||||
* 批量删除用户类型
|
||||
*
|
||||
* @param userRoleIds 需要删除的用户类型主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbUserRoleByUserRoleIds(Long[] userRoleIds);
|
||||
|
||||
/**
|
||||
* 删除用户类型信息
|
||||
*
|
||||
* @param userRoleId 用户类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTbUserRoleByUserRoleId(Long userRoleId);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.bwie.user.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bwie.user.mapper.TbMyroleMapper;
|
||||
import com.bwie.user.domain.TbMyrole;
|
||||
import com.bwie.user.service.ITbMyroleService;
|
||||
|
||||
/**
|
||||
* 角色Service业务层处理
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
@Service
|
||||
public class TbMyroleServiceImpl implements ITbMyroleService
|
||||
{
|
||||
@Autowired
|
||||
private TbMyroleMapper tbMyroleMapper;
|
||||
|
||||
/**
|
||||
* 查询角色
|
||||
*
|
||||
* @param roleId 角色主键
|
||||
* @return 角色
|
||||
*/
|
||||
@Override
|
||||
public TbMyrole selectTbMyroleByRoleId(Long roleId)
|
||||
{
|
||||
return tbMyroleMapper.selectTbMyroleByRoleId(roleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色列表
|
||||
*
|
||||
* @param tbMyrole 角色
|
||||
* @return 角色
|
||||
*/
|
||||
@Override
|
||||
public List<TbMyrole> selectTbMyroleList(TbMyrole tbMyrole)
|
||||
{
|
||||
return tbMyroleMapper.selectTbMyroleList(tbMyrole);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色
|
||||
*
|
||||
* @param tbMyrole 角色
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTbMyrole(TbMyrole tbMyrole)
|
||||
{
|
||||
tbMyrole.setCreateTime(DateUtils.getNowDate());
|
||||
return tbMyroleMapper.insertTbMyrole(tbMyrole);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色
|
||||
*
|
||||
* @param tbMyrole 角色
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTbMyrole(TbMyrole tbMyrole)
|
||||
{
|
||||
tbMyrole.setUpdateTime(DateUtils.getNowDate());
|
||||
return tbMyroleMapper.updateTbMyrole(tbMyrole);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除角色
|
||||
*
|
||||
* @param roleIds 需要删除的角色主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbMyroleByRoleIds(Long[] roleIds)
|
||||
{
|
||||
return tbMyroleMapper.deleteTbMyroleByRoleIds(roleIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色信息
|
||||
*
|
||||
* @param roleId 角色主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbMyroleByRoleId(Long roleId)
|
||||
{
|
||||
return tbMyroleMapper.deleteTbMyroleByRoleId(roleId);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.bwie.user.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bwie.user.mapper.TbPermMapper;
|
||||
import com.bwie.user.domain.TbPerm;
|
||||
import com.bwie.user.service.ITbPermService;
|
||||
|
||||
/**
|
||||
* 权限Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
@Service
|
||||
public class TbPermServiceImpl implements ITbPermService
|
||||
{
|
||||
@Autowired
|
||||
private TbPermMapper tbPermMapper;
|
||||
|
||||
/**
|
||||
* 查询权限
|
||||
*
|
||||
* @param permId 权限主键
|
||||
* @return 权限
|
||||
*/
|
||||
@Override
|
||||
public TbPerm selectTbPermByPermId(Long permId)
|
||||
{
|
||||
return tbPermMapper.selectTbPermByPermId(permId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询权限列表
|
||||
*
|
||||
* @param tbPerm 权限
|
||||
* @return 权限
|
||||
*/
|
||||
@Override
|
||||
public List<TbPerm> selectTbPermList(TbPerm tbPerm)
|
||||
{
|
||||
return tbPermMapper.selectTbPermList(tbPerm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增权限
|
||||
*
|
||||
* @param tbPerm 权限
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTbPerm(TbPerm tbPerm)
|
||||
{
|
||||
tbPerm.setCreateTime(DateUtils.getNowDate());
|
||||
return tbPermMapper.insertTbPerm(tbPerm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改权限
|
||||
*
|
||||
* @param tbPerm 权限
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTbPerm(TbPerm tbPerm)
|
||||
{
|
||||
tbPerm.setUpdateTime(DateUtils.getNowDate());
|
||||
return tbPermMapper.updateTbPerm(tbPerm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除权限
|
||||
*
|
||||
* @param permIds 需要删除的权限主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbPermByPermIds(Long[] permIds)
|
||||
{
|
||||
return tbPermMapper.deleteTbPermByPermIds(permIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除权限信息
|
||||
*
|
||||
* @param permId 权限主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbPermByPermId(Long permId)
|
||||
{
|
||||
return tbPermMapper.deleteTbPermByPermId(permId);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.bwie.user.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bwie.user.mapper.TbRolePermMapper;
|
||||
import com.bwie.user.domain.TbRolePerm;
|
||||
import com.bwie.user.service.ITbRolePermService;
|
||||
|
||||
/**
|
||||
* 角色权限Service业务层处理
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
@Service
|
||||
public class TbRolePermServiceImpl implements ITbRolePermService
|
||||
{
|
||||
@Autowired
|
||||
private TbRolePermMapper tbRolePermMapper;
|
||||
|
||||
/**
|
||||
* 查询角色权限
|
||||
*
|
||||
* @param rolePermId 角色权限主键
|
||||
* @return 角色权限
|
||||
*/
|
||||
@Override
|
||||
public TbRolePerm selectTbRolePermByRolePermId(Long rolePermId)
|
||||
{
|
||||
return tbRolePermMapper.selectTbRolePermByRolePermId(rolePermId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色权限列表
|
||||
*
|
||||
* @param tbRolePerm 角色权限
|
||||
* @return 角色权限
|
||||
*/
|
||||
@Override
|
||||
public List<TbRolePerm> selectTbRolePermList(TbRolePerm tbRolePerm)
|
||||
{
|
||||
return tbRolePermMapper.selectTbRolePermList(tbRolePerm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色权限
|
||||
*
|
||||
* @param tbRolePerm 角色权限
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTbRolePerm(TbRolePerm tbRolePerm)
|
||||
{
|
||||
tbRolePerm.setCreateTime(DateUtils.getNowDate());
|
||||
return tbRolePermMapper.insertTbRolePerm(tbRolePerm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色权限
|
||||
*
|
||||
* @param tbRolePerm 角色权限
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTbRolePerm(TbRolePerm tbRolePerm)
|
||||
{
|
||||
tbRolePerm.setUpdateTime(DateUtils.getNowDate());
|
||||
return tbRolePermMapper.updateTbRolePerm(tbRolePerm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除角色权限
|
||||
*
|
||||
* @param rolePermIds 需要删除的角色权限主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbRolePermByRolePermIds(Long[] rolePermIds)
|
||||
{
|
||||
return tbRolePermMapper.deleteTbRolePermByRolePermIds(rolePermIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色权限信息
|
||||
*
|
||||
* @param rolePermId 角色权限主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbRolePermByRolePermId(Long rolePermId)
|
||||
{
|
||||
return tbRolePermMapper.deleteTbRolePermByRolePermId(rolePermId);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.bwie.user.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bwie.user.mapper.TbUserRoleMapper;
|
||||
import com.bwie.user.domain.TbUserRole;
|
||||
import com.bwie.user.service.ITbUserRoleService;
|
||||
|
||||
/**
|
||||
* 用户类型Service业务层处理
|
||||
*
|
||||
* @author xs
|
||||
* @date 2023-01-15
|
||||
*/
|
||||
@Service
|
||||
public class TbUserRoleServiceImpl implements ITbUserRoleService
|
||||
{
|
||||
@Autowired
|
||||
private TbUserRoleMapper tbUserRoleMapper;
|
||||
|
||||
/**
|
||||
* 查询用户类型
|
||||
*
|
||||
* @param userRoleId 用户类型主键
|
||||
* @return 用户类型
|
||||
*/
|
||||
@Override
|
||||
public TbUserRole selectTbUserRoleByUserRoleId(Long userRoleId)
|
||||
{
|
||||
return tbUserRoleMapper.selectTbUserRoleByUserRoleId(userRoleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户类型列表
|
||||
*
|
||||
* @param tbUserRole 用户类型
|
||||
* @return 用户类型
|
||||
*/
|
||||
@Override
|
||||
public List<TbUserRole> selectTbUserRoleList(TbUserRole tbUserRole)
|
||||
{
|
||||
return tbUserRoleMapper.selectTbUserRoleList(tbUserRole);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户类型
|
||||
*
|
||||
* @param tbUserRole 用户类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTbUserRole(TbUserRole tbUserRole)
|
||||
{
|
||||
tbUserRole.setCreateTime(DateUtils.getNowDate());
|
||||
return tbUserRoleMapper.insertTbUserRole(tbUserRole);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户类型
|
||||
*
|
||||
* @param tbUserRole 用户类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTbUserRole(TbUserRole tbUserRole)
|
||||
{
|
||||
tbUserRole.setUpdateTime(DateUtils.getNowDate());
|
||||
return tbUserRoleMapper.updateTbUserRole(tbUserRole);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户类型
|
||||
*
|
||||
* @param userRoleIds 需要删除的用户类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbUserRoleByUserRoleIds(Long[] userRoleIds)
|
||||
{
|
||||
return tbUserRoleMapper.deleteTbUserRoleByUserRoleIds(userRoleIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户类型信息
|
||||
*
|
||||
* @param userRoleId 用户类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTbUserRoleByUserRoleId(Long userRoleId)
|
||||
{
|
||||
return tbUserRoleMapper.deleteTbUserRoleByUserRoleId(userRoleId);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.bwie.ruoyi.utils;
|
||||
package com.bwie.user.utils;
|
||||
|
||||
import org.apache.http.HttpResponse;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.bwie.ruoyi.utils;
|
||||
package com.bwie.user.utils;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.http.HttpResponse;
|
@ -1,4 +1,4 @@
|
||||
package com.bwie.ruoyi.utils;
|
||||
package com.bwie.user.utils;
|
||||
|
||||
import io.jsonwebtoken.*;
|
||||
|
@ -1,20 +0,0 @@
|
||||
<?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.bwie.ruoyi.mapper.TbPermMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.bwie.ruoyi.pojo.TbPerm">
|
||||
<id property="permId" column="perm_id" jdbcType="INTEGER"/>
|
||||
<result property="permName" column="perm_name" jdbcType="VARCHAR"/>
|
||||
<result property="permCode" column="perm_code" jdbcType="VARCHAR"/>
|
||||
<result property="deleted" column="deleted" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
perm_id,perm_name,perm_code,
|
||||
deleted,create_time,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -1,19 +0,0 @@
|
||||
<?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.bwie.ruoyi.mapper.TbRoleMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.bwie.ruoyi.pojo.TbRole">
|
||||
<id property="roleId" column="role_id" jdbcType="INTEGER"/>
|
||||
<result property="roleName" column="role_name" jdbcType="VARCHAR"/>
|
||||
<result property="deleted" column="deleted" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
role_id,role_name,deleted,
|
||||
create_time,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -1,20 +0,0 @@
|
||||
<?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.bwie.ruoyi.mapper.TbRolePermMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.bwie.ruoyi.pojo.TbRolePerm">
|
||||
<id property="rolePermId" column="role_perm_id" jdbcType="INTEGER"/>
|
||||
<result property="roleId" column="role_id" jdbcType="INTEGER"/>
|
||||
<result property="permId" column="perm_id" jdbcType="INTEGER"/>
|
||||
<result property="deleted" column="deleted" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
role_perm_id,role_id,perm_id,
|
||||
deleted,create_time,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -1,24 +0,0 @@
|
||||
<?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.bwie.ruoyi.mapper.TbUserBankcardMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.bwie.ruoyi.pojo.TbUserBankcard">
|
||||
<id property="bankcardId" column="bankcard_id" jdbcType="INTEGER"/>
|
||||
<result property="brankcardName" column="brankcard_name" jdbcType="VARCHAR"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="bankcardMoney" column="bankcard_money" jdbcType="INTEGER"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
bankcard_id,brankcard_name,user_id,
|
||||
bankcard_money,create_by,create_time,
|
||||
del_flag,update_by,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -1,22 +0,0 @@
|
||||
<?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.bwie.ruoyi.mapper.TbUserRoleMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.bwie.ruoyi.pojo.TbUserRole">
|
||||
<id property="userRoleId" column="user_role_id" jdbcType="BIGINT"/>
|
||||
<result property="userRoleName" column="user_role_name" jdbcType="VARCHAR"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="roleFunction" column="role_function" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
user_role_id,user_role_name,create_by,
|
||||
create_time,update_by,update_time,
|
||||
role_function
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,69 @@
|
||||
<?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.bwie.user.mapper.TbMyroleMapper">
|
||||
|
||||
<resultMap type="com.bwie.user.domain.TbMyrole" id="TbMyroleResult">
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="deleted" column="deleted" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbMyroleVo">
|
||||
select role_id, role_name, deleted, create_time, update_time from tb_myrole
|
||||
</sql>
|
||||
|
||||
<select id="selectTbMyroleList" parameterType="com.bwie.user.domain.TbMyrole" resultMap="TbMyroleResult">
|
||||
<include refid="selectTbMyroleVo"/>
|
||||
<where>
|
||||
<if test="roleName != null and roleName != ''"> and role_name like concat('%', #{roleName}, '%')</if>
|
||||
<if test="deleted != null "> and deleted = #{deleted}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTbMyroleByRoleId" parameterType="Long" resultMap="TbMyroleResult">
|
||||
<include refid="selectTbMyroleVo"/>
|
||||
where role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<insert id="insertTbMyrole" parameterType="com.bwie.user.domain.TbMyrole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
insert into tb_myrole
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="roleName != null and roleName != ''">role_name,</if>
|
||||
<if test="deleted != null">deleted,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="roleName != null and roleName != ''">#{roleName},</if>
|
||||
<if test="deleted != null">#{deleted},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTbMyrole" parameterType="com.bwie.user.domain.TbMyrole">
|
||||
update tb_myrole
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
||||
<if test="deleted != null">deleted = #{deleted},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where role_id = #{roleId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTbMyroleByRoleId" parameterType="Long">
|
||||
delete from tb_myrole where role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTbMyroleByRoleIds" parameterType="String">
|
||||
delete from tb_myrole where role_id in
|
||||
<foreach item="roleId" collection="array" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,74 @@
|
||||
<?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.bwie.user.mapper.TbPermMapper">
|
||||
|
||||
<resultMap type="com.bwie.user.domain.TbPerm" id="TbPermResult">
|
||||
<result property="permId" column="perm_id" />
|
||||
<result property="permName" column="perm_name" />
|
||||
<result property="permCode" column="perm_code" />
|
||||
<result property="deleted" column="deleted" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbPermVo">
|
||||
select perm_id, perm_name, perm_code, deleted, create_time, update_time from tb_perm
|
||||
</sql>
|
||||
|
||||
<select id="selectTbPermList" parameterType="com.bwie.user.domain.TbPerm" resultMap="TbPermResult">
|
||||
<include refid="selectTbPermVo"/>
|
||||
<where>
|
||||
<if test="permName != null and permName != ''"> and perm_name like concat('%', #{permName}, '%')</if>
|
||||
<if test="permCode != null and permCode != ''"> and perm_code = #{permCode}</if>
|
||||
<if test="deleted != null "> and deleted = #{deleted}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTbPermByPermId" parameterType="Long" resultMap="TbPermResult">
|
||||
<include refid="selectTbPermVo"/>
|
||||
where perm_id = #{permId}
|
||||
</select>
|
||||
|
||||
<insert id="insertTbPerm" parameterType="com.bwie.user.domain.TbPerm" useGeneratedKeys="true" keyProperty="permId">
|
||||
insert into tb_perm
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="permName != null and permName != ''">perm_name,</if>
|
||||
<if test="permCode != null and permCode != ''">perm_code,</if>
|
||||
<if test="deleted != null">deleted,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="permName != null and permName != ''">#{permName},</if>
|
||||
<if test="permCode != null and permCode != ''">#{permCode},</if>
|
||||
<if test="deleted != null">#{deleted},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTbPerm" parameterType="com.bwie.user.domain.TbPerm">
|
||||
update tb_perm
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="permName != null and permName != ''">perm_name = #{permName},</if>
|
||||
<if test="permCode != null and permCode != ''">perm_code = #{permCode},</if>
|
||||
<if test="deleted != null">deleted = #{deleted},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where perm_id = #{permId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTbPermByPermId" parameterType="Long">
|
||||
delete from tb_perm where perm_id = #{permId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTbPermByPermIds" parameterType="String">
|
||||
delete from tb_perm where perm_id in
|
||||
<foreach item="permId" collection="array" open="(" separator="," close=")">
|
||||
#{permId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,74 @@
|
||||
<?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.bwie.user.mapper.TbRolePermMapper">
|
||||
|
||||
<resultMap type="com.bwie.user.domain.TbRolePerm" id="TbRolePermResult">
|
||||
<result property="rolePermId" column="role_perm_id" />
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="permId" column="perm_id" />
|
||||
<result property="deleted" column="deleted" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbRolePermVo">
|
||||
select role_perm_id, role_id, perm_id, deleted, create_time, update_time from tb_role_perm
|
||||
</sql>
|
||||
|
||||
<select id="selectTbRolePermList" parameterType="com.bwie.user.domain.TbRolePerm" resultMap="TbRolePermResult">
|
||||
<include refid="selectTbRolePermVo"/>
|
||||
<where>
|
||||
<if test="roleId != null "> and role_id = #{roleId}</if>
|
||||
<if test="permId != null "> and perm_id = #{permId}</if>
|
||||
<if test="deleted != null "> and deleted = #{deleted}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTbRolePermByRolePermId" parameterType="Long" resultMap="TbRolePermResult">
|
||||
<include refid="selectTbRolePermVo"/>
|
||||
where role_perm_id = #{rolePermId}
|
||||
</select>
|
||||
|
||||
<insert id="insertTbRolePerm" parameterType="com.bwie.user.domain.TbRolePerm" useGeneratedKeys="true" keyProperty="rolePermId">
|
||||
insert into tb_role_perm
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="roleId != null">role_id,</if>
|
||||
<if test="permId != null">perm_id,</if>
|
||||
<if test="deleted != null">deleted,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="roleId != null">#{roleId},</if>
|
||||
<if test="permId != null">#{permId},</if>
|
||||
<if test="deleted != null">#{deleted},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTbRolePerm" parameterType="com.bwie.user.domain.TbRolePerm">
|
||||
update tb_role_perm
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="roleId != null">role_id = #{roleId},</if>
|
||||
<if test="permId != null">perm_id = #{permId},</if>
|
||||
<if test="deleted != null">deleted = #{deleted},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where role_perm_id = #{rolePermId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTbRolePermByRolePermId" parameterType="Long">
|
||||
delete from tb_role_perm where role_perm_id = #{rolePermId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTbRolePermByRolePermIds" parameterType="String">
|
||||
delete from tb_role_perm where role_perm_id in
|
||||
<foreach item="rolePermId" collection="array" open="(" separator="," close=")">
|
||||
#{rolePermId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,77 @@
|
||||
<?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.bwie.user.mapper.TbUserRoleMapper">
|
||||
|
||||
<resultMap type="com.bwie.user.domain.TbUserRole" id="TbUserRoleResult">
|
||||
<result property="userRoleId" column="user_role_id" />
|
||||
<result property="userRoleName" column="user_role_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="roleFunction" column="role_function" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTbUserRoleVo">
|
||||
select user_role_id, user_role_name, create_by, create_time, update_by, update_time, role_function from tb_user_role
|
||||
</sql>
|
||||
|
||||
<select id="selectTbUserRoleList" parameterType="com.bwie.user.domain.TbUserRole" resultMap="TbUserRoleResult">
|
||||
<include refid="selectTbUserRoleVo"/>
|
||||
<where>
|
||||
<if test="userRoleName != null and userRoleName != ''"> and user_role_name like concat('%', #{userRoleName}, '%')</if>
|
||||
<if test="roleFunction != null and roleFunction != ''"> and role_function = #{roleFunction}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTbUserRoleByUserRoleId" parameterType="Long" resultMap="TbUserRoleResult">
|
||||
<include refid="selectTbUserRoleVo"/>
|
||||
where user_role_id = #{userRoleId}
|
||||
</select>
|
||||
|
||||
<insert id="insertTbUserRole" parameterType="com.bwie.user.domain.TbUserRole" useGeneratedKeys="true" keyProperty="userRoleId">
|
||||
insert into tb_user_role
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userRoleName != null and userRoleName != ''">user_role_name,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="roleFunction != null">role_function,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userRoleName != null and userRoleName != ''">#{userRoleName},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="roleFunction != null">#{roleFunction},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTbUserRole" parameterType="com.bwie.user.domain.TbUserRole">
|
||||
update tb_user_role
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userRoleName != null and userRoleName != ''">user_role_name = #{userRoleName},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="roleFunction != null">role_function = #{roleFunction},</if>
|
||||
</trim>
|
||||
where user_role_id = #{userRoleId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTbUserRoleByUserRoleId" parameterType="Long">
|
||||
delete from tb_user_role where user_role_id = #{userRoleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTbUserRoleByUserRoleIds" parameterType="String">
|
||||
delete from tb_user_role where user_role_id in
|
||||
<foreach item="userRoleId" collection="array" open="(" separator="," close=")">
|
||||
#{userRoleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in new issue