feat:增加了测试,部门查询+中间件,用户部门查询
parent
5d31fea0eb
commit
72caf426a7
|
@ -0,0 +1,88 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-goods</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- 通用 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-core</artifactId>
|
||||
</dependency>
|
||||
<!-- 导入 -->
|
||||
<!-- 导入 -->
|
||||
<!-- 导入 -->
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
<!-- common redis -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-redis</artifactId>
|
||||
</dependency>
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- common swagger -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-log</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,18 @@
|
|||
package com.muyu.goods;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
|
||||
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableMyFeignClients
|
||||
public class MuYuGoodsAppliction {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MuYuGoodsAppliction.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.muyu.goods.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.goods.domain.Admin;
|
||||
import com.muyu.goods.service.IAdminService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试信息Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin")
|
||||
public class AdminController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAdminService adminService;
|
||||
|
||||
/**
|
||||
* 查询测试信息列表
|
||||
*/
|
||||
@RequiresPermissions("goods:admin:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<Admin>> list(Admin admin)
|
||||
{
|
||||
startPage();
|
||||
List<Admin> list = adminService.selectAdminList(admin);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出测试信息列表
|
||||
*/
|
||||
@RequiresPermissions("goods:admin:export")
|
||||
@Log(title = "测试信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Admin admin)
|
||||
{
|
||||
List<Admin> list = adminService.selectAdminList(admin);
|
||||
ExcelUtil<Admin> util = new ExcelUtil<Admin>(Admin.class);
|
||||
util.exportExcel(response, list, "测试信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取测试信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("goods:admin:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(adminService.selectAdminById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增测试信息
|
||||
*/
|
||||
@RequiresPermissions("goods:admin:add")
|
||||
@Log(title = "测试信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody Admin admin)
|
||||
{
|
||||
return toAjax(adminService.insertAdmin(admin));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改测试信息
|
||||
*/
|
||||
@RequiresPermissions("goods:admin:edit")
|
||||
@Log(title = "测试信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody Admin admin)
|
||||
{
|
||||
return toAjax(adminService.updateAdmin(admin));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除测试信息
|
||||
*/
|
||||
@RequiresPermissions("goods:admin:remove")
|
||||
@Log(title = "测试信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(adminService.deleteAdminByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
package com.muyu.goods.domain;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 测试信息对象 admin
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public class Admin extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 用户名 */
|
||||
@Excel(name = "用户名")
|
||||
private String username;
|
||||
|
||||
/** 密码 */
|
||||
@Excel(name = "密码")
|
||||
private String password;
|
||||
|
||||
/** 号码 */
|
||||
@Excel(name = "号码")
|
||||
private String tel;
|
||||
|
||||
/** 角色 */
|
||||
@Excel(name = "角色")
|
||||
private Long typeId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUsername(String username)
|
||||
{
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getUsername()
|
||||
{
|
||||
return username;
|
||||
}
|
||||
public void setPassword(String password)
|
||||
{
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getPassword()
|
||||
{
|
||||
return password;
|
||||
}
|
||||
public void setTel(String tel)
|
||||
{
|
||||
this.tel = tel;
|
||||
}
|
||||
|
||||
public String getTel()
|
||||
{
|
||||
return tel;
|
||||
}
|
||||
public void setTypeId(Long typeId)
|
||||
{
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public Long getTypeId()
|
||||
{
|
||||
return typeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("username", getUsername())
|
||||
.append("password", getPassword())
|
||||
.append("tel", getTel())
|
||||
.append("typeId", getTypeId())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.muyu.goods.mapper;
|
||||
|
||||
import com.muyu.goods.domain.Admin;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试信息Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@Mapper
|
||||
public interface AdminMapper
|
||||
{
|
||||
/**
|
||||
* 查询测试信息
|
||||
*
|
||||
* @param id 测试信息主键
|
||||
* @return 测试信息
|
||||
*/
|
||||
public Admin selectAdminById(Long id);
|
||||
|
||||
/**
|
||||
* 查询测试信息列表
|
||||
*
|
||||
* @param admin 测试信息
|
||||
* @return 测试信息集合
|
||||
*/
|
||||
public List<Admin> selectAdminList(Admin admin);
|
||||
|
||||
/**
|
||||
* 新增测试信息
|
||||
*
|
||||
* @param admin 测试信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAdmin(Admin admin);
|
||||
|
||||
/**
|
||||
* 修改测试信息
|
||||
*
|
||||
* @param admin 测试信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAdmin(Admin admin);
|
||||
|
||||
/**
|
||||
* 删除测试信息
|
||||
*
|
||||
* @param id 测试信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAdminById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除测试信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAdminByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.muyu.goods.service;
|
||||
|
||||
import com.muyu.goods.domain.Admin;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试信息Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public interface IAdminService
|
||||
{
|
||||
/**
|
||||
* 查询测试信息
|
||||
*
|
||||
* @param id 测试信息主键
|
||||
* @return 测试信息
|
||||
*/
|
||||
public Admin selectAdminById(Long id);
|
||||
|
||||
/**
|
||||
* 查询测试信息列表
|
||||
*
|
||||
* @param admin 测试信息
|
||||
* @return 测试信息集合
|
||||
*/
|
||||
public List<Admin> selectAdminList(Admin admin);
|
||||
|
||||
/**
|
||||
* 新增测试信息
|
||||
*
|
||||
* @param admin 测试信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAdmin(Admin admin);
|
||||
|
||||
/**
|
||||
* 修改测试信息
|
||||
*
|
||||
* @param admin 测试信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAdmin(Admin admin);
|
||||
|
||||
/**
|
||||
* 批量删除测试信息
|
||||
*
|
||||
* @param ids 需要删除的测试信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAdminByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除测试信息信息
|
||||
*
|
||||
* @param id 测试信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAdminById(Long id);
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
package com.muyu.goods.service.impl;
|
||||
|
||||
import com.muyu.goods.domain.Admin;
|
||||
import com.muyu.goods.mapper.AdminMapper;
|
||||
import com.muyu.goods.service.IAdminService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试信息Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@Service
|
||||
public class AdminServiceImpl implements IAdminService
|
||||
{
|
||||
@Autowired
|
||||
private AdminMapper adminMapper;
|
||||
|
||||
/**
|
||||
* 查询测试信息
|
||||
*
|
||||
* @param id 测试信息主键
|
||||
* @return 测试信息
|
||||
*/
|
||||
@Override
|
||||
public Admin selectAdminById(Long id)
|
||||
{
|
||||
return adminMapper.selectAdminById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询测试信息列表
|
||||
*
|
||||
* @param admin 测试信息
|
||||
* @return 测试信息
|
||||
*/
|
||||
@Override
|
||||
public List<Admin> selectAdminList(Admin admin)
|
||||
{
|
||||
return adminMapper.selectAdminList(admin);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增测试信息
|
||||
*
|
||||
* @param admin 测试信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAdmin(Admin admin)
|
||||
{
|
||||
return adminMapper.insertAdmin(admin);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改测试信息
|
||||
*
|
||||
* @param admin 测试信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAdmin(Admin admin)
|
||||
{
|
||||
return adminMapper.updateAdmin(admin);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除测试信息
|
||||
*
|
||||
* @param ids 需要删除的测试信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAdminByIds(Long[] ids)
|
||||
{
|
||||
return adminMapper.deleteAdminByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除测试信息信息
|
||||
*
|
||||
* @param id 测试信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAdminById(Long id)
|
||||
{
|
||||
return adminMapper.deleteAdminById(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9502
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: muyu-goods
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 129.211.23.219:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 129.211.23.219:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
logging:
|
||||
level:
|
||||
com.muyu.goods.mapper: DEBUG
|
|
@ -0,0 +1,71 @@
|
|||
<?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.muyu.goods.mapper.AdminMapper">
|
||||
|
||||
<resultMap type="com.muyu.goods.domain.Admin" id="AdminResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="username" column="username" />
|
||||
<result property="password" column="password" />
|
||||
<result property="tel" column="tel" />
|
||||
<result property="typeId" column="type_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAdminVo">
|
||||
select id, username, password, tel, type_id from admin
|
||||
</sql>
|
||||
|
||||
<select id="selectAdminList" parameterType="com.muyu.goods.domain.Admin" resultMap="AdminResult">
|
||||
<include refid="selectAdminVo"/>
|
||||
<where>
|
||||
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
|
||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||
<if test="tel != null and tel != ''"> and tel = #{tel}</if>
|
||||
<if test="typeId != null "> and type_id = #{typeId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAdminById" parameterType="Long" resultMap="AdminResult">
|
||||
<include refid="selectAdminVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAdmin" parameterType="com.muyu.goods.domain.Admin" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into admin
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="username != null">username,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="tel != null">tel,</if>
|
||||
<if test="typeId != null">type_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="username != null">#{username},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="tel != null">#{tel},</if>
|
||||
<if test="typeId != null">#{typeId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAdmin" parameterType="com.muyu.goods.domain.Admin">
|
||||
update admin
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="username != null">username = #{username},</if>
|
||||
<if test="password != null">password = #{password},</if>
|
||||
<if test="tel != null">tel = #{tel},</if>
|
||||
<if test="typeId != null">type_id = #{typeId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAdminById" parameterType="Long">
|
||||
delete from admin where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAdminByIds" parameterType="String">
|
||||
delete from admin where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,87 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.system.domain.TableName;
|
||||
import com.muyu.system.domain.vo.DeptVO;
|
||||
import com.muyu.system.domain.vo.SysUserVo;
|
||||
import com.muyu.system.domain.vo.TableVo;
|
||||
import com.muyu.system.service.AccreditService;
|
||||
import com.muyu.system.service.SysDeptService;
|
||||
import com.muyu.system.service.SysUserService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("accredit")
|
||||
@Log4j2
|
||||
public class AccreditController extends BaseController {
|
||||
@Autowired
|
||||
private AccreditService service;
|
||||
//部门信息
|
||||
@Autowired
|
||||
private SysDeptService deptService;
|
||||
@Autowired
|
||||
private SysUserService userService;
|
||||
|
||||
/**
|
||||
* 获取表名
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("tableNameList")
|
||||
public Result<List<TableName>> tableNameList(){
|
||||
List<TableName> list = service.tableNameList();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取表名
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("tableNameList2")
|
||||
public Result<List<String>> tableNameList2(){
|
||||
List<String> list = service.tableNameList2();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@GetMapping("listSqlJdbc")
|
||||
public Result listSqlJdbc(){
|
||||
return service.listSqlJdbc();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取表详情
|
||||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("selectTableXml/{tableName}")
|
||||
public Result<List<TableVo>> selectTableXml(@PathVariable String tableName){
|
||||
List<TableVo> list = service.selectTableXml(tableName);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/listDeptVo")
|
||||
public Result list () {
|
||||
List<DeptVO> depts = deptService.selectDeptListVo();
|
||||
return success(depts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/listSelectSysUser")
|
||||
public Result<List<SysUserVo>> listSelectSysUser(){
|
||||
List<SysUserVo> list = userService.listSelectSysUser();
|
||||
return success(list);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.system.domain.Library;
|
||||
import com.muyu.system.domain.vo.TableVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.system.domain.AssetModel;
|
||||
import com.muyu.system.service.IAssetModelService;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 资产详情Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/model")
|
||||
public class AssetModelController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAssetModelService assetModelService;
|
||||
|
||||
/**
|
||||
* 查询资产详情列表
|
||||
*/
|
||||
@RequiresPermissions("system:model:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<AssetModel>> list(AssetModel assetModel)
|
||||
{
|
||||
startPage();
|
||||
List<AssetModel> list = assetModelService.selectAssetModelList(assetModel);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出资产详情列表
|
||||
*/
|
||||
@RequiresPermissions("system:model:export")
|
||||
@Log(title = "资产详情", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AssetModel assetModel)
|
||||
{
|
||||
List<AssetModel> list = assetModelService.selectAssetModelList(assetModel);
|
||||
ExcelUtil<AssetModel> util = new ExcelUtil<AssetModel>(AssetModel.class);
|
||||
util.exportExcel(response, list, "资产详情数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取资产详情详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:model:query")
|
||||
@GetMapping(value = "/{annotation}")
|
||||
public Result getInfo(@PathVariable("annotation") String annotation)
|
||||
{
|
||||
return success(assetModelService.selectAssetModelByAnnotation(annotation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资产详情
|
||||
*/
|
||||
@RequiresPermissions("system:model:add")
|
||||
@Log(title = "资产详情", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody AssetModel assetModel)
|
||||
{
|
||||
return toAjax(assetModelService.insertAssetModel(assetModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资产详情
|
||||
*/
|
||||
@RequiresPermissions("system:model:edit")
|
||||
@Log(title = "资产详情", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody AssetModel assetModel)
|
||||
{
|
||||
return toAjax(assetModelService.updateAssetModel(assetModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产详情
|
||||
*/
|
||||
@RequiresPermissions("system:model:remove")
|
||||
@Log(title = "资产详情", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{annotations}")
|
||||
public Result remove(@PathVariable String[] annotations)
|
||||
{
|
||||
return toAjax(assetModelService.deleteAssetModelByAnnotations(annotations));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据库的所有表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("library")
|
||||
public Result<List<Library>> library() {
|
||||
List<Library> list = assetModelService.library();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据详情
|
||||
* @param libraryName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectTable/{libraryName}")
|
||||
public Result<List<TableVo>> selectTable(@PathVariable String libraryName){
|
||||
List<TableVo> list = assetModelService.selectTable(libraryName);
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
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.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.system.domain.DataAccess;
|
||||
import com.muyu.system.service.IDataAccessService;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 数据接入Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/access")
|
||||
public class DataAccessController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDataAccessService dataAccessService;
|
||||
|
||||
/**
|
||||
* 查询数据接入列表
|
||||
*/
|
||||
@RequiresPermissions("system:access:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<DataAccess>> list(DataAccess dataAccess)
|
||||
{
|
||||
startPage();
|
||||
List<DataAccess> list = dataAccessService.selectDataAccessList(dataAccess);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据接入列表
|
||||
*/
|
||||
@RequiresPermissions("system:access:export")
|
||||
@Log(title = "数据接入", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DataAccess dataAccess)
|
||||
{
|
||||
List<DataAccess> list = dataAccessService.selectDataAccessList(dataAccess);
|
||||
ExcelUtil<DataAccess> util = new ExcelUtil<DataAccess>(DataAccess.class);
|
||||
util.exportExcel(response, list, "数据接入数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据接入详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:access:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(dataAccessService.selectDataAccessById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据接入
|
||||
*/
|
||||
@RequiresPermissions("system:access:add")
|
||||
@Log(title = "数据接入", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody DataAccess dataAccess)
|
||||
{
|
||||
return toAjax(dataAccessService.insertDataAccess(dataAccess));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据接入
|
||||
*/
|
||||
@RequiresPermissions("system:access:edit")
|
||||
@Log(title = "数据接入", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody DataAccess dataAccess)
|
||||
{
|
||||
return toAjax(dataAccessService.updateDataAccess(dataAccess));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据接入
|
||||
*/
|
||||
@RequiresPermissions("system:access:remove")
|
||||
@Log(title = "数据接入", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(dataAccessService.deleteDataAccessByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.system.domain.DataSource;
|
||||
import com.muyu.system.service.IDataSourceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取信息Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/source")
|
||||
public class DataSourceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDataSourceService dataSourceService;
|
||||
|
||||
/**
|
||||
* 查询获取信息列表
|
||||
*/
|
||||
@RequiresPermissions("system:source:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<DataSource>> list(DataSource dataSource)
|
||||
{
|
||||
startPage();
|
||||
List<DataSource> list = dataSourceService.selectDataSourceList(dataSource);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出获取信息列表
|
||||
*/
|
||||
@RequiresPermissions("system:source:export")
|
||||
@Log(title = "获取信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DataSource dataSource)
|
||||
{
|
||||
List<DataSource> list = dataSourceService.selectDataSourceList(dataSource);
|
||||
ExcelUtil<DataSource> util = new ExcelUtil<DataSource>(DataSource.class);
|
||||
util.exportExcel(response, list, "获取信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取获取信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:source:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(dataSourceService.selectDataSourceById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增获取信息
|
||||
*/
|
||||
@RequiresPermissions("system:source:add")
|
||||
@Log(title = "获取信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody DataSource dataSource)
|
||||
{
|
||||
return toAjax(dataSourceService.insertDataSource(dataSource));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改获取信息
|
||||
*/
|
||||
@RequiresPermissions("system:source:edit")
|
||||
@Log(title = "获取信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody DataSource dataSource)
|
||||
{
|
||||
return toAjax(dataSourceService.updateDataSource(dataSource));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除获取信息
|
||||
*/
|
||||
@RequiresPermissions("system:source:remove")
|
||||
@Log(title = "获取信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(dataSourceService.deleteDataSourceByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
package com.muyu.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 资产详情对象 asset_model
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public class AssetModel extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
/** 注释 */
|
||||
@Excel(name = "注释")
|
||||
private String annotation;
|
||||
|
||||
/** 是否主键Y/N */
|
||||
@Excel(name = "是否主键Y/N")
|
||||
private String key;
|
||||
|
||||
/** 类型 */
|
||||
@Excel(name = "类型")
|
||||
private String type;
|
||||
|
||||
/** 映射类型 */
|
||||
@Excel(name = "映射类型")
|
||||
private String mappingType;
|
||||
|
||||
/** 长度 */
|
||||
@Excel(name = "长度")
|
||||
private Long length;
|
||||
|
||||
/** 小数位 */
|
||||
@Excel(name = "小数位")
|
||||
private Long decimalPlace;
|
||||
|
||||
/** 是否为空 */
|
||||
@Excel(name = "是否为空")
|
||||
private String nullNot;
|
||||
|
||||
/** 默认值 */
|
||||
@Excel(name = "默认值")
|
||||
private String defaultValue;
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setAnnotation(String annotation)
|
||||
{
|
||||
this.annotation = annotation;
|
||||
}
|
||||
|
||||
public String getAnnotation()
|
||||
{
|
||||
return annotation;
|
||||
}
|
||||
public void setKey(String key)
|
||||
{
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getKey()
|
||||
{
|
||||
return key;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setMappingType(String mappingType)
|
||||
{
|
||||
this.mappingType = mappingType;
|
||||
}
|
||||
|
||||
public String getMappingType()
|
||||
{
|
||||
return mappingType;
|
||||
}
|
||||
public void setLength(Long length)
|
||||
{
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public Long getLength()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
public void setDecimalPlace(Long decimalPlace)
|
||||
{
|
||||
this.decimalPlace = decimalPlace;
|
||||
}
|
||||
|
||||
public Long getDecimalPlace()
|
||||
{
|
||||
return decimalPlace;
|
||||
}
|
||||
public void setNullNot(String nullNot)
|
||||
{
|
||||
this.nullNot = nullNot;
|
||||
}
|
||||
|
||||
public String getNullNot()
|
||||
{
|
||||
return nullNot;
|
||||
}
|
||||
public void setDefaultValue(String defaultValue)
|
||||
{
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public String getDefaultValue()
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("name", getName())
|
||||
.append("annotation", getAnnotation())
|
||||
.append("key", getKey())
|
||||
.append("type", getType())
|
||||
.append("mappingType", getMappingType())
|
||||
.append("length", getLength())
|
||||
.append("decimalPlace", getDecimalPlace())
|
||||
.append("nullNot", getNullNot())
|
||||
.append("defaultValue", getDefaultValue())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,205 @@
|
|||
package com.muyu.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 数据接入对象 data_access
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public class DataAccess extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 接入源名称 */
|
||||
@Excel(name = "接入源名称")
|
||||
private String name;
|
||||
|
||||
/** 数据来源系统名称 */
|
||||
@Excel(name = "数据来源系统名称")
|
||||
private String systemName;
|
||||
|
||||
/** 数据接入类型 */
|
||||
@Excel(name = "数据接入类型")
|
||||
private String type;
|
||||
|
||||
/** 主机地址 */
|
||||
@Excel(name = "主机地址")
|
||||
private String host;
|
||||
|
||||
/** 端口号 */
|
||||
@Excel(name = "端口号")
|
||||
private String port;
|
||||
|
||||
/** 数据库名称 */
|
||||
@Excel(name = "数据库名称")
|
||||
private String databaseName;
|
||||
|
||||
/** 数据连接参数 */
|
||||
@Excel(name = "数据连接参数")
|
||||
private String connectionParam;
|
||||
|
||||
/** 初始连接数量 */
|
||||
@Excel(name = "初始连接数量")
|
||||
private Integer initNum;
|
||||
|
||||
/** 最大连接数量 */
|
||||
@Excel(name = "最大连接数量")
|
||||
private Integer maxNum;
|
||||
|
||||
/** 最大等待时间 */
|
||||
@Excel(name = "最大等待时间")
|
||||
private Integer maxWaitTime;
|
||||
|
||||
/** 最大等待次数 */
|
||||
@Excel(name = "最大等待次数")
|
||||
private Integer maxWaitSize;
|
||||
|
||||
/** 介绍 */
|
||||
@Excel(name = "介绍")
|
||||
private String intor;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setSystemName(String systemName)
|
||||
{
|
||||
this.systemName = systemName;
|
||||
}
|
||||
|
||||
public String getSystemName()
|
||||
{
|
||||
return systemName;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setHost(String host)
|
||||
{
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public String getHost()
|
||||
{
|
||||
return host;
|
||||
}
|
||||
public void setPort(String port)
|
||||
{
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getPort()
|
||||
{
|
||||
return port;
|
||||
}
|
||||
public void setDatabaseName(String databaseName)
|
||||
{
|
||||
this.databaseName = databaseName;
|
||||
}
|
||||
|
||||
public String getDatabaseName()
|
||||
{
|
||||
return databaseName;
|
||||
}
|
||||
public void setConnectionParam(String connectionParam)
|
||||
{
|
||||
this.connectionParam = connectionParam;
|
||||
}
|
||||
|
||||
public String getConnectionParam()
|
||||
{
|
||||
return connectionParam;
|
||||
}
|
||||
public void setInitNum(Integer initNum)
|
||||
{
|
||||
this.initNum = initNum;
|
||||
}
|
||||
|
||||
public Integer getInitNum()
|
||||
{
|
||||
return initNum;
|
||||
}
|
||||
public void setMaxNum(Integer maxNum)
|
||||
{
|
||||
this.maxNum = maxNum;
|
||||
}
|
||||
|
||||
public Integer getMaxNum()
|
||||
{
|
||||
return maxNum;
|
||||
}
|
||||
public void setMaxWaitTime(Integer maxWaitTime)
|
||||
{
|
||||
this.maxWaitTime = maxWaitTime;
|
||||
}
|
||||
|
||||
public Integer getMaxWaitTime()
|
||||
{
|
||||
return maxWaitTime;
|
||||
}
|
||||
public void setMaxWaitSize(Integer maxWaitSize)
|
||||
{
|
||||
this.maxWaitSize = maxWaitSize;
|
||||
}
|
||||
|
||||
public Integer getMaxWaitSize()
|
||||
{
|
||||
return maxWaitSize;
|
||||
}
|
||||
public void setIntor(String intor)
|
||||
{
|
||||
this.intor = intor;
|
||||
}
|
||||
|
||||
public String getIntor()
|
||||
{
|
||||
return intor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("systemName", getSystemName())
|
||||
.append("type", getType())
|
||||
.append("host", getHost())
|
||||
.append("port", getPort())
|
||||
.append("databaseName", getDatabaseName())
|
||||
.append("connectionParam", getConnectionParam())
|
||||
.append("initNum", getInitNum())
|
||||
.append("maxNum", getMaxNum())
|
||||
.append("maxWaitTime", getMaxWaitTime())
|
||||
.append("maxWaitSize", getMaxWaitSize())
|
||||
.append("intor", getIntor())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,195 @@
|
|||
package com.muyu.system.domain;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 获取信息对象 data_source
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public class DataSource extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
private Long id;
|
||||
|
||||
/** 链接名 */
|
||||
@Excel(name = "链接名")
|
||||
private String dataSourceName;
|
||||
|
||||
/** 数据库来源系统名称 */
|
||||
@Excel(name = "数据库来源系统名称")
|
||||
private String dataSourceSystemName;
|
||||
|
||||
/** 数据库类型 */
|
||||
@Excel(name = "数据库类型")
|
||||
private Long databaseType;
|
||||
|
||||
/** ip地址 */
|
||||
@Excel(name = "ip地址")
|
||||
private String ip;
|
||||
|
||||
/** 端口号 */
|
||||
@Excel(name = "端口号")
|
||||
private String port;
|
||||
|
||||
/** 用户名 */
|
||||
@Excel(name = "用户名")
|
||||
private String username;
|
||||
|
||||
/** 密码 */
|
||||
@Excel(name = "密码")
|
||||
private String password;
|
||||
|
||||
/** 类型 '查询'/'存储' */
|
||||
@Excel(name = "类型 '查询'/'存储'")
|
||||
private String type;
|
||||
|
||||
/** ','拼接的连接参数 */
|
||||
@Excel(name = "','拼接的连接参数")
|
||||
private String connectionParameter;
|
||||
|
||||
/** ','拼接的连接配置 */
|
||||
@Excel(name = "','拼接的连接配置")
|
||||
private String connectionConfig;
|
||||
|
||||
/** 状态 'Y'/'N' */
|
||||
@Excel(name = "状态 'Y'/'N'")
|
||||
private String status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setDataSourceName(String dataSourceName)
|
||||
{
|
||||
this.dataSourceName = dataSourceName;
|
||||
}
|
||||
|
||||
public String getDataSourceName()
|
||||
{
|
||||
return dataSourceName;
|
||||
}
|
||||
public void setDataSourceSystemName(String dataSourceSystemName)
|
||||
{
|
||||
this.dataSourceSystemName = dataSourceSystemName;
|
||||
}
|
||||
|
||||
public String getDataSourceSystemName()
|
||||
{
|
||||
return dataSourceSystemName;
|
||||
}
|
||||
public void setDatabaseType(Long databaseType)
|
||||
{
|
||||
this.databaseType = databaseType;
|
||||
}
|
||||
|
||||
public Long getDatabaseType()
|
||||
{
|
||||
return databaseType;
|
||||
}
|
||||
public void setIp(String ip)
|
||||
{
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public String getIp()
|
||||
{
|
||||
return ip;
|
||||
}
|
||||
public void setPort(String port)
|
||||
{
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getPort()
|
||||
{
|
||||
return port;
|
||||
}
|
||||
public void setUsername(String username)
|
||||
{
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getUsername()
|
||||
{
|
||||
return username;
|
||||
}
|
||||
public void setPassword(String password)
|
||||
{
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getPassword()
|
||||
{
|
||||
return password;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setConnectionParameter(String connectionParameter)
|
||||
{
|
||||
this.connectionParameter = connectionParameter;
|
||||
}
|
||||
|
||||
public String getConnectionParameter()
|
||||
{
|
||||
return connectionParameter;
|
||||
}
|
||||
public void setConnectionConfig(String connectionConfig)
|
||||
{
|
||||
this.connectionConfig = connectionConfig;
|
||||
}
|
||||
|
||||
public String getConnectionConfig()
|
||||
{
|
||||
return connectionConfig;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("dataSourceName", getDataSourceName())
|
||||
.append("dataSourceSystemName", getDataSourceSystemName())
|
||||
.append("databaseType", getDatabaseType())
|
||||
.append("ip", getIp())
|
||||
.append("port", getPort())
|
||||
.append("username", getUsername())
|
||||
.append("password", getPassword())
|
||||
.append("type", getType())
|
||||
.append("connectionParameter", getConnectionParameter())
|
||||
.append("connectionConfig", getConnectionConfig())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.muyu.system.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
public class Library {
|
||||
private String name;
|
||||
|
||||
public Library(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.muyu.system.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Middle {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer mid;
|
||||
/**
|
||||
* 接入主键
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 部门主键
|
||||
*/
|
||||
private Integer deptId;
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
private Integer statusId;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.muyu.system.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TableName {
|
||||
private String tableName;
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
package com.muyu.system.domain.vo;
|
||||
|
||||
import com.muyu.common.system.domain.SysDept;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeptVO {
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 父部门ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String leader;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 部门状态:0正常,1停用
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 父部门名称
|
||||
*/
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
* 子部门
|
||||
*/
|
||||
private List<SysDept> children = new ArrayList<SysDept>();
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer mid;
|
||||
/**
|
||||
* 接入
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
private Integer statusId;
|
||||
}
|
|
@ -0,0 +1,143 @@
|
|||
package com.muyu.system.domain.vo;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.annotation.Excel.ColumnType;
|
||||
import com.muyu.common.core.annotation.Excel.Type;
|
||||
import com.muyu.common.core.annotation.Excels;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.xss.Xss;
|
||||
import com.muyu.common.system.domain.SysDept;
|
||||
import com.muyu.common.system.domain.SysRole;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户对象 sys_user
|
||||
*
|
||||
* @author muyu
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysUserVo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@Excel(name = "部门编号", type = Type.IMPORT)
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@Excel(name = "登录名称")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@Excel(name = "用户名称")
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
@Excel(name = "用户邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@Excel(name = "手机号码")
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 用户性别
|
||||
*/
|
||||
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 帐号状态(0正常 1停用)
|
||||
*/
|
||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
@Excel(name = "最后登录IP", type = Type.EXPORT)
|
||||
private String loginIp;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||
private Date loginDate;
|
||||
|
||||
/**
|
||||
* 部门对象
|
||||
*/
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
|
||||
})
|
||||
private SysDept dept;
|
||||
|
||||
/**
|
||||
* 角色对象
|
||||
*/
|
||||
private List<SysRole> roles;
|
||||
|
||||
/**
|
||||
* 角色组
|
||||
*/
|
||||
private Long[] roleIds;
|
||||
|
||||
/**
|
||||
* 岗位组
|
||||
*/
|
||||
private Long[] postIds;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
private String DeptName;
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
package com.muyu.system.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TableVo {
|
||||
/**
|
||||
* 表目录
|
||||
*/
|
||||
private String tableCatalog;
|
||||
/**
|
||||
*表模式
|
||||
*/
|
||||
private String tableSchema;
|
||||
/**
|
||||
*表名
|
||||
*/
|
||||
private String TableName;
|
||||
/**
|
||||
*列名
|
||||
*/
|
||||
private String columnName;
|
||||
/**
|
||||
*序号位置
|
||||
*/
|
||||
private String ordinalPosition;
|
||||
/**
|
||||
*列默认
|
||||
*/
|
||||
private String columnDefault;
|
||||
/**
|
||||
*是否为空
|
||||
*/
|
||||
private String isNullable;
|
||||
/**
|
||||
*类型
|
||||
*/
|
||||
private String dateType;
|
||||
/**
|
||||
*字符最大长度
|
||||
*/
|
||||
private String characterMaximumLength;
|
||||
/**
|
||||
*字符八位长度
|
||||
*/
|
||||
private String characterOctetLength;
|
||||
/**
|
||||
*数值精度
|
||||
*/
|
||||
private String numericPrecision;
|
||||
/**
|
||||
*数值范围
|
||||
*/
|
||||
private String numericScale;
|
||||
/**
|
||||
*精度
|
||||
*/
|
||||
private String datetimePrecision;
|
||||
/**
|
||||
*字符集名称
|
||||
*/
|
||||
private String characterSetName;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String collationName;
|
||||
/**
|
||||
*排序规则名
|
||||
*/
|
||||
private String columnType;
|
||||
/**
|
||||
*列键
|
||||
*/
|
||||
private String columnKey;
|
||||
/**
|
||||
*额外的
|
||||
*/
|
||||
private String extra;
|
||||
/**
|
||||
*特权
|
||||
*/
|
||||
private String privileges;
|
||||
/**
|
||||
*备注
|
||||
*/
|
||||
private String columnComment;
|
||||
/**
|
||||
*表达式
|
||||
*/
|
||||
private String generationExpressio;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.system.mapper;
|
||||
|
||||
import com.muyu.system.domain.Library;
|
||||
import com.muyu.system.domain.TableName;
|
||||
import com.muyu.system.domain.vo.TableVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AccreditMapper {
|
||||
List<TableName> tableNameList();
|
||||
|
||||
|
||||
String database();
|
||||
|
||||
List<TableVo> selectTableXml(@Param("database") String database, @Param("tableName") String tableName);
|
||||
|
||||
List<String> tableNameList2();
|
||||
|
||||
int getNameSelTable(@Param("s") String s);
|
||||
|
||||
void indexTableName(@Param("s") String s);
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.muyu.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.system.domain.AssetModel;
|
||||
import com.muyu.system.domain.Library;
|
||||
import com.muyu.system.domain.vo.TableVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 资产详情Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public interface AssetModelMapper
|
||||
{
|
||||
/**
|
||||
* 查询资产详情
|
||||
*
|
||||
* @param annotation 资产详情主键
|
||||
* @return 资产详情
|
||||
*/
|
||||
public AssetModel selectAssetModelByAnnotation(String annotation);
|
||||
|
||||
/**
|
||||
* 查询资产详情列表
|
||||
*
|
||||
* @param assetModel 资产详情
|
||||
* @return 资产详情集合
|
||||
*/
|
||||
public List<AssetModel> selectAssetModelList(AssetModel assetModel);
|
||||
|
||||
/**
|
||||
* 新增资产详情
|
||||
*
|
||||
* @param assetModel 资产详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAssetModel(AssetModel assetModel);
|
||||
|
||||
/**
|
||||
* 修改资产详情
|
||||
*
|
||||
* @param assetModel 资产详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAssetModel(AssetModel assetModel);
|
||||
|
||||
/**
|
||||
* 删除资产详情
|
||||
*
|
||||
* @param annotation 资产详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetModelByAnnotation(String annotation);
|
||||
|
||||
/**
|
||||
* 批量删除资产详情
|
||||
*
|
||||
* @param annotations 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetModelByAnnotations(String[] annotations);
|
||||
|
||||
List<String> library();
|
||||
|
||||
String database();
|
||||
|
||||
List<TableVo> selectTable(@Param("database") String database, @Param("libraryName") String libraryName);
|
||||
|
||||
List<Library> library2();
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.muyu.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.system.domain.DataAccess;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 数据接入Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public interface DataAccessMapper
|
||||
{
|
||||
/**
|
||||
* 查询数据接入
|
||||
*
|
||||
* @param id 数据接入主键
|
||||
* @return 数据接入
|
||||
*/
|
||||
public DataAccess selectDataAccessById(Long id);
|
||||
|
||||
/**
|
||||
* 查询数据接入列表
|
||||
*
|
||||
* @param dataAccess 数据接入
|
||||
* @return 数据接入集合
|
||||
*/
|
||||
public List<DataAccess> selectDataAccessList(DataAccess dataAccess);
|
||||
|
||||
/**
|
||||
* 新增数据接入
|
||||
*
|
||||
* @param dataAccess 数据接入
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDataAccess(DataAccess dataAccess);
|
||||
|
||||
/**
|
||||
* 修改数据接入
|
||||
*
|
||||
* @param dataAccess 数据接入
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDataAccess(DataAccess dataAccess);
|
||||
|
||||
/**
|
||||
* 删除数据接入
|
||||
*
|
||||
* @param id 数据接入主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDataAccessById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除数据接入
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDataAccessByIds(Long[] ids);
|
||||
|
||||
DataAccess oneDataAccess();
|
||||
|
||||
void insertMiddle(@Param("deptId") Long deptId, @Param("id") Long id);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.muyu.system.mapper;
|
||||
|
||||
import com.muyu.system.domain.DataSource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取信息Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public interface DataSourceMapper
|
||||
{
|
||||
/**
|
||||
* 查询获取信息
|
||||
*
|
||||
* @param id 获取信息主键
|
||||
* @return 获取信息
|
||||
*/
|
||||
public DataSource selectDataSourceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询获取信息列表
|
||||
*
|
||||
* @param dataSource 获取信息
|
||||
* @return 获取信息集合
|
||||
*/
|
||||
public List<DataSource> selectDataSourceList(DataSource dataSource);
|
||||
|
||||
/**
|
||||
* 新增获取信息
|
||||
*
|
||||
* @param dataSource 获取信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDataSource(DataSource dataSource);
|
||||
|
||||
/**
|
||||
* 修改获取信息
|
||||
*
|
||||
* @param dataSource 获取信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDataSource(DataSource dataSource);
|
||||
|
||||
/**
|
||||
* 删除获取信息
|
||||
*
|
||||
* @param id 获取信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDataSourceById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除获取信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDataSourceByIds(Long[] ids);
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.muyu.system.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.common.system.domain.SysDept;
|
||||
import com.muyu.system.domain.vo.DeptVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -128,4 +129,8 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById (Long deptId);
|
||||
|
||||
List<SysDept> listDeptList();
|
||||
|
||||
List<DeptVO> selectDeptListVo();
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.system.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.system.domain.vo.SysUserVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -139,4 +140,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
|||
* @return 结果
|
||||
*/
|
||||
public SysUser checkEmailUnique (String email);
|
||||
|
||||
List<SysUserVo> listSelectSysUser();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package com.muyu.system.service;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.system.domain.Library;
|
||||
import com.muyu.system.domain.TableName;
|
||||
import com.muyu.system.domain.vo.TableVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AccreditService {
|
||||
List<TableName> tableNameList();
|
||||
|
||||
List<TableVo> selectTableXml(String tableName);
|
||||
|
||||
List<String> tableNameList2();
|
||||
|
||||
Result listSqlJdbc();
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.muyu.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.system.domain.AssetModel;
|
||||
import com.muyu.system.domain.Library;
|
||||
import com.muyu.system.domain.vo.TableVo;
|
||||
|
||||
/**
|
||||
* 资产详情Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public interface IAssetModelService
|
||||
{
|
||||
/**
|
||||
* 查询资产详情
|
||||
*
|
||||
* @param annotation 资产详情主键
|
||||
* @return 资产详情
|
||||
*/
|
||||
public AssetModel selectAssetModelByAnnotation(String annotation);
|
||||
|
||||
/**
|
||||
* 查询资产详情列表
|
||||
*
|
||||
* @param assetModel 资产详情
|
||||
* @return 资产详情集合
|
||||
*/
|
||||
public List<AssetModel> selectAssetModelList(AssetModel assetModel);
|
||||
|
||||
/**
|
||||
* 新增资产详情
|
||||
*
|
||||
* @param assetModel 资产详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAssetModel(AssetModel assetModel);
|
||||
|
||||
/**
|
||||
* 修改资产详情
|
||||
*
|
||||
* @param assetModel 资产详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAssetModel(AssetModel assetModel);
|
||||
|
||||
/**
|
||||
* 批量删除资产详情
|
||||
*
|
||||
* @param annotations 需要删除的资产详情主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetModelByAnnotations(String[] annotations);
|
||||
|
||||
/**
|
||||
* 删除资产详情信息
|
||||
*
|
||||
* @param annotation 资产详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetModelByAnnotation(String annotation);
|
||||
|
||||
List<Library> library();
|
||||
|
||||
List<TableVo> selectTable(String libraryName);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.muyu.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.system.domain.DataAccess;
|
||||
|
||||
/**
|
||||
* 数据接入Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public interface IDataAccessService
|
||||
{
|
||||
/**
|
||||
* 查询数据接入
|
||||
*
|
||||
* @param id 数据接入主键
|
||||
* @return 数据接入
|
||||
*/
|
||||
public DataAccess selectDataAccessById(Long id);
|
||||
|
||||
/**
|
||||
* 查询数据接入列表
|
||||
*
|
||||
* @param dataAccess 数据接入
|
||||
* @return 数据接入集合
|
||||
*/
|
||||
public List<DataAccess> selectDataAccessList(DataAccess dataAccess);
|
||||
|
||||
/**
|
||||
* 新增数据接入
|
||||
*
|
||||
* @param dataAccess 数据接入
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDataAccess(DataAccess dataAccess);
|
||||
|
||||
/**
|
||||
* 修改数据接入
|
||||
*
|
||||
* @param dataAccess 数据接入
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDataAccess(DataAccess dataAccess);
|
||||
|
||||
/**
|
||||
* 批量删除数据接入
|
||||
*
|
||||
* @param ids 需要删除的数据接入主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDataAccessByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除数据接入信息
|
||||
*
|
||||
* @param id 数据接入主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDataAccessById(Long id);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.muyu.system.service;
|
||||
|
||||
import com.muyu.system.domain.DataSource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取信息Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public interface IDataSourceService
|
||||
{
|
||||
/**
|
||||
* 查询获取信息
|
||||
*
|
||||
* @param id 获取信息主键
|
||||
* @return 获取信息
|
||||
*/
|
||||
public DataSource selectDataSourceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询获取信息列表
|
||||
*
|
||||
* @param dataSource 获取信息
|
||||
* @return 获取信息集合
|
||||
*/
|
||||
public List<DataSource> selectDataSourceList(DataSource dataSource);
|
||||
|
||||
/**
|
||||
* 新增获取信息
|
||||
*
|
||||
* @param dataSource 获取信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDataSource(DataSource dataSource);
|
||||
|
||||
/**
|
||||
* 修改获取信息
|
||||
*
|
||||
* @param dataSource 获取信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDataSource(DataSource dataSource);
|
||||
|
||||
/**
|
||||
* 批量删除获取信息
|
||||
*
|
||||
* @param ids 需要删除的获取信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDataSourceByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除获取信息信息
|
||||
*
|
||||
* @param id 获取信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDataSourceById(Long id);
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.muyu.system.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.system.domain.SysDept;
|
||||
import com.muyu.system.domain.vo.DeptVO;
|
||||
import com.muyu.system.domain.vo.TreeSelect;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -135,4 +136,12 @@ public interface SysDeptService extends IService<SysDept> {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById (Long deptId);
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
*
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
List<DeptVO> selectDeptListVo();
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.system.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.system.domain.vo.SysUserVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -225,4 +226,6 @@ public interface SysUserService extends IService<SysUser> {
|
|||
* @return 结果
|
||||
*/
|
||||
public String importUser (List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
||||
|
||||
List<SysUserVo> listSelectSysUser();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.system.service.impl;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.system.domain.Library;
|
||||
import com.muyu.system.domain.TableName;
|
||||
import com.muyu.system.domain.vo.TableVo;
|
||||
import com.muyu.system.mapper.AccreditMapper;
|
||||
import com.muyu.system.service.AccreditService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AccreditServiceImpl implements AccreditService {
|
||||
@Autowired
|
||||
private AccreditMapper mapper;
|
||||
@Override
|
||||
public List<TableName> tableNameList() {
|
||||
List<TableName> list = mapper.tableNameList();
|
||||
System.out.println(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TableVo> selectTableXml(String tableName) {
|
||||
String database = mapper.database();
|
||||
List<TableVo> list = mapper.selectTableXml(database,tableName);
|
||||
System.out.println(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> tableNameList2() {
|
||||
List<String> list = mapper.tableNameList2();
|
||||
for (String s : list) {
|
||||
if (mapper.getNameSelTable(s)>1){
|
||||
}else{
|
||||
mapper.indexTableName(s);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result listSqlJdbc() {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
package com.muyu.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.system.domain.Library;
|
||||
import com.muyu.system.domain.vo.TableVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.system.mapper.AssetModelMapper;
|
||||
import com.muyu.system.domain.AssetModel;
|
||||
import com.muyu.system.service.IAssetModelService;
|
||||
|
||||
/**
|
||||
* 资产详情Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@Service
|
||||
public class AssetModelServiceImpl implements IAssetModelService
|
||||
{
|
||||
@Autowired
|
||||
private AssetModelMapper assetModelMapper;
|
||||
|
||||
/**
|
||||
* 查询资产详情
|
||||
*
|
||||
* @param annotation 资产详情主键
|
||||
* @return 资产详情
|
||||
*/
|
||||
@Override
|
||||
public AssetModel selectAssetModelByAnnotation(String annotation)
|
||||
{
|
||||
return assetModelMapper.selectAssetModelByAnnotation(annotation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资产详情列表
|
||||
*
|
||||
* @param assetModel 资产详情
|
||||
* @return 资产详情
|
||||
*/
|
||||
@Override
|
||||
public List<AssetModel> selectAssetModelList(AssetModel assetModel)
|
||||
{
|
||||
return assetModelMapper.selectAssetModelList(assetModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资产详情
|
||||
*
|
||||
* @param assetModel 资产详情
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAssetModel(AssetModel assetModel)
|
||||
{
|
||||
return assetModelMapper.insertAssetModel(assetModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资产详情
|
||||
*
|
||||
* @param assetModel 资产详情
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAssetModel(AssetModel assetModel)
|
||||
{
|
||||
return assetModelMapper.updateAssetModel(assetModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除资产详情
|
||||
*
|
||||
* @param annotations 需要删除的资产详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAssetModelByAnnotations(String[] annotations)
|
||||
{
|
||||
return assetModelMapper.deleteAssetModelByAnnotations(annotations);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产详情信息
|
||||
*
|
||||
* @param annotation 资产详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAssetModelByAnnotation(String annotation)
|
||||
{
|
||||
return assetModelMapper.deleteAssetModelByAnnotation(annotation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Library> library() {
|
||||
List<Library> list2 = assetModelMapper.library2();
|
||||
System.out.println(list2);
|
||||
return list2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TableVo> selectTable(String libraryName) {
|
||||
String database = assetModelMapper.database();
|
||||
List<TableVo> list = assetModelMapper.selectTable(database,libraryName);
|
||||
System.out.println(list);
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
package com.muyu.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.system.domain.SysDept;
|
||||
import com.muyu.system.mapper.SysDeptMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.system.mapper.DataAccessMapper;
|
||||
import com.muyu.system.domain.DataAccess;
|
||||
import com.muyu.system.service.IDataAccessService;
|
||||
|
||||
/**
|
||||
* 数据接入Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@Service
|
||||
public class DataAccessServiceImpl implements IDataAccessService
|
||||
{
|
||||
@Autowired
|
||||
private DataAccessMapper dataAccessMapper;
|
||||
@Autowired
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
|
||||
/**
|
||||
* 查询数据接入
|
||||
*
|
||||
* @param id 数据接入主键
|
||||
* @return 数据接入
|
||||
*/
|
||||
@Override
|
||||
public DataAccess selectDataAccessById(Long id)
|
||||
{
|
||||
return dataAccessMapper.selectDataAccessById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据接入列表
|
||||
*
|
||||
* @param dataAccess 数据接入
|
||||
* @return 数据接入
|
||||
*/
|
||||
@Override
|
||||
public List<DataAccess> selectDataAccessList(DataAccess dataAccess)
|
||||
{
|
||||
return dataAccessMapper.selectDataAccessList(dataAccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据接入
|
||||
*
|
||||
* @param dataAccess 数据接入
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDataAccess(DataAccess dataAccess)
|
||||
{
|
||||
int i = dataAccessMapper.insertDataAccess(dataAccess);
|
||||
List<SysDept> list = sysDeptMapper.listDeptList();
|
||||
DataAccess dataAccess1 = dataAccessMapper.oneDataAccess();
|
||||
for (SysDept sysDept : list) {
|
||||
dataAccessMapper.insertMiddle(sysDept.getDeptId(),dataAccess1.getId());
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据接入
|
||||
*
|
||||
* @param dataAccess 数据接入
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDataAccess(DataAccess dataAccess)
|
||||
{
|
||||
return dataAccessMapper.updateDataAccess(dataAccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除数据接入
|
||||
*
|
||||
* @param ids 需要删除的数据接入主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDataAccessByIds(Long[] ids)
|
||||
{
|
||||
return dataAccessMapper.deleteDataAccessByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据接入信息
|
||||
*
|
||||
* @param id 数据接入主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDataAccessById(Long id)
|
||||
{
|
||||
return dataAccessMapper.deleteDataAccessById(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
package com.muyu.system.service.impl;
|
||||
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.system.domain.DataSource;
|
||||
import com.muyu.system.mapper.DataSourceMapper;
|
||||
import com.muyu.system.service.IDataSourceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取信息Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@Service
|
||||
public class DataSourceServiceImpl implements IDataSourceService
|
||||
{
|
||||
@Autowired
|
||||
private DataSourceMapper dataSourceMapper;
|
||||
|
||||
/**
|
||||
* 查询获取信息
|
||||
*
|
||||
* @param id 获取信息主键
|
||||
* @return 获取信息
|
||||
*/
|
||||
@Override
|
||||
public DataSource selectDataSourceById(Long id)
|
||||
{
|
||||
return dataSourceMapper.selectDataSourceById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询获取信息列表
|
||||
*
|
||||
* @param dataSource 获取信息
|
||||
* @return 获取信息
|
||||
*/
|
||||
@Override
|
||||
public List<DataSource> selectDataSourceList(DataSource dataSource)
|
||||
{
|
||||
return dataSourceMapper.selectDataSourceList(dataSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增获取信息
|
||||
*
|
||||
* @param dataSource 获取信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDataSource(DataSource dataSource)
|
||||
{
|
||||
dataSource.setCreateTime(DateUtils.getNowDate());
|
||||
return dataSourceMapper.insertDataSource(dataSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改获取信息
|
||||
*
|
||||
* @param dataSource 获取信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDataSource(DataSource dataSource)
|
||||
{
|
||||
dataSource.setUpdateTime(DateUtils.getNowDate());
|
||||
return dataSourceMapper.updateDataSource(dataSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除获取信息
|
||||
*
|
||||
* @param ids 需要删除的获取信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDataSourceByIds(Long[] ids)
|
||||
{
|
||||
return dataSourceMapper.deleteDataSourceByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除获取信息信息
|
||||
*
|
||||
* @param id 获取信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDataSourceById(Long id)
|
||||
{
|
||||
return dataSourceMapper.deleteDataSourceById(id);
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ import com.muyu.common.security.utils.SecurityUtils;
|
|||
import com.muyu.common.system.domain.SysDept;
|
||||
import com.muyu.common.system.domain.SysRole;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.system.domain.vo.DeptVO;
|
||||
import com.muyu.system.domain.vo.TreeSelect;
|
||||
import com.muyu.system.mapper.SysDeptMapper;
|
||||
import com.muyu.system.mapper.SysRoleMapper;
|
||||
|
@ -279,6 +280,17 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|||
public int deleteDeptById (Long deptId) {
|
||||
return deptMapper.deleteDeptById(deptId);
|
||||
}
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
*
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
@Override
|
||||
public List<DeptVO> selectDeptListVo() {
|
||||
return deptMapper.selectDeptListVo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归列表
|
||||
|
|
|
@ -13,6 +13,7 @@ import com.muyu.common.system.domain.SysUser;
|
|||
import com.muyu.system.domain.SysPost;
|
||||
import com.muyu.system.domain.SysUserPost;
|
||||
import com.muyu.system.domain.SysUserRole;
|
||||
import com.muyu.system.domain.vo.SysUserVo;
|
||||
import com.muyu.system.mapper.*;
|
||||
import com.muyu.system.service.SysUserService;
|
||||
import com.muyu.system.service.SysConfigService;
|
||||
|
@ -500,4 +501,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
return successMsg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUserVo> listSelectSysUser() {
|
||||
return userMapper.listSelectSysUser();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<?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.muyu.system.mapper.AccreditMapper">
|
||||
<insert id="indexTableName">
|
||||
insert into table_name (table_name)
|
||||
values (#{s});
|
||||
</insert>
|
||||
<select id="tableNameList" resultType="com.muyu.system.domain.TableName">
|
||||
select *
|
||||
from table_name
|
||||
</select>
|
||||
<select id="selectTableXml" resultType="com.muyu.system.domain.vo.TableVo">
|
||||
SELECT *
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = #{database} and table_name = #{tableName};
|
||||
</select>
|
||||
<select id="database" resultType="java.lang.String">
|
||||
select database()
|
||||
</select>
|
||||
<select id="tableNameList2" resultType="java.lang.String">
|
||||
SHOW TABLES
|
||||
</select>
|
||||
<select id="getNameSelTable" resultType="java.lang.Integer">
|
||||
select count(table_name)
|
||||
from table_name where table_name = #{s};
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,109 @@
|
|||
<?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.muyu.system.mapper.AssetModelMapper">
|
||||
|
||||
<resultMap type="com.muyu.system.domain.AssetModel" id="AssetModelResult">
|
||||
<result property="name" column="name" />
|
||||
<result property="annotation" column="annotation" />
|
||||
<result property="key" column="key" />
|
||||
<result property="type" column="type" />
|
||||
<result property="mappingType" column="mapping_type" />
|
||||
<result property="length" column="length" />
|
||||
<result property="decimalPlace" column="decimal_place" />
|
||||
<result property="nullNot" column="null_not" />
|
||||
<result property="defaultValue" column="default_value" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAssetModelVo">
|
||||
select name, annotation, key, type, mapping_type, length, decimal_place, null_not, default_value from asset_model
|
||||
</sql>
|
||||
|
||||
<select id="selectAssetModelList" parameterType="com.muyu.system.domain.AssetModel" resultMap="AssetModelResult">
|
||||
<include refid="selectAssetModelVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="annotation != null and annotation != ''"> and annotation = #{annotation}</if>
|
||||
<if test="key != null and key != ''"> and key = #{key}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="mappingType != null and mappingType != ''"> and mapping_type = #{mappingType}</if>
|
||||
<if test="length != null "> and length = #{length}</if>
|
||||
<if test="decimalPlace != null "> and decimal_place = #{decimalPlace}</if>
|
||||
<if test="nullNot != null and nullNot != ''"> and null_not = #{nullNot}</if>
|
||||
<if test="defaultValue != null and defaultValue != ''"> and default_value = #{defaultValue}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAssetModelByAnnotation" parameterType="String" resultMap="AssetModelResult">
|
||||
<include refid="selectAssetModelVo"/>
|
||||
where annotation = #{annotation}
|
||||
</select>
|
||||
|
||||
<select id="database" resultType="java.lang.String">
|
||||
select database()
|
||||
</select>
|
||||
<select id="selectTable" resultType="com.muyu.system.domain.vo.TableVo">
|
||||
SELECT *
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = #{database} and table_name = #{libraryName};
|
||||
</select>
|
||||
<select id="library" resultType="java.lang.String">
|
||||
SHOW TABLES;
|
||||
</select>
|
||||
<select id="library2" resultType="com.muyu.system.domain.Library">
|
||||
SHOW TABLES
|
||||
</select>
|
||||
|
||||
<insert id="insertAssetModel" parameterType="com.muyu.system.domain.AssetModel">
|
||||
insert into asset_model
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="annotation != null">annotation,</if>
|
||||
<if test="key != null and key != ''">key,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="mappingType != null and mappingType != ''">mapping_type,</if>
|
||||
<if test="length != null">length,</if>
|
||||
<if test="decimalPlace != null">decimal_place,</if>
|
||||
<if test="nullNot != null and nullNot != ''">null_not,</if>
|
||||
<if test="defaultValue != null">default_value,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="annotation != null">#{annotation},</if>
|
||||
<if test="key != null and key != ''">#{key},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="mappingType != null and mappingType != ''">#{mappingType},</if>
|
||||
<if test="length != null">#{length},</if>
|
||||
<if test="decimalPlace != null">#{decimalPlace},</if>
|
||||
<if test="nullNot != null and nullNot != ''">#{nullNot},</if>
|
||||
<if test="defaultValue != null">#{defaultValue},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAssetModel" parameterType="com.muyu.system.domain.AssetModel">
|
||||
update asset_model
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="key != null and key != ''">key = #{key},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="mappingType != null and mappingType != ''">mapping_type = #{mappingType},</if>
|
||||
<if test="length != null">length = #{length},</if>
|
||||
<if test="decimalPlace != null">decimal_place = #{decimalPlace},</if>
|
||||
<if test="nullNot != null and nullNot != ''">null_not = #{nullNot},</if>
|
||||
<if test="defaultValue != null">default_value = #{defaultValue},</if>
|
||||
</trim>
|
||||
where annotation = #{annotation}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAssetModelByAnnotation" parameterType="String">
|
||||
delete from asset_model where annotation = #{annotation}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAssetModelByAnnotations" parameterType="String">
|
||||
delete from asset_model where annotation in
|
||||
<foreach item="annotation" collection="array" open="(" separator="," close=")">
|
||||
#{annotation}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,114 @@
|
|||
<?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.muyu.system.mapper.DataAccessMapper">
|
||||
|
||||
<resultMap type="com.muyu.system.domain.DataAccess" id="DataAccessResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="systemName" column="systemName" />
|
||||
<result property="type" column="type" />
|
||||
<result property="host" column="host" />
|
||||
<result property="port" column="port" />
|
||||
<result property="databaseName" column="databaseName" />
|
||||
<result property="connectionParam" column="connectionParam" />
|
||||
<result property="initNum" column="initNum" />
|
||||
<result property="maxNum" column="maxNum" />
|
||||
<result property="maxWaitTime" column="maxWaitTime" />
|
||||
<result property="maxWaitSize" column="maxWaitSize" />
|
||||
<result property="intor" column="intor" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDataAccessVo">
|
||||
select id, name, systemName, type, host, port, databaseName, connectionParam, initNum, maxNum, maxWaitTime, maxWaitSize, intor from data_access
|
||||
</sql>
|
||||
|
||||
<select id="selectDataAccessList" parameterType="com.muyu.system.domain.DataAccess" resultMap="DataAccessResult">
|
||||
<include refid="selectDataAccessVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="systemName != null and systemName != ''"> and systemName like concat('%', #{systemName}, '%')</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="host != null and host != ''"> and host = #{host}</if>
|
||||
<if test="port != null and port != ''"> and port = #{port}</if>
|
||||
<if test="databaseName != null and databaseName != ''"> and databaseName like concat('%', #{databaseName}, '%')</if>
|
||||
<if test="connectionParam != null and connectionParam != ''"> and connectionParam = #{connectionParam}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDataAccessById" parameterType="Long" resultMap="DataAccessResult">
|
||||
<include refid="selectDataAccessVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="oneDataAccess" resultType="com.muyu.system.domain.DataAccess">
|
||||
<include refid="selectDataAccessVo"/>
|
||||
order by id desc limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDataAccess" parameterType="com.muyu.system.domain.DataAccess" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into data_access
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="systemName != null and systemName != ''">systemName,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="host != null and host != ''">host,</if>
|
||||
<if test="port != null and port != ''">port,</if>
|
||||
<if test="databaseName != null and databaseName != ''">databaseName,</if>
|
||||
<if test="connectionParam != null and connectionParam != ''">connectionParam,</if>
|
||||
<if test="initNum != null">initNum,</if>
|
||||
<if test="maxNum != null">maxNum,</if>
|
||||
<if test="maxWaitTime != null">maxWaitTime,</if>
|
||||
<if test="maxWaitSize != null">maxWaitSize,</if>
|
||||
<if test="intor != null">intor,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="systemName != null and systemName != ''">#{systemName},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="host != null and host != ''">#{host},</if>
|
||||
<if test="port != null and port != ''">#{port},</if>
|
||||
<if test="databaseName != null and databaseName != ''">#{databaseName},</if>
|
||||
<if test="connectionParam != null and connectionParam != ''">#{connectionParam},</if>
|
||||
<if test="initNum != null">#{initNum},</if>
|
||||
<if test="maxNum != null">#{maxNum},</if>
|
||||
<if test="maxWaitTime != null">#{maxWaitTime},</if>
|
||||
<if test="maxWaitSize != null">#{maxWaitSize},</if>
|
||||
<if test="intor != null">#{intor},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertMiddle">
|
||||
insert into middle (id,dept_id,status_id)
|
||||
values (#{id},#{deptId},0);
|
||||
</insert>
|
||||
|
||||
<update id="updateDataAccess" parameterType="com.muyu.system.domain.DataAccess">
|
||||
update data_access
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="systemName != null and systemName != ''">systemName = #{systemName},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="host != null and host != ''">host = #{host},</if>
|
||||
<if test="port != null and port != ''">port = #{port},</if>
|
||||
<if test="databaseName != null and databaseName != ''">databaseName = #{databaseName},</if>
|
||||
<if test="connectionParam != null and connectionParam != ''">connectionParam = #{connectionParam},</if>
|
||||
<if test="initNum != null">initNum = #{initNum},</if>
|
||||
<if test="maxNum != null">maxNum = #{maxNum},</if>
|
||||
<if test="maxWaitTime != null">maxWaitTime = #{maxWaitTime},</if>
|
||||
<if test="maxWaitSize != null">maxWaitSize = #{maxWaitSize},</if>
|
||||
<if test="intor != null">intor = #{intor},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDataAccessById" parameterType="Long">
|
||||
delete from data_access where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDataAccessByIds" parameterType="String">
|
||||
delete from data_access where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,116 @@
|
|||
<?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.muyu.system.mapper.DataSourceMapper">
|
||||
|
||||
<resultMap type="com.muyu.system.domain.DataSource" id="DataSourceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="dataSourceName" column="data_source_name" />
|
||||
<result property="dataSourceSystemName" column="data_source_system_name" />
|
||||
<result property="databaseType" column="database_type" />
|
||||
<result property="ip" column="ip" />
|
||||
<result property="port" column="port" />
|
||||
<result property="username" column="username" />
|
||||
<result property="password" column="password" />
|
||||
<result property="type" column="type" />
|
||||
<result property="connectionParameter" column="connection_parameter" />
|
||||
<result property="connectionConfig" column="connection_config" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDataSourceVo">
|
||||
select id, data_source_name, data_source_system_name, database_type, ip, port, username, password, type, connection_parameter, connection_config, status, create_by, create_time, update_by, update_time from data_source
|
||||
</sql>
|
||||
|
||||
<select id="selectDataSourceList" parameterType="com.muyu.system.domain.DataSource" resultMap="DataSourceResult">
|
||||
<include refid="selectDataSourceVo"/>
|
||||
<where>
|
||||
<if test="dataSourceName != null and dataSourceName != ''"> and data_source_name like concat('%', #{dataSourceName}, '%')</if>
|
||||
<if test="dataSourceSystemName != null and dataSourceSystemName != ''"> and data_source_system_name like concat('%', #{dataSourceSystemName}, '%')</if>
|
||||
<if test="databaseType != null "> and database_type = #{databaseType}</if>
|
||||
<if test="ip != null and ip != ''"> and ip = #{ip}</if>
|
||||
<if test="port != null and port != ''"> and port = #{port}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDataSourceById" parameterType="Long" resultMap="DataSourceResult">
|
||||
<include refid="selectDataSourceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDataSource" parameterType="com.muyu.system.domain.DataSource" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into data_source
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="dataSourceName != null and dataSourceName != ''">data_source_name,</if>
|
||||
<if test="dataSourceSystemName != null and dataSourceSystemName != ''">data_source_system_name,</if>
|
||||
<if test="databaseType != null">database_type,</if>
|
||||
<if test="ip != null and ip != ''">ip,</if>
|
||||
<if test="port != null and port != ''">port,</if>
|
||||
<if test="username != null and username != ''">username,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="connectionParameter != null">connection_parameter,</if>
|
||||
<if test="connectionConfig != null">connection_config,</if>
|
||||
<if test="status != null and status != ''">status,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dataSourceName != null and dataSourceName != ''">#{dataSourceName},</if>
|
||||
<if test="dataSourceSystemName != null and dataSourceSystemName != ''">#{dataSourceSystemName},</if>
|
||||
<if test="databaseType != null">#{databaseType},</if>
|
||||
<if test="ip != null and ip != ''">#{ip},</if>
|
||||
<if test="port != null and port != ''">#{port},</if>
|
||||
<if test="username != null and username != ''">#{username},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="connectionParameter != null">#{connectionParameter},</if>
|
||||
<if test="connectionConfig != null">#{connectionConfig},</if>
|
||||
<if test="status != null and status != ''">#{status},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDataSource" parameterType="com.muyu.system.domain.DataSource">
|
||||
update data_source
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="dataSourceName != null and dataSourceName != ''">data_source_name = #{dataSourceName},</if>
|
||||
<if test="dataSourceSystemName != null and dataSourceSystemName != ''">data_source_system_name = #{dataSourceSystemName},</if>
|
||||
<if test="databaseType != null">database_type = #{databaseType},</if>
|
||||
<if test="ip != null and ip != ''">ip = #{ip},</if>
|
||||
<if test="port != null and port != ''">port = #{port},</if>
|
||||
<if test="username != null and username != ''">username = #{username},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="connectionParameter != null">connection_parameter = #{connectionParameter},</if>
|
||||
<if test="connectionConfig != null">connection_config = #{connectionConfig},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDataSourceById" parameterType="Long">
|
||||
delete from data_source where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDataSourceByIds" parameterType="String">
|
||||
delete from data_source where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -38,6 +38,25 @@
|
|||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
<sql id="selectDeptVo2">
|
||||
select d.dept_id,
|
||||
d.parent_id,
|
||||
d.ancestors,
|
||||
d.dept_name,
|
||||
d.order_num,
|
||||
d.leader,
|
||||
d.phone,
|
||||
d.email,
|
||||
d.status,
|
||||
d.del_flag,
|
||||
d.create_by,
|
||||
d.create_time,
|
||||
m.mid,
|
||||
m.id,
|
||||
m.status_id
|
||||
from sys_dept d left join middle m on d.dept_id = m.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectDeptList" parameterType="com.muyu.common.system.domain.SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
|
@ -108,6 +127,12 @@
|
|||
<include refid="selectDeptVo"/>
|
||||
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
||||
</select>
|
||||
<select id="listDeptList" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
</select>
|
||||
<select id="selectDeptListVo" resultType="com.muyu.system.domain.vo.DeptVO">
|
||||
<include refid="selectDeptVo2"/>
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="com.muyu.common.system.domain.SysDept">
|
||||
insert into sys_dept(
|
||||
|
|
|
@ -81,6 +81,27 @@
|
|||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
</sql>
|
||||
<sql id="selectUserVo2">
|
||||
select u.user_id,
|
||||
u.dept_id,
|
||||
u.user_name,
|
||||
u.nick_name,
|
||||
u.email,
|
||||
u.avatar,
|
||||
u.phonenumber,
|
||||
u.password,
|
||||
u.sex,
|
||||
u.status,
|
||||
u.del_flag,
|
||||
u.login_ip,
|
||||
u.login_date,
|
||||
u.create_by,
|
||||
u.create_time,
|
||||
u.remark,
|
||||
d.dept_name
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="com.muyu.common.system.domain.SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status,
|
||||
|
@ -183,6 +204,9 @@
|
|||
and del_flag = '0'
|
||||
limit 1
|
||||
</select>
|
||||
<select id="listSelectSysUser" resultType="com.muyu.system.domain.vo.SysUserVo">
|
||||
<include refid="selectUserVo"></include>
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="com.muyu.common.system.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<module>muyu-gen</module>
|
||||
<module>muyu-job</module>
|
||||
<module>muyu-file</module>
|
||||
<module>muyu-goods</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>muyu-modules</artifactId>
|
||||
|
|
Loading…
Reference in New Issue