feat:增加了测试,部门查询+中间件,用户部门查询

dev-1
王熙朝 2024-04-23 08:51:24 +08:00
parent 5d31fea0eb
commit 72caf426a7
47 changed files with 3205 additions and 0 deletions

View File

@ -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>

View File

@ -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);
}
}

View File

@ -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));
}
}

View File

@ -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();
}
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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

View File

@ -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>

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -0,0 +1,8 @@
package com.muyu.system.domain;
import lombok.Data;
@Data
public class TableName {
private String tableName;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -2,6 +2,7 @@ package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.common.system.domain.SysDept; import com.muyu.common.system.domain.SysDept;
import com.muyu.system.domain.vo.DeptVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -128,4 +129,8 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
* @return * @return
*/ */
public int deleteDeptById (Long deptId); public int deleteDeptById (Long deptId);
List<SysDept> listDeptList();
List<DeptVO> selectDeptListVo();
} }

View File

@ -2,6 +2,7 @@ package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.common.system.domain.SysUser; import com.muyu.common.system.domain.SysUser;
import com.muyu.system.domain.vo.SysUserVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -139,4 +140,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
* @return * @return
*/ */
public SysUser checkEmailUnique (String email); public SysUser checkEmailUnique (String email);
List<SysUserVo> listSelectSysUser();
} }

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -2,6 +2,7 @@ package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.system.domain.SysDept; import com.muyu.common.system.domain.SysDept;
import com.muyu.system.domain.vo.DeptVO;
import com.muyu.system.domain.vo.TreeSelect; import com.muyu.system.domain.vo.TreeSelect;
import java.util.List; import java.util.List;
@ -135,4 +136,12 @@ public interface SysDeptService extends IService<SysDept> {
* @return * @return
*/ */
public int deleteDeptById (Long deptId); public int deleteDeptById (Long deptId);
/**
*
*
* @param dept
*
* @return
*/
List<DeptVO> selectDeptListVo();
} }

View File

@ -2,6 +2,7 @@ package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.system.domain.SysUser; import com.muyu.common.system.domain.SysUser;
import com.muyu.system.domain.vo.SysUserVo;
import java.util.List; import java.util.List;
@ -225,4 +226,6 @@ public interface SysUserService extends IService<SysUser> {
* @return * @return
*/ */
public String importUser (List<SysUser> userList, Boolean isUpdateSupport, String operName); public String importUser (List<SysUser> userList, Boolean isUpdateSupport, String operName);
List<SysUserVo> listSelectSysUser();
} }

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -11,6 +11,7 @@ import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.common.system.domain.SysDept; import com.muyu.common.system.domain.SysDept;
import com.muyu.common.system.domain.SysRole; import com.muyu.common.system.domain.SysRole;
import com.muyu.common.system.domain.SysUser; 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.domain.vo.TreeSelect;
import com.muyu.system.mapper.SysDeptMapper; import com.muyu.system.mapper.SysDeptMapper;
import com.muyu.system.mapper.SysRoleMapper; import com.muyu.system.mapper.SysRoleMapper;
@ -279,6 +280,17 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
public int deleteDeptById (Long deptId) { public int deleteDeptById (Long deptId) {
return deptMapper.deleteDeptById(deptId); return deptMapper.deleteDeptById(deptId);
} }
/**
*
*
* @param dept
*
* @return
*/
@Override
public List<DeptVO> selectDeptListVo() {
return deptMapper.selectDeptListVo();
}
/** /**
* *

View File

@ -13,6 +13,7 @@ import com.muyu.common.system.domain.SysUser;
import com.muyu.system.domain.SysPost; import com.muyu.system.domain.SysPost;
import com.muyu.system.domain.SysUserPost; import com.muyu.system.domain.SysUserPost;
import com.muyu.system.domain.SysUserRole; import com.muyu.system.domain.SysUserRole;
import com.muyu.system.domain.vo.SysUserVo;
import com.muyu.system.mapper.*; import com.muyu.system.mapper.*;
import com.muyu.system.service.SysUserService; import com.muyu.system.service.SysUserService;
import com.muyu.system.service.SysConfigService; import com.muyu.system.service.SysConfigService;
@ -500,4 +501,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return successMsg.toString(); return successMsg.toString();
} }
@Override
public List<SysUserVo> listSelectSysUser() {
return userMapper.listSelectSysUser();
}
} }

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -38,6 +38,25 @@
from sys_dept d from sys_dept d
</sql> </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"> <select id="selectDeptList" parameterType="com.muyu.common.system.domain.SysDept" resultMap="SysDeptResult">
<include refid="selectDeptVo"/> <include refid="selectDeptVo"/>
where d.del_flag = '0' where d.del_flag = '0'
@ -108,6 +127,12 @@
<include refid="selectDeptVo"/> <include refid="selectDeptVo"/>
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
</select> </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 id="insertDept" parameterType="com.muyu.common.system.domain.SysDept">
insert into sys_dept( insert into sys_dept(

View File

@ -81,6 +81,27 @@
left join sys_user_role ur on u.user_id = ur.user_id 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 left join sys_role r on r.role_id = ur.role_id
</sql> </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 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, 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' and del_flag = '0'
limit 1 limit 1
</select> </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 id="insertUser" parameterType="com.muyu.common.system.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user( insert into sys_user(

View File

@ -13,6 +13,7 @@
<module>muyu-gen</module> <module>muyu-gen</module>
<module>muyu-job</module> <module>muyu-job</module>
<module>muyu-file</module> <module>muyu-file</module>
<module>muyu-goods</module>
</modules> </modules>
<artifactId>muyu-modules</artifactId> <artifactId>muyu-modules</artifactId>