项目适配瀚高

This commit is contained in:
2025-12-25 19:20:05 +08:00
parent ceae2f0039
commit d12617f2a6
36 changed files with 590 additions and 404 deletions

View File

@@ -43,10 +43,12 @@
<scope>test</scope>
</dependency>
<!-- Mysql驱动 -->
<!-- 翰高 JDBC 驱动 -->
<!-- https://mvnrepository.com/artifact/com.highgo/HgdbJdbc -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<groupId>com.highgo</groupId>
<artifactId>HgdbJdbc</artifactId>
<version>6.2.4</version>
</dependency>
<!-- 核心模块-->

View File

@@ -1,7 +1,7 @@
package com.ltgk.smartFishingPort.web.controller.common;
import com.google.code.kaptcha.Producer;
import com.ltgk.smartFishingPort.common.config.RuoYiConfig;
import com.ltgk.smartFishingPort.common.config.SmartFishingPortConfig;
import com.ltgk.smartFishingPort.common.constant.CacheConstants;
import com.ltgk.smartFishingPort.common.constant.Constants;
import com.ltgk.smartFishingPort.common.core.domain.AjaxResult;
@@ -40,7 +40,7 @@ public class CaptchaController
@Autowired
private ISysConfigService configService;
/**
/*
* 生成验证码
*/
@GetMapping("/captchaImage")
@@ -62,7 +62,7 @@ public class CaptchaController
BufferedImage image = null;
// 生成验证码
String captchaType = RuoYiConfig.getCaptchaType();
String captchaType = SmartFishingPortConfig.getCaptchaType();
if ("math".equals(captchaType))
{
String capText = captchaProducerMath.createText();

View File

@@ -1,6 +1,6 @@
package com.ltgk.smartFishingPort.web.controller.common;
import com.ltgk.smartFishingPort.common.config.RuoYiConfig;
import com.ltgk.smartFishingPort.common.config.SmartFishingPortConfig;
import com.ltgk.smartFishingPort.common.core.domain.AjaxResult;
import com.ltgk.smartFishingPort.common.utils.StringUtils;
import com.ltgk.smartFishingPort.common.utils.file.FileUploadUtils;
@@ -53,7 +53,7 @@ public class CommonController
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
}
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
String filePath = RuoYiConfig.getDownloadPath() + fileName;
String filePath = SmartFishingPortConfig.getDownloadPath() + fileName;
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, realFileName);
@@ -78,7 +78,7 @@ public class CommonController
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
String filePath = SmartFishingPortConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
@@ -104,7 +104,7 @@ public class CommonController
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
String filePath = SmartFishingPortConfig.getUploadPath();
List<String> urls = new ArrayList<String>();
List<String> fileNames = new ArrayList<String>();
List<String> newFileNames = new ArrayList<String>();
@@ -146,7 +146,7 @@ public class CommonController
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
}
// 本地资源路径
String localPath = RuoYiConfig.getProfile();
String localPath = SmartFishingPortConfig.getProfile();
// 数据库资源地址
String downloadPath = localPath + FileUtils.stripPrefix(resource);
// 下载名称

View File

@@ -1,6 +1,6 @@
package com.ltgk.smartFishingPort.web.controller.system;
import com.ltgk.smartFishingPort.common.config.RuoYiConfig;
import com.ltgk.smartFishingPort.common.config.SmartFishingPortConfig;
import com.ltgk.smartFishingPort.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -16,7 +16,7 @@ public class SysIndexController
{
/** 系统基础配置 */
@Autowired
private RuoYiConfig ruoyiConfig;
private SmartFishingPortConfig ruoyiConfig;
/**
* 访问首页,提示语

View File

@@ -1,7 +1,7 @@
package com.ltgk.smartFishingPort.web.controller.system;
import com.ltgk.smartFishingPort.common.annotation.Log;
import com.ltgk.smartFishingPort.common.config.RuoYiConfig;
import com.ltgk.smartFishingPort.common.config.SmartFishingPortConfig;
import com.ltgk.smartFishingPort.common.core.controller.BaseController;
import com.ltgk.smartFishingPort.common.core.domain.AjaxResult;
import com.ltgk.smartFishingPort.common.core.domain.entity.SysUser;
@@ -123,13 +123,13 @@ public class SysProfileController extends BaseController
if (!file.isEmpty())
{
LoginUser loginUser = getLoginUser();
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION, true);
String avatar = FileUploadUtils.upload(SmartFishingPortConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION, true);
if (userService.updateUserAvatar(loginUser.getUserId(), avatar))
{
String oldAvatar = loginUser.getUser().getAvatar();
if (StringUtils.isNotEmpty(oldAvatar))
{
FileUtils.deleteFile(RuoYiConfig.getProfile() + FileUtils.stripPrefix(oldAvatar));
FileUtils.deleteFile(SmartFishingPortConfig.getProfile() + FileUtils.stripPrefix(oldAvatar));
}
AjaxResult ajax = AjaxResult.success();
ajax.put("imgUrl", avatar);

View File

@@ -1,6 +1,6 @@
package com.ltgk.smartFishingPort.web.core.config;
import com.ltgk.smartFishingPort.common.config.RuoYiConfig;
import com.ltgk.smartFishingPort.common.config.SmartFishingPortConfig;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
@@ -28,7 +28,7 @@ public class SwaggerConfig
{
/** 系统基础配置 */
@Autowired
private RuoYiConfig ruoyiConfig;
private SmartFishingPortConfig ruoyiConfig;
/** 是否开启swagger */
@Value("${swagger.enabled}")

View File

@@ -13,7 +13,7 @@ spring:
# username: root
# password: password
master:
url: jdbc:mysql://119.167.138.11:3306/smart_fishing_port?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://119.167.138.11:3306/kechuang_erqi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: ltgk
password: litugaoke01!
# 从库数据源

View File

@@ -0,0 +1,108 @@
# 数据源配置
spring:
data:
solr:
host: http://198.16.74.212:8983/solr
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.highgo.jdbc.Driver # 翰高驱动(或 org.postgresql.Driver
druid:
# 主库数据源
master:
url: jdbc:highgo://198.16.74.212:5866/haishiju?currentSchema=public # 端口5866指定schema
username: kechuang # 翰高用户名
password: Litugaoke01! # 翰高密码d
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置连接超时时间
connectTimeout: 30000
# 配置网络超时时间
socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
url:
picFile: http://198.16.74.209:6060
sdk:
loginDHUrl: http://192.168.1.18:6450/dhsdk/rest/sdk/init
attachTrafficDHUrl: http://192.168.1.18:6450/dhsdk/rest/sdk/attachTraffic
attachAlarmChanDHByAccountUrl: http://localhost:6450/dhsdk/rest/sdk/attachAlarmChanByAccount
attachAlarmChanHKByAccountUrl: http://localhost:6350/hksdk/rest/sdk/attachAlarmChanByAccount
hk:
getPtzCfgUrl: http://198.16.74.211:6350/hksdk/rest/sdk/getPtzCfg
setPtzCfgUrl: http://198.16.74.211:6350/hksdk/rest/sdk/setPtzCfg
setupAlarmChanUrl: http://198.16.74.211:6350/hksdk/rest/sdk/setupAlarmChan
file:
base: /file
image: /file/image
kml: /files/kml/
sysLog:
logFilePath: file/log/ # 系统操作日志备份文件夹
path:
rootPath: file/ # 文件存储的跟路径,绝对路径-直接使用,相对路径-项目运行目录下
filePattern: YYYY-MM/ # 存储目录的格式,日期格式YYYYMMddHHmmss,按照日期格式化来进行,为根目录下的一级
mysqlhome: J://MYSQL5.7//bin//
sql: ${server.servlet.context-path}/file/sql
#数据库备份时间间隔
database:
backup:
interval: 3 # 单位天
jwt:
tokenKey: Auth
duration: 18000
drone:
url: http://198.16.74.210:30812/openapi/v0.1/
key: eyJhbGciOiJIUzUxMiIsImNyaXQiOlsidHlwIiwiYWxnIiwia2lkIl0sImtpZCI6IjU3YmQyNmEwLTYyMDktNGE5My1hNjg4LWY4NzUyYmU1ZDE5MSIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiIiwiZXhwIjoyMDc1OTQ3NzIyLCJuYmYiOjE3NjA0MTQ5MjIsIm9yZ2FuaXphdGlvbl91dWlkIjoiOWRmMjlmYTgtNGI5OS00MThlLWJhMmQtMGY5ZWY5ZWVlMzkyIiwicHJvamVjdF91dWlkIjoiIiwic3ViIjoiZmgyIiwidXNlcl9pZCI6IjE3NjA0MTQxMDkzNTcwMDI0MjkifQ.DC_aS37W2fkqOjCtfvysDfhTn-4XVn3_IrXBnPD9rICGyrIBKBG3oPldeW_pqele5H_gCn1EgM0KXcbDgvq-dw
url2: http://198.16.74.210:30812/openapi/v0.9/
url3: http://198.16.74.210:63302/
rocketmq:
name-server: 198.16.74.211:9876
producer:
group: collect
topic: point-topic
# 温州大致范围
geoJson: 119.6203422546387,27.68292003880313;119.800415040,27.962869020;119.948730470,27.999251730;120.132751460,27.999251730;120.305786130,28.011376570;120.375137330,28.144659670;120.337371830,28.336417060;120.321578980,28.378110320;120.312652590,28.425825960;120.336685180,28.440921370;120.4183960,28.574271040;120.443801880,28.592962710;120.490493770,28.58874230;120.568771360,28.547132060;120.628509520,28.584521720;120.701293950,28.619487110;120.747299190,28.62069260;120.797424320,28.596580060;120.957412720,28.520589410;121.098175050,28.544719370;121.168212890,28.518779440;121.259536740,28.41072840;121.242657720,28.38772010;121.222457890,28.374787540;121.214561460,28.349410190;121.210098270,28.325840080;121.202459340,28.273166160;121.153106690,28.266287160;121.149673460,28.214869550;121.139373780,28.153741130;121.058349610,28.038652480;121.127700810,28.013195180;121.260223390,27.99682660;121.198425290,27.827842780;121.18194580,27.72486720;121.254730220,27.610538530;121.140747070,27.414442970;120.886688230,27.004078760;120.40191650,27.137368360;120.252227780,27.372986830;120.0503540,27.315654240;119.766082760,27.286366590;119.6733856201172,27.43455578758766;119.6150207519531,27.59350062636446;119.6126174926758,27.63396131658914;119.6151924133301,27.65935568886939;119.6203422546387,27.68292003880313

View File

@@ -1,5 +1,5 @@
# 项目相关配置
smartFishingPort:
smart-fishing-port:
# 名称
name: SmartFishingPort
# 版本
@@ -19,7 +19,7 @@ server:
port: 6061
servlet:
# 应用的访问路径
context-path: /
context-path: /api
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
@@ -36,6 +36,10 @@ logging:
level:
com.ltgk.smartFishingPort: debug
org.springframework: warn
# SolrJ 核心请求日志打印完整请求URL和参数
org.apache.solr.client.solrj.impl.HttpSolrClient: DEBUG
# Spring Data Solr 核心日志(可选,打印构建的查询对象)
org.springframework.data.solr.core: DEBUG
# 用户配置
user:
@@ -52,7 +56,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: druid
active: highgoprod
# 文件上传
servlet:
multipart:
@@ -68,11 +72,11 @@ spring:
# redis 配置
redis:
# 地址
host: 119.167.138.11
host: 198.16.74.211
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
database: 1
# 密码
password: litugaoke01!
# 连接超时时间
@@ -117,7 +121,7 @@ swagger:
# 是否开启swagger
enabled: true
# 请求前缀
pathMapping: /dev-api
pathMapping: /api
# 防盗链配置
referer:

View File

@@ -1,31 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/home/smartFishingPortApplication/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" />
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
@@ -33,16 +33,16 @@
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
@@ -50,16 +50,16 @@
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 用户访问日志输出 -->
<!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-user.log</file>
<file>${log.path}/sys-user.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
@@ -70,23 +70,23 @@
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.ltgk.smartFishingPort" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<!-- 系统模块日志级别控制 -->
<logger name="com.ltgk.smartFishingPort" level="info"/>
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn"/>
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
<appender-ref ref="console"/>
</root>
<!--系统用户操作日志-->
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info"/>
<appender-ref ref="file_error"/>
</root>
<!--系统用户操作日志-->
<logger name="sys-user" level="info">
<appender-ref ref="sys-user"/>
</logger>

View File

@@ -9,8 +9,8 @@ import org.springframework.stereotype.Component;
* @author ltgk
*/
@Component
@ConfigurationProperties(prefix = "ruoyi")
public class RuoYiConfig
@ConfigurationProperties(prefix = "smart-fishing-port")
public class SmartFishingPortConfig
{
/** 项目名称 */
private String name;
@@ -67,7 +67,7 @@ public class RuoYiConfig
public void setProfile(String profile)
{
RuoYiConfig.profile = profile;
SmartFishingPortConfig.profile = profile;
}
public static boolean isAddressEnabled()
@@ -77,7 +77,7 @@ public class RuoYiConfig
public void setAddressEnabled(boolean addressEnabled)
{
RuoYiConfig.addressEnabled = addressEnabled;
SmartFishingPortConfig.addressEnabled = addressEnabled;
}
public static String getCaptchaType() {
@@ -85,7 +85,7 @@ public class RuoYiConfig
}
public void setCaptchaType(String captchaType) {
RuoYiConfig.captchaType = captchaType;
SmartFishingPortConfig.captchaType = captchaType;
}
/**

View File

@@ -1,6 +1,6 @@
package com.ltgk.smartFishingPort.common.utils.file;
import com.ltgk.smartFishingPort.common.config.RuoYiConfig;
import com.ltgk.smartFishingPort.common.config.SmartFishingPortConfig;
import com.ltgk.smartFishingPort.common.constant.Constants;
import com.ltgk.smartFishingPort.common.exception.file.FileNameLengthLimitExceededException;
import com.ltgk.smartFishingPort.common.exception.file.FileSizeLimitExceededException;
@@ -37,7 +37,7 @@ public class FileUploadUtils
/**
* 默认上传的地址
*/
private static String defaultBaseDir = RuoYiConfig.getProfile();
private static String defaultBaseDir = SmartFishingPortConfig.getProfile();
public static void setDefaultBaseDir(String defaultBaseDir)
{
@@ -171,7 +171,7 @@ public class FileUploadUtils
public static final String getPathFileName(String uploadDir, String fileName) throws IOException
{
int dirLastIndex = RuoYiConfig.getProfile().length() + 1;
int dirLastIndex = SmartFishingPortConfig.getProfile().length() + 1;
String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
}

View File

@@ -1,6 +1,6 @@
package com.ltgk.smartFishingPort.common.utils.file;
import com.ltgk.smartFishingPort.common.config.RuoYiConfig;
import com.ltgk.smartFishingPort.common.config.SmartFishingPortConfig;
import com.ltgk.smartFishingPort.common.constant.Constants;
import com.ltgk.smartFishingPort.common.utils.DateUtils;
import com.ltgk.smartFishingPort.common.utils.StringUtils;
@@ -69,7 +69,7 @@ public class FileUtils
*/
public static String writeImportBytes(byte[] data) throws IOException
{
return writeBytes(data, RuoYiConfig.getImportPath());
return writeBytes(data, SmartFishingPortConfig.getImportPath());
}
/**

View File

@@ -1,6 +1,6 @@
package com.ltgk.smartFishingPort.common.utils.file;
import com.ltgk.smartFishingPort.common.config.RuoYiConfig;
import com.ltgk.smartFishingPort.common.config.SmartFishingPortConfig;
import com.ltgk.smartFishingPort.common.constant.Constants;
import com.ltgk.smartFishingPort.common.utils.StringUtils;
import org.apache.poi.util.IOUtils;
@@ -80,7 +80,7 @@ public class ImageUtils
else
{
// 本机地址
String localPath = RuoYiConfig.getProfile();
String localPath = SmartFishingPortConfig.getProfile();
String downloadPath = localPath + StringUtils.substringAfter(url, Constants.RESOURCE_PREFIX);
in = new FileInputStream(downloadPath);
}

View File

@@ -2,7 +2,7 @@ package com.ltgk.smartFishingPort.common.utils.ip;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.ltgk.smartFishingPort.common.config.RuoYiConfig;
import com.ltgk.smartFishingPort.common.config.SmartFishingPortConfig;
import com.ltgk.smartFishingPort.common.constant.Constants;
import com.ltgk.smartFishingPort.common.utils.StringUtils;
import com.ltgk.smartFishingPort.common.utils.http.HttpUtils;
@@ -31,7 +31,7 @@ public class AddressUtils
{
return "内网IP";
}
if (RuoYiConfig.isAddressEnabled())
if (SmartFishingPortConfig.isAddressEnabled())
{
try
{

View File

@@ -4,7 +4,7 @@ import com.ltgk.smartFishingPort.common.annotation.Excel;
import com.ltgk.smartFishingPort.common.annotation.Excel.ColumnType;
import com.ltgk.smartFishingPort.common.annotation.Excel.Type;
import com.ltgk.smartFishingPort.common.annotation.Excels;
import com.ltgk.smartFishingPort.common.config.RuoYiConfig;
import com.ltgk.smartFishingPort.common.config.SmartFishingPortConfig;
import com.ltgk.smartFishingPort.common.core.domain.AjaxResult;
import com.ltgk.smartFishingPort.common.core.text.Convert;
import com.ltgk.smartFishingPort.common.exception.UtilException;
@@ -1438,7 +1438,7 @@ public class ExcelUtil<T>
*/
public String getAbsoluteFile(String filename)
{
String downloadPath = RuoYiConfig.getDownloadPath() + filename;
String downloadPath = SmartFishingPortConfig.getDownloadPath() + filename;
File desc = new File(downloadPath);
if (!desc.getParentFile().exists())
{

View File

@@ -1,6 +1,6 @@
package com.ltgk.smartFishingPort.framework.config;
import com.ltgk.smartFishingPort.common.config.RuoYiConfig;
import com.ltgk.smartFishingPort.common.config.SmartFishingPortConfig;
import com.ltgk.smartFishingPort.common.constant.Constants;
import com.ltgk.smartFishingPort.framework.interceptor.RepeatSubmitInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
@@ -32,7 +32,7 @@ public class ResourcesConfig implements WebMvcConfigurer
{
/** 本地文件上传路径 */
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**")
.addResourceLocations("file:" + RuoYiConfig.getProfile() + "/");
.addResourceLocations("file:" + SmartFishingPortConfig.getProfile() + "/");
/** swagger配置 */
registry.addResourceHandler("/swagger-ui/**")

View File

@@ -114,7 +114,6 @@ public class SecurityConfig
requests.antMatchers("/login", "/register", "/captchaImage").permitAll()
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated();
})

View File

@@ -3,14 +3,12 @@ package com.ltgk.smartFishingPort.controller;
import com.ltgk.smartFishingPort.common.core.controller.BaseController;
import com.ltgk.smartFishingPort.common.core.domain.AjaxResult;
import com.ltgk.smartFishingPort.domain.dto.FindAISPointPositionByMmsiReq;
import com.ltgk.smartFishingPort.service.ISolrService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -30,7 +28,7 @@ public class AisSolrController extends BaseController {
@ApiOperation(value = "根据mmsi获取 24H 轨迹信息")
@PostMapping("/findAISPointPositionByMmsi")
public AjaxResult findAISPointPositionByMmsi(@ApiParam("mmsi") @RequestParam("mmsi") String mmsi) {
return AjaxResult.success(solrService.findAISPointPositionByMmsi(mmsi));
public AjaxResult findAISPointPositionByMmsi(@RequestBody FindAISPointPositionByMmsiReq req) {
return AjaxResult.success(solrService.findAISPointPositionByMmsi(req.getMmsi()));
}
}

View File

@@ -0,0 +1,16 @@
package com.ltgk.smartFishingPort.domain.dto;
import lombok.Data;
/**
* 根据 mmsi 获取 24H 轨迹信息
*
* @author Qi ChengBin
* @date 2025/12/25
*/
@Data
public class FindAISPointPositionByMmsiReq {
private String mmsi;
}

View File

@@ -44,7 +44,7 @@ public class SolrServiceImpl implements ISolrService {
// 查询 24H 内的 mmsi 的数据
String now = DateUtil.formatDateTime(nowDate);
// 24小时之前的时间 before24HStr
String before24HStr = DateUtil.offsetHour(nowDate, -24).toString("yyyy-MM-dd HH:mm:ss");
String before24HStr = DateUtil.offsetHour(nowDate, -4).toString("yyyy-MM-dd HH:mm:ss");
// 查询 solr 获取相关的轨迹
Criteria criteria = new Criteria("terminalCode")

View File

@@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectConfigVo">
select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark
from sys_config
from haishiju.sys_config
</sql>
<!-- 查询条件 -->
@@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="insertConfig" parameterType="SysConfig">
insert into sys_config (
insert into sys_configsys_config (
<if test="configName != null and configName != '' ">config_name,</if>
<if test="configKey != null and configKey != '' ">config_key,</if>
<if test="configValue != null and configValue != '' ">config_value,</if>
@@ -90,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<update id="updateConfig" parameterType="SysConfig">
update sys_config
update sys_configsys_config
<set>
<if test="configName != null and configName != ''">config_name = #{configName},</if>
<if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
@@ -104,11 +104,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteConfigById" parameterType="Long">
delete from sys_config where config_id = #{configId}
delete from haishiju.sys_config where config_id = #{configId}
</delete>
<delete id="deleteConfigByIds" parameterType="Long">
delete from sys_config where config_id in
delete from haishiju.sys_config where config_id in
<foreach item="configId" collection="array" open="(" separator="," close=")">
#{configId}
</foreach>

View File

@@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectDeptVo">
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
from sys_dept d
from haishiju.sys_dept d
</sql>
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
@@ -49,37 +49,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDeptListByRoleId" resultType="Long">
select d.dept_id
from sys_dept d
left join sys_role_dept rd on d.dept_id = rd.dept_id
from haishiju.sys_dept d
left join haishiju.sys_role_dept rd on d.dept_id = rd.dept_id
where rd.role_id = #{roleId}
<if test="deptCheckStrictly">
and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
and d.dept_id not in (select d.parent_id from haishiju.sys_dept d inner join haishiju.sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
</if>
order by d.parent_id, d.order_num
</select>
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
from sys_dept d
(select dept_name from haishiju.sys_dept where dept_id = d.parent_id) parent_name
from haishiju.sys_dept d
where d.dept_id = #{deptId}
</select>
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
select count(1) from haishiju.sys_user where dept_id = #{deptId} and del_flag = '0'
</select>
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
select count(1) from sys_dept
select count(1) from haishiju.sys_dept
where del_flag = '0' and parent_id = #{deptId} limit 1
</select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
select * from sys_dept where find_in_set(#{deptId}, ancestors)
select * from haishiju.sys_dept where find_in_set(#{deptId}, ancestors)
</select>
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
select count(*) from haishiju.sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
</select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
@@ -88,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="insertDept" parameterType="SysDept">
insert into sys_dept(
insert into haishiju.sys_dept(
<if test="deptId != null and deptId != 0">dept_id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>
<if test="deptName != null and deptName != ''">dept_name,</if>
@@ -116,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<update id="updateDept" parameterType="SysDept">
update sys_dept
update haishiju.sys_dept
<set>
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
@@ -133,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<update id="updateDeptChildren" parameterType="java.util.List">
update sys_dept set ancestors =
update haishiju.sys_dept set ancestors =
<foreach collection="depts" item="item" index="index"
separator=" " open="case dept_id" close="end">
when #{item.deptId} then #{item.ancestors}
@@ -146,14 +146,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<update id="updateDeptStatusNormal" parameterType="Long">
update sys_dept set status = '0' where dept_id in
update haishiju.sys_dept set status = '0' where dept_id in
<foreach collection="array" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</update>
<delete id="deleteDeptById" parameterType="Long">
update sys_dept set del_flag = '2' where dept_id = #{deptId}
update haishiju.sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete>
</mapper>

View File

@@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectDictDataVo">
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
from sys_dict_data
from haishiju.sys_dict_data
</sql>
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
@@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectDictLabel" resultType="String">
select dict_label from sys_dict_data
select dict_label from haishiju.sys_dict_data
where dict_type = #{dictType} and dict_value = #{dictValue}
</select>
@@ -57,22 +57,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="countDictDataByType" resultType="Integer">
select count(1) from sys_dict_data where dict_type=#{dictType}
select count(1) from haishiju.sys_dict_data where dict_type=#{dictType}
</select>
<delete id="deleteDictDataById" parameterType="Long">
delete from sys_dict_data where dict_code = #{dictCode}
delete from haishiju.sys_dict_data where dict_code = #{dictCode}
</delete>
<delete id="deleteDictDataByIds" parameterType="Long">
delete from sys_dict_data where dict_code in
delete from haishiju.sys_dict_data where dict_code in
<foreach collection="array" item="dictCode" open="(" separator="," close=")">
#{dictCode}
</foreach>
</delete>
<update id="updateDictData" parameterType="SysDictData">
update sys_dict_data
update haishiju.sys_dict_data
<set>
<if test="dictSort != null">dict_sort = #{dictSort},</if>
<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
@@ -90,11 +90,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<update id="updateDictDataType" parameterType="String">
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
update haishiju.sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
</update>
<insert id="insertDictData" parameterType="SysDictData">
insert into sys_dict_data(
insert into haishiju.sys_dict_data(
<if test="dictSort != null">dict_sort,</if>
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
<if test="dictValue != null and dictValue != ''">dict_value,</if>

View File

@@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectDictTypeVo">
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
from sys_dict_type
from haishiju.sys_dict_type
</sql>
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
@@ -61,18 +61,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<delete id="deleteDictTypeById" parameterType="Long">
delete from sys_dict_type where dict_id = #{dictId}
delete from haishiju.sys_dict_type where dict_id = #{dictId}
</delete>
<delete id="deleteDictTypeByIds" parameterType="Long">
delete from sys_dict_type where dict_id in
delete from haishiju.sys_dict_type where dict_id in
<foreach collection="array" item="dictId" open="(" separator="," close=")">
#{dictId}
</foreach>
</delete>
<update id="updateDictType" parameterType="SysDictType">
update sys_dict_type
update haishiju.sys_dict_type
<set>
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
@@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<insert id="insertDictType" parameterType="SysDictType">
insert into sys_dict_type(
insert into haishiju.sys_dict_type(
<if test="dictName != null and dictName != ''">dict_name,</if>
<if test="dictType != null and dictType != ''">dict_type,</if>
<if test="status != null">status,</if>

View File

@@ -17,12 +17,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<insert id="insertLogininfor" parameterType="SysLogininfor">
insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
insert into haishiju.sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
</insert>
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from haishiju.sys_logininfor
<where>
<if test="ipaddr != null and ipaddr != ''">
AND ipaddr like concat('%', #{ipaddr}, '%')
@@ -44,14 +44,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<delete id="deleteLogininforByIds" parameterType="Long">
delete from sys_logininfor where info_id in
delete from haishiju.sys_logininfor where info_id in
<foreach collection="array" item="infoId" open="(" separator="," close=")">
#{infoId}
</foreach>
</delete>
<update id="cleanLogininfor">
truncate table sys_logininfor
truncate table haishiju.sys_logininfor
</update>
</mapper>

View File

@@ -1,206 +1,265 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ltgk.smartFishingPort.system.mapper.SysMenuMapper">
<resultMap type="SysMenu" id="SysMenuResult">
<id property="menuId" column="menu_id" />
<result property="menuName" column="menu_name" />
<result property="parentName" column="parent_name" />
<result property="parentId" column="parent_id" />
<result property="orderNum" column="order_num" />
<result property="path" column="path" />
<result property="component" column="component" />
<result property="query" column="query" />
<result property="routeName" column="route_name" />
<result property="isFrame" column="is_frame" />
<result property="isCache" column="is_cache" />
<result property="menuType" column="menu_type" />
<result property="visible" column="visible" />
<result property="status" column="status" />
<result property="perms" column="perms" />
<result property="icon" column="icon" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
</resultMap>
<resultMap type="SysMenu" id="SysMenuResult">
<id property="menuId" column="menu_id"/>
<result property="menuName" column="menu_name"/>
<result property="parentName" column="parent_name"/>
<result property="parentId" column="parent_id"/>
<result property="orderNum" column="order_num"/>
<result property="path" column="path"/>
<result property="component" column="component"/>
<result property="query" column="query"/>
<result property="routeName" column="route_name"/>
<result property="isFrame" column="is_frame"/>
<result property="isCache" column="is_cache"/>
<result property="menuType" column="menu_type"/>
<result property="visible" column="visible"/>
<result property="status" column="status"/>
<result property="perms" column="perms"/>
<result property="icon" column="icon"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectMenuVo">
select menu_id, menu_name, parent_id, order_num, path, component, `query`, route_name, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
from sys_menu
<sql id="selectMenuVo">
select menu_id,
menu_name,
parent_id,
order_num,
path,
component,
`query`,
route_name,
is_frame,
is_cache,
menu_type,
visible,
status,
coalesce(perms, '') as perms,
icon,
create_time
from haishiju.sys_menu
</sql>
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
<where>
<if test="menuName != null and menuName != ''">
AND menu_name like concat('%', #{menuName}, '%')
</if>
<if test="visible != null and visible != ''">
AND visible = #{visible}
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
</where>
order by parent_id, order_num
</select>
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
order by m.parent_id, m.order_num
</select>
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role ro on ur.role_id = ro.role_id
where ur.user_id = #{params.userId}
<if test="menuName != null and menuName != ''">
AND m.menu_name like concat('%', #{menuName}, '%')
</if>
<if test="visible != null and visible != ''">
AND m.visible = #{visible}
</if>
<if test="status != null and status != ''">
AND m.status = #{status}
</if>
order by m.parent_id, m.order_num
</select>
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role ro on ur.role_id = ro.role_id
left join sys_user u on ur.user_id = u.user_id
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
order by m.parent_id, m.order_num
</select>
<select id="selectMenuListByRoleId" resultType="Long">
select m.menu_id
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
where rm.role_id = #{roleId}
<if test="menuCheckStrictly">
and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
<include refid="selectMenuVo"/>
<where>
<if test="menuName != null and menuName != ''">
AND menu_name like concat('%', #{menuName}, '%')
</if>
order by m.parent_id, m.order_num
</select>
<select id="selectMenuPerms" resultType="String">
select distinct m.perms
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
</select>
<if test="visible != null and visible != ''">
AND visible = #{visible}
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
</where>
order by parent_id, order_num
</select>
<select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
select distinct m.perms
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role r on r.role_id = ur.role_id
where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
</select>
<select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String">
select distinct m.perms
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
where m.status = '0' and rm.role_id = #{roleId}
</select>
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where menu_id = #{menuId}
</select>
<select id="hasChildByMenuId" resultType="Integer">
select count(1) from sys_menu where parent_id = #{menuId}
</select>
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
</select>
<update id="updateMenu" parameterType="SysMenu">
update sys_menu
<set>
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="path != null and path != ''">path = #{path},</if>
<if test="component != null">component = #{component},</if>
<if test="query != null">`query` = #{query},</if>
<if test="routeName != null">route_name = #{routeName},</if>
<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
<if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
<if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
<if test="visible != null">visible = #{visible},</if>
<if test="status != null">status = #{status},</if>
<if test="perms !=null">perms = #{perms},</if>
<if test="icon !=null and icon != ''">icon = #{icon},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where menu_id = #{menuId}
</update>
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
select distinct m.menu_id,
m.parent_id,
m.menu_name,
m.path,
m.component,
m.`query`,
m.route_name,
m.visible,
m.status,
coalesce(m.perms, '') as perms,
m.is_frame,
m.is_cache,
m.menu_type,
m.icon,
m.order_num,
m.create_time
from haishiju.sys_menu m
where m.menu_type in ('M', 'C')
and m.status = '0'
order by m.parent_id, m.order_num
</select>
<insert id="insertMenu" parameterType="SysMenu">
insert into sys_menu(
<if test="menuId != null and menuId != 0">menu_id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>
<if test="menuName != null and menuName != ''">menu_name,</if>
<if test="orderNum != null">order_num,</if>
<if test="path != null and path != ''">path,</if>
<if test="component != null and component != ''">component,</if>
<if test="query != null and query != ''">`query`,</if>
<if test="routeName != null">route_name,</if>
<if test="isFrame != null and isFrame != ''">is_frame,</if>
<if test="isCache != null and isCache != ''">is_cache,</if>
<if test="menuType != null and menuType != ''">menu_type,</if>
<if test="visible != null">visible,</if>
<if test="status != null">status,</if>
<if test="perms !=null and perms != ''">perms,</if>
<if test="icon != null and icon != ''">icon,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="menuId != null and menuId != 0">#{menuId},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="menuName != null and menuName != ''">#{menuName},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="path != null and path != ''">#{path},</if>
<if test="component != null and component != ''">#{component},</if>
<if test="query != null and query != ''">#{query},</if>
<if test="routeName != null">#{routeName},</if>
<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
<if test="isCache != null and isCache != ''">#{isCache},</if>
<if test="menuType != null and menuType != ''">#{menuType},</if>
<if test="visible != null">#{visible},</if>
<if test="status != null">#{status},</if>
<if test="perms !=null and perms != ''">#{perms},</if>
<if test="icon != null and icon != ''">#{icon},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<delete id="deleteMenuById" parameterType="Long">
delete from sys_menu where menu_id = #{menuId}
</delete>
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible,
m.status, coalesce(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from haishiju.sys_menu m
left join haishiju.sys_role_menu rm on m.menu_id = rm.menu_id
left join haishiju.sys_user_role ur on rm.role_id = ur.role_id
left join haishiju.sys_role ro on ur.role_id = ro.role_id
where ur.user_id = #{params.userId}
<if test="menuName != null and menuName != ''">
AND m.menu_name like concat('%', #{menuName}, '%')
</if>
<if test="visible != null and visible != ''">
AND m.visible = #{visible}
</if>
<if test="status != null and status != ''">
AND m.status = #{status}
</if>
order by m.parent_id, m.order_num
</select>
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
select distinct m.menu_id,
m.parent_id,
m.menu_name,
m.path,
m.component,
m.`query`,
m.route_name,
m.visible,
m.status,
coalesce(m.perms, '') as perms,
m.is_frame,
m.is_cache,
m.menu_type,
m.icon,
m.order_num,
m.create_time
from haishiju.sys_menu m
left join haishiju.sys_role_menu rm on m.menu_id = rm.menu_id
left join haishiju.sys_user_role ur on rm.role_id = ur.role_id
left join haishiju.sys_role ro on ur.role_id = ro.role_id
left join haishiju.sys_user u on ur.user_id = u.user_id
where u.user_id = #{userId}
and m.menu_type in ('M', 'C')
and m.status = '0'
AND ro.status = '0'
order by m.parent_id, m.order_num
</select>
<select id="selectMenuListByRoleId" resultType="Long">
select m.menu_id
from haishiju.sys_menu m
left join haishiju.sys_role_menu rm on m.menu_id = rm.menu_id
where rm.role_id = #{roleId}
<if test="menuCheckStrictly">
and m.menu_id not in (select m.parent_id from haishiju.sys_menu m inner join haishiju.sys_role_menu rm on
m.menu_id = rm.menu_id and rm.role_id = #{roleId})
</if>
order by m.parent_id, m.order_num
</select>
<select id="selectMenuPerms" resultType="String">
select distinct m.perms
from haishiju.sys_menu m
left join haishiju.sys_role_menu rm on m.menu_id = rm.menu_id
left join haishiju.sys_user_role ur on rm.role_id = ur.role_id
</select>
<select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
select distinct m.perms
from haishiju.sys_menu m
left join haishiju.sys_role_menu rm on m.menu_id = rm.menu_id
left join haishiju.sys_user_role ur on rm.role_id = ur.role_id
left join haishiju.sys_role r on r.role_id = ur.role_id
where m.status = '0'
and r.status = '0'
and ur.user_id = #{userId}
</select>
<select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String">
select distinct m.perms
from haishiju.sys_menu m
left join haishiju.sys_role_menu rm on m.menu_id = rm.menu_id
where m.status = '0'
and rm.role_id = #{roleId}
</select>
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where menu_id = #{menuId}
</select>
<select id="hasChildByMenuId" resultType="Integer">
select count(1)
from haishiju.sys_menu
where parent_id = #{menuId}
</select>
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
</select>
<update id="updateMenu" parameterType="SysMenu">
update haishiju.sys_menu
<set>
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="path != null and path != ''">path = #{path},</if>
<if test="component != null">component = #{component},</if>
<if test="query != null">`query` = #{query},</if>
<if test="routeName != null">route_name = #{routeName},</if>
<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
<if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
<if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
<if test="visible != null">visible = #{visible},</if>
<if test="status != null">status = #{status},</if>
<if test="perms !=null">perms = #{perms},</if>
<if test="icon !=null and icon != ''">icon = #{icon},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where menu_id = #{menuId}
</update>
<insert id="insertMenu" parameterType="SysMenu">
insert into haishiju.sys_menu(
<if test="menuId != null and menuId != 0">menu_id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>
<if test="menuName != null and menuName != ''">menu_name,</if>
<if test="orderNum != null">order_num,</if>
<if test="path != null and path != ''">path,</if>
<if test="component != null and component != ''">component,</if>
<if test="query != null and query != ''">`query`,</if>
<if test="routeName != null">route_name,</if>
<if test="isFrame != null and isFrame != ''">is_frame,</if>
<if test="isCache != null and isCache != ''">is_cache,</if>
<if test="menuType != null and menuType != ''">menu_type,</if>
<if test="visible != null">visible,</if>
<if test="status != null">status,</if>
<if test="perms !=null and perms != ''">perms,</if>
<if test="icon != null and icon != ''">icon,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="menuId != null and menuId != 0">#{menuId},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="menuName != null and menuName != ''">#{menuName},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="path != null and path != ''">#{path},</if>
<if test="component != null and component != ''">#{component},</if>
<if test="query != null and query != ''">#{query},</if>
<if test="routeName != null">#{routeName},</if>
<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
<if test="isCache != null and isCache != ''">#{isCache},</if>
<if test="menuType != null and menuType != ''">#{menuType},</if>
<if test="visible != null">#{visible},</if>
<if test="status != null">#{status},</if>
<if test="perms !=null and perms != ''">#{perms},</if>
<if test="icon != null and icon != ''">#{icon},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<delete id="deleteMenuById" parameterType="Long">
delete
from haishiju.sys_menu
where menu_id = #{menuId}
</delete>
</mapper>

View File

@@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectNoticeVo">
select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark
from sys_notice
from haishiju.sys_notice
</sql>
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="insertNotice" parameterType="SysNotice">
insert into sys_notice (
insert into haishiju.sys_notice (
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
@@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<update id="updateNotice" parameterType="SysNotice">
update sys_notice
update haishiju.sys_notice
<set>
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
@@ -76,11 +76,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteNoticeById" parameterType="Long">
delete from sys_notice where notice_id = #{noticeId}
delete from haishiju.sys_notice where notice_id = #{noticeId}
</delete>
<delete id="deleteNoticeByIds" parameterType="Long">
delete from sys_notice where notice_id in
delete from haishiju.sys_notice where notice_id in
<foreach item="noticeId" collection="array" open="(" separator="," close=")">
#{noticeId}
</foreach>

View File

@@ -26,11 +26,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectOperLogVo">
select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, cost_time
from sys_oper_log
from haishiju.sys_oper_log
</sql>
<insert id="insertOperlog" parameterType="SysOperLog">
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time)
insert into haishiju.sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time)
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate())
</insert>
@@ -69,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<delete id="deleteOperLogByIds" parameterType="Long">
delete from sys_oper_log where oper_id in
delete from haishiju.sys_oper_log where oper_id in
<foreach collection="array" item="operId" open="(" separator="," close=")">
#{operId}
</foreach>
@@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<update id="cleanOperLog">
truncate table sys_oper_log
truncate table haishiju.sys_oper_log
</update>
</mapper>

View File

@@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectPostVo">
select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
from sys_post
from haishiju.sys_post
</sql>
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
@@ -48,17 +48,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPostListByUserId" parameterType="Long" resultType="Long">
select p.post_id
from sys_post p
left join sys_user_post up on up.post_id = p.post_id
left join sys_user u on u.user_id = up.user_id
from haishiju.sys_post p
left join haishiju.sys_user_post up on up.post_id = p.post_id
left join haishiju.sys_user u on u.user_id = up.user_id
where u.user_id = #{userId}
</select>
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
select p.post_id, p.post_name, p.post_code
from sys_post p
left join sys_user_post up on up.post_id = p.post_id
left join sys_user u on u.user_id = up.user_id
from haishiju.sys_post p
left join haishiju.sys_user_post up on up.post_id = p.post_id
left join haishiju.sys_user u on u.user_id = up.user_id
where u.user_name = #{userName}
</select>
@@ -73,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<update id="updatePost" parameterType="SysPost">
update sys_post
update haishiju.sys_post
<set>
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
<if test="postName != null and postName != ''">post_name = #{postName},</if>
@@ -87,7 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
insert into sys_post(
insert into haishiju.sys_post(
<if test="postId != null and postId != 0">post_id,</if>
<if test="postCode != null and postCode != ''">post_code,</if>
<if test="postName != null and postName != ''">post_name,</if>
@@ -109,11 +109,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<delete id="deletePostById" parameterType="Long">
delete from sys_post where post_id = #{postId}
delete from haishiju.sys_post where post_id = #{postId}
</delete>
<delete id="deletePostByIds" parameterType="Long">
delete from sys_post where post_id in
delete from haishiju.sys_post where post_id in
<foreach collection="array" item="postId" open="(" separator="," close=")">
#{postId}
</foreach>

View File

@@ -10,22 +10,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<delete id="deleteRoleDeptByRoleId" parameterType="Long">
delete from sys_role_dept where role_id=#{roleId}
delete from haishiju.sys_role_dept where role_id=#{roleId}
</delete>
<select id="selectCountRoleDeptByDeptId" resultType="Integer">
select count(1) from sys_role_dept where dept_id=#{deptId}
select count(1) from haishiju.sys_role_dept where dept_id=#{deptId}
</select>
<delete id="deleteRoleDept" parameterType="Long">
delete from sys_role_dept where role_id in
delete from haishiju.sys_role_dept where role_id in
<foreach collection="array" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
<insert id="batchRoleDept">
insert into sys_role_dept(role_id, dept_id) values
insert into haishiju.sys_role_dept(role_id, dept_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.roleId},#{item.deptId})
</foreach>

View File

@@ -24,10 +24,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectRoleVo">
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
r.status, r.del_flag, r.create_time, r.remark
from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id
left join sys_user u on u.user_id = ur.user_id
left join sys_dept d on u.dept_id = d.dept_id
from haishiju.sys_role r
left join haishiju.sys_user_role ur on ur.role_id = r.role_id
left join haishiju.sys_user u on u.user_id = ur.user_id
left join haishiju.sys_dept d on u.dept_id = d.dept_id
</sql>
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
@@ -67,9 +67,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRoleListByUserId" parameterType="Long" resultType="Long">
select r.role_id
from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id
left join sys_user u on u.user_id = ur.user_id
from haishiju.sys_role r
left join haishiju.sys_user_role ur on ur.role_id = r.role_id
left join haishiju.sys_user u on u.user_id = ur.user_id
where u.user_id = #{userId}
</select>
@@ -94,7 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
insert into sys_role(
insert into haishiju.sys_role(
<if test="roleId != null and roleId != 0">role_id,</if>
<if test="roleName != null and roleName != ''">role_name,</if>
<if test="roleKey != null and roleKey != ''">role_key,</if>
@@ -122,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<update id="updateRole" parameterType="SysRole">
update sys_role
update haishiju.sys_role
<set>
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
@@ -139,11 +139,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteRoleById" parameterType="Long">
update sys_role set del_flag = '2' where role_id = #{roleId}
update haishiju.sys_role set del_flag = '2' where role_id = #{roleId}
</delete>
<delete id="deleteRoleByIds" parameterType="Long">
update sys_role set del_flag = '2' where role_id in
update haishiju.sys_role set del_flag = '2' where role_id in
<foreach collection="array" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>

View File

@@ -10,22 +10,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<select id="checkMenuExistRole" resultType="Integer">
select count(1) from sys_role_menu where menu_id = #{menuId}
select count(1) from haishiju.sys_role_menu where menu_id = #{menuId}
</select>
<delete id="deleteRoleMenuByRoleId" parameterType="Long">
delete from sys_role_menu where role_id=#{roleId}
delete from haishiju.sys_role_menu where role_id=#{roleId}
</delete>
<delete id="deleteRoleMenu" parameterType="Long">
delete from sys_role_menu where role_id in
delete from haishiju.sys_role_menu where role_id in
<foreach collection="array" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
<insert id="batchRoleMenu">
insert into sys_role_menu(role_id, menu_id) values
insert into haishiju.sys_role_menu(role_id, menu_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.roleId},#{item.menuId})
</foreach>

View File

@@ -51,15 +51,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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.pwd_update_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u
left join sys_dept d on u.dept_id = d.dept_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
from haishiju.sys_user u
left join haishiju.sys_dept d on u.dept_id = d.dept_id
left join haishiju.sys_user_role ur on u.user_id = ur.user_id
left join haishiju.sys_role r on r.role_id = ur.role_id
</sql>
<select id="selectUserList" parameterType="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, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from haishiju.sys_user u
left join haishiju.sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0'
<if test="userId != null and userId != 0">
AND u.user_id = #{userId}
@@ -80,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND date_format(u.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
</if>
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM haishiju.sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
@@ -88,10 +88,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
from sys_user u
left join sys_dept d on u.dept_id = d.dept_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
from haishiju.sys_user u
left join haishiju.sys_dept d on u.dept_id = d.dept_id
left join haishiju.sys_user_role ur on u.user_id = ur.user_id
left join haishiju.sys_role r on r.role_id = ur.role_id
where u.del_flag = '0' and r.role_id = #{roleId}
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
@@ -105,12 +105,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
from sys_user u
left join sys_dept d on u.dept_id = d.dept_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
from haishiju.sys_user u
left join haishiju.sys_dept d on u.dept_id = d.dept_id
left join haishiju.sys_user_role ur on u.user_id = ur.user_id
left join haishiju.sys_role r on r.role_id = ur.role_id
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId})
and u.user_id not in (select u.user_id from haishiju.sys_user u inner join haishiju.sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId})
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>
@@ -132,19 +132,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1
select user_id, user_name from haishiju.sys_user where user_name = #{userName} and del_flag = '0' limit 1
</select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
select user_id, phonenumber from haishiju.sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
</select>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
select user_id, email from haishiju.sys_user where email = #{email} and del_flag = '0' limit 1
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user(
insert into haishiju.sys_user(
<if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
@@ -178,7 +178,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<update id="updateUser" parameterType="SysUser">
update sys_user
update haishiju.sys_user
<set>
<if test="deptId != 0">dept_id = #{deptId},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
@@ -198,27 +198,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<update id="updateUserStatus" parameterType="SysUser">
update sys_user set status = #{status}, update_time = sysdate() where user_id = #{userId}
update haishiju.sys_user set status = #{status}, update_time = sysdate() where user_id = #{userId}
</update>
<update id="updateUserAvatar" parameterType="SysUser">
update sys_user set avatar = #{avatar}, update_time = sysdate() where user_id = #{userId}
update haishiju.sys_user set avatar = #{avatar}, update_time = sysdate() where user_id = #{userId}
</update>
<update id="updateLoginInfo" parameterType="SysUser">
update sys_user set login_ip = #{loginIp}, login_date = #{loginDate} where user_id = #{userId}
update haishiju.sys_user set login_ip = #{loginIp}, login_date = #{loginDate} where user_id = #{userId}
</update>
<update id="resetUserPwd" parameterType="SysUser">
update sys_user set pwd_update_date = sysdate(), password = #{password}, update_time = sysdate() where user_id = #{userId}
update haishiju.sys_user set pwd_update_date = sysdate(), password = #{password}, update_time = sysdate() where user_id = #{userId}
</update>
<delete id="deleteUserById" parameterType="Long">
update sys_user set del_flag = '2' where user_id = #{userId}
update haishiju.sys_user set del_flag = '2' where user_id = #{userId}
</delete>
<delete id="deleteUserByIds" parameterType="Long">
update sys_user set del_flag = '2' where user_id in
update haishiju.sys_user set del_flag = '2' where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>

View File

@@ -10,22 +10,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<delete id="deleteUserPostByUserId" parameterType="Long">
delete from sys_user_post where user_id=#{userId}
delete from haishiju.sys_user_post where user_id=#{userId}
</delete>
<select id="countUserPostById" resultType="Integer">
select count(1) from sys_user_post where post_id=#{postId}
select count(1) from haishiju.sys_user_post where post_id=#{postId}
</select>
<delete id="deleteUserPost" parameterType="Long">
delete from sys_user_post where user_id in
delete from haishiju.sys_user_post where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<insert id="batchUserPost">
insert into sys_user_post(user_id, post_id) values
insert into haishiju.sys_user_post(user_id, post_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.userId},#{item.postId})
</foreach>

View File

@@ -10,33 +10,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<delete id="deleteUserRoleByUserId" parameterType="Long">
delete from sys_user_role where user_id=#{userId}
delete from haishiju.sys_user_role where user_id=#{userId}
</delete>
<select id="countUserRoleByRoleId" resultType="Integer">
select count(1) from sys_user_role where role_id=#{roleId}
select count(1) from haishiju.sys_user_role where role_id=#{roleId}
</select>
<delete id="deleteUserRole" parameterType="Long">
delete from sys_user_role where user_id in
delete from haishiju.sys_user_role where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<insert id="batchUserRole">
insert into sys_user_role(user_id, role_id) values
insert into haishiju.sys_user_role(user_id, role_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.userId},#{item.roleId})
</foreach>
</insert>
<delete id="deleteUserRoleInfo" parameterType="SysUserRole">
delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
delete from haishiju.sys_user_role where user_id=#{userId} and role_id=#{roleId}
</delete>
<delete id="deleteUserRoleInfos">
delete from sys_user_role where role_id=#{roleId} and user_id in
delete from haishiju.sys_user_role where role_id=#{roleId} and user_id in
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>