数据库连接
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
*.class
|
||||
**/target
|
||||
.idea
|
||||
logs
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 配置部分
|
||||
BASE_PATH=/root/ks
|
||||
DES_PATH=/root/ks
|
||||
BASE_PATH=/root/shz
|
||||
DES_PATH=/root/shz
|
||||
JAR_PATH=${DES_PATH}/ruoyi-admin/target/ruoyi-admin.jar
|
||||
LOG_PATH=${DES_PATH}/logs
|
||||
LOG_FILE=${LOG_PATH}/backend.log
|
||||
@@ -136,9 +136,9 @@ main() {
|
||||
|
||||
# 获取最新代码
|
||||
__green "拉取最新代码..."
|
||||
git --git-dir=${BASE_PATH}/.git --work-tree=${BASE_PATH} fetch origin main
|
||||
git --git-dir=${BASE_PATH}/.git --work-tree=${BASE_PATH} reset --hard origin/main
|
||||
git --git-dir=${BASE_PATH}/.git --work-tree=${BASE_PATH} pull origin main
|
||||
git --git-dir=${BASE_PATH}/.git --work-tree=${BASE_PATH} fetch origin master
|
||||
git --git-dir=${BASE_PATH}/.git --work-tree=${BASE_PATH} reset --hard origin/master
|
||||
git --git-dir=${BASE_PATH}/.git --work-tree=${BASE_PATH} pull origin master
|
||||
|
||||
# 构建项目
|
||||
__green "开始构建项目..."
|
||||
|
||||
@@ -6,10 +6,10 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:highgo://127.0.0.1:5866/highgo?useUnicode=true&characterEncoding=utf8¤tSchema=ks_db4&stringtype=unspecified
|
||||
url: jdbc:highgo://192.168.0.13:5866/highgo?useUnicode=true&characterEncoding=utf8¤tSchema=shz&stringtype=unspecified
|
||||
#username: syssso
|
||||
username: sysdba
|
||||
password: ZKR2024@comzkr
|
||||
password: SHZ2025@comzkr
|
||||
|
||||
# 从库数据源
|
||||
slave:
|
||||
@@ -65,11 +65,11 @@ spring:
|
||||
# 地址
|
||||
host: 127.0.0.1
|
||||
# 端口,默认为6379
|
||||
port: 5379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 5
|
||||
database: 0
|
||||
# 密码
|
||||
password: ZKR2024@@.com
|
||||
password: SHZ2025@@.com
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
@@ -93,4 +93,4 @@ easy-es:
|
||||
db-config:
|
||||
refresh-policy: immediate
|
||||
username: elastic
|
||||
password: zkr2024@@.com
|
||||
password: shz2025@@.com
|
||||
@@ -6,7 +6,7 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:highgo://124.243.245.42:5866/highgo?useUnicode=true&characterEncoding=utf8¤tSchema=ks_db4&stringtype=unspecified
|
||||
url: jdbc:highgo://124.243.245.42:5866/highgo?useUnicode=true&characterEncoding=utf8¤tSchema=shz&stringtype=unspecified
|
||||
username: sysdba
|
||||
password: ZKR2024@comzkr
|
||||
# 从库数据源
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="/home/lapuda/logs" />
|
||||
<property name="log.path" value="./logs" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.cms.controller.cms;
|
||||
|
||||
|
||||
import com.ruoyi.cms.service.SysAreaService;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysArea;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* 地区层级表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2025-11-10 15:56:00
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cms/dict/sysarea")
|
||||
@Anonymous
|
||||
public class SysAreaController {
|
||||
|
||||
@Autowired
|
||||
private SysAreaService sysAreaService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult jobCategory(SysArea sysArea){
|
||||
return AjaxResult.success(sysAreaService.getList(sysArea));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.ruoyi.cms.mapper;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysArea;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 地区层级表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2025-11-10 15:56:00
|
||||
*/
|
||||
public interface SysAreaMapper{
|
||||
|
||||
List<SysArea> getList(SysArea sysArea);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ruoyi.cms.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysArea;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 地区层级表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2025-11-10 15:56:00
|
||||
*/
|
||||
public interface SysAreaService{
|
||||
|
||||
List<SysArea> getList(SysArea sysArea);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import com.ruoyi.cms.mapper.SysAreaMapper;
|
||||
import com.ruoyi.cms.service.SysAreaService;
|
||||
import com.ruoyi.common.core.domain.entity.SysArea;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SysAreaServiceImpl implements SysAreaService {
|
||||
|
||||
@Autowired
|
||||
SysAreaMapper sysAreaMapper;
|
||||
|
||||
public List<SysArea> getList(SysArea sysArea){
|
||||
return sysAreaMapper.getList(sysArea);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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.ruoyi.cms.mapper.SysAreaMapper">
|
||||
|
||||
<sql id="selectAreaVo">
|
||||
select id, code, name, parent_code, del_flag, create_by, create_time, update_by, update_time, remark from sys_area
|
||||
</sql>
|
||||
|
||||
<select id="getList" resultType="com.ruoyi.common.core.domain.entity.SysArea" parameterType="com.ruoyi.common.core.domain.entity.SysArea">
|
||||
<include refid="selectAreaVo"/>
|
||||
<where> del_flag = '0'
|
||||
<if test="name != null and name != ''"> and name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
|
||||
<if test="code != null and code != ''"> and code =#{code}</if>
|
||||
<choose>
|
||||
<when test="parentCode != null and parentCode != ''">
|
||||
and parent_code =#{parentCode}
|
||||
</when>
|
||||
<otherwise>
|
||||
and parent_code is null
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
order by code
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.ruoyi.common.core.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 地区层级表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2025-11-10 15:56:00
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_area")
|
||||
public class SysArea extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 地区编码(唯一)
|
||||
*/
|
||||
@ApiModelProperty("地区编码(唯一)")
|
||||
private String code;
|
||||
/**
|
||||
* 地区名称
|
||||
*/
|
||||
@ApiModelProperty("地区名称")
|
||||
private String name;
|
||||
/**
|
||||
* 父级地区编码(顶级为NULL)
|
||||
*/
|
||||
@ApiModelProperty("父级地区编码(顶级为NULL)")
|
||||
private String parentCode;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user