当前位置: 首页 > news >正文

如何使用 SQL 语句创建一个 MySQL 数据库的表,以及对应的 XML 文件和 Mapper 文件

文章目录

    • 1、SQL 脚本语句
    • 2、XML 文件
    • 3、Mapper 文件
    • 4、启动 ServiceInit 文件
    • 5、DataService 文件
    • 6、ComplianceDBConfig 配置文件

这个方式通常是放在项目代码中,使用配置在项目的启动时创建表格,SQL 语句放到一个 XML 文件中。在Spring 项目启动时,通过配置的方式和 Bean的方式进行加载,并创建文件,同时做了些部分延伸。

1、SQL 脚本语句

DROP TABLE IF EXISTS `user_online_detail_${tableSuffix}`;
CREATE TABLE `user_online_detail_${tableSuffix}`  (
`id` bigint(20) NOT NULL COMMENT 'id',
`uid` bigint(20) DEFAULT NULL COMMENT '用户id',
`login_type` int(11) DEFAULT NULL COMMENT '端类型',
`company` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '公司name',
`company_id` char(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '公司id',
`online_time` bigint(20) DEFAULT NULL COMMENT '上线时间',
`offline_time` bigint(20) DEFAULT NULL COMMENT '下线时间',
`current_state` int(11) DEFAULT NULL COMMENT '当前状态',
`accumulated_duration` bigint(20) DEFAULT NULL COMMENT '累计时长',
`create_time` bigint(20) DEFAULT NULL COMMENT '记录创建时间',
`update_time` bigint(20) DEFAULT NULL COMMENT '记录修改时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `uid`(`uid`) USING BTREE,
INDEX `login_type`(`login_type`) USING BTREE,
INDEX `company`(`company`) USING BTREE,
INDEX `create_time`(`create_time`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact;

注意事项:

  • user_online_detail_${tableSuffix}tableSuffix 是表后缀,用于分库分表使用。
  • bigint(20):常用于 Double 类型,用作金额等。
  • PRIMARY KEY (id) USING BTREE:创建主键并整加索引,便于搜索,使用 BTREE 索引。
  • ENGINE = InnoDB:指定数据库引擎。
  • CHARACTER SET = utf8:设定字符集。

2、XML 文件

  • 通常开发中,所有的 updateinsert 都要使用批量的方式。
<?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.wen.mapper.compliance.OnlineUserMapper"><resultMap id="BaseResultMap" type="com.wen.dto.UserInfoDto"><id column="id" jdbcType="BIGINT" property="id"/><result column="uid" jdbcType="BIGINT" property="uid"/><result column="login_type" jdbcType="INTEGER" property="loginType"/><result column="company" jdbcType="VARCHAR" property="company"/><result column="company_id" jdbcType="CHAR" property="companyId"/><result column="online_time" jdbcType="BIGINT" property="onlineTime"/><result column="offline_time" jdbcType="BIGINT" property="offlineTime"/><result column="current_state" jdbcType="INTEGER" property="currentState"/><result column="accumulated_duration" jdbcType="BIGINT" property="accumulatedDuration"/><result column="create_time" jdbcType="BIGINT" property="createTime"/><result column="update_time" jdbcType="BIGINT" property="updateTime"/></resultMap><sql id="Base_Column_List">id, uid, login_type, company, company_id, online_time, offline_time, current_state,accumulated_duration, create_time, update_time</sql><select id="selectOnlineUserInfoByUid" resultMap="BaseResultMap">SELECTid, uid, login_type, company, company_id, online_time, offline_time, current_state, accumulated_duration, create_time, update_timeFROMuser_online_detail_${tableSuffix}WHERE<if test="user != null and user.size() > 0">(uid, login_type, company) in<foreach collection="user" separator="," open="(" close=")" item="u">(#{u.uid}, #{u.loginType}, #{u.company})</foreach></if></select><insert id="insertOnlineUserInfo" parameterType="com.wen.dto.UserInfoDto">INSERT INTOuser_online_detail_${tableSuffix}(id, uid, login_type, company, company_id, online_time, offline_time, current_state, accumulated_duration, create_time, update_time)VALUES<foreach collection="infoList" item="info" separator=",">(#{info.id,jdbcType=BIGINT}, #{info.uid,jdbcType=BIGINT}, #{info.loginType,jdbcType=INTEGER}, #{info.company,jdbcType=VARCHAR}, #{info.companyId,jdbcType=CHAR}, #{info.onlineTime,jdbcType=BIGINT}, #{info.offlineTime,jdbcType=BIGINT}, #{info.currentState,jdbcType=INTEGER}, #{info.accumulatedDuration,jdbcType=BIGINT}, #{info.createTime,jdbcType=BIGINT},#{info.updateTime,jdbcType=BIGINT})</foreach></insert><update id="updateOnlineUserInfo"><foreach collection="infoList" item="info" separator=";">UPDATEuser_online_detail_${tableSuffix}<set><if test="info.company != null">company = #{info.company,jdbcType=VARCHAR},</if><if test="info.companyId != null">company_id = #{info.companyId,jdbcType=CHAR},</if><if test="info.onlineTime != null">online_time = #{info.onlineTime,jdbcType=BIGINT},</if><if test="info.offlineTime != null">offline_time = #{info.offlineTime,jdbcType=BIGINT},</if><if test="info.currentState != null">current_state = #{info.currentState,jdbcType=INTEGER},</if><if test="info.updateTime != null">update_time = #{info.updateTime,jdbcType=BIGINT},</if><if test="info.accumulatedDuration != null">accumulated_duration = #{info.accumulatedDuration,jdbcType=BIGINT}</if></set>WHERE id = #{info.id}</foreach></update><select id="getOnlineUserIdByPageHelper" resultType="com.wen.dto.UidDto">SELECTuid, MAX(create_time) as create_timeFROMuser_online_detail_${tableSuffix}WHEREcompany = #{company}<if test="uid != null">and uid = #{uid}</if>GROUP BY uidORDER BY create_time desc</select><select id="getOnlineUserListByUserId" resultMap="BaseResultMap">SELECTid, uid, login_type, company, company_id, online_time, offline_time, current_state, accumulated_duration, create_time, update_timeFROMuser_online_detail_${tableSuffix}WHEREcreate_time <![CDATA[>=]]> #{startTime} AND create_time <![CDATA[<=]]> #{endTime}<if test="uidList.size() > 0">AND uid in<foreach collection="uidList" open="(" close=")" item="uid" separator=",">#{uid}</foreach></if><if test="loginEquip != 0">AND login_type = #{loginEquip}</if><if test="equipState == 0">AND current_state != 5</if><if test="equipState == 1">AND current_state = 5</if></select></mapper>

3、Mapper 文件

  • @Mapper:这个注解一般是加到配置文件中,用于扫描一个包下的所有 mapper 文件。
@Mapper
public interface OnlineUserMapper {List<UserInfoDto> selectOnlineUserInfoByUid(@Param("user") List<QueryUidDto> user, @Param("tableSuffix") int tableSuffix);// 批量方式void insertOnlineUserInfo(@Param("infoList") List<UserInfoDto> infoList, @Param("tableSuffix") int tableSuffix);// 批量方式void updateUserInfo(@Param("infoList") List<UserInfoDto> infoList, @Param("tableSuffix") int tableSuffix);List<UidDto> getOnlineUserIdByPageHelper(@Param("uid") Long uid, @Param("company") String company, @Param("tableSuffix") int tableSuffix);// 批量方式List<UserInfoDto> getOnlineUserListByUserId(@Param("uidList") List<Long> uidList,@Param("startTime") long startTime,@Param("endTime") long endTime,@Param("loginEquip") int loginEquip,@Param("equipState") int equipState,@Param("tableSuffix") int tableSuffix);}

4、启动 ServiceInit 文件

  • 该文件作为程序启动时加载。
@Slf4j
@Component
public class ServerInit {@Value("${runScript}")private boolean runScript;@Value("${runScriptDB}")private String dbList;@PostConstructpublic void run() {log.info("-------------------runScript start!------------------------");this.runScript();log.info("-------------------runScript end!------------------------");}// 启动方法public void runScript() {if (runScript) {String[] dbs = dbList.split(",");if(ArrayUtil.isEmpty(dbs)) {return;}dataService.runScript(new ArrayList<>(Arrays.asList(dbs)));}}
}

5、DataService 文件

  • 启动时如何创建表格,创建多少个表格,表的名字如何设置。
public interface IDataService {void runScript(List<String> dbList);@Overridepublic void runScript(List<String> dbList) {try {if (dbList.contains("compliance")) {for (int i = 0; i < 10; i++) {complianceSchemaMapper.runScript(String.valueOf(i));log.info("complianceSchemaMapper runScript num {} completed", i);}complianceSchemaMapper.runSingleScript();log.info("complianceSchemaMapper runScript completed");}log.info("all runScript completed");} catch (Exception ex) {log.error("runScript error", ex);}}
}

6、ComplianceDBConfig 配置文件

  • 这个文件比较复杂,可作为参考,可做权限控制,根据登陆时的 ID 进行权限判断。
@Slf4j
@Configuration
@MapperScan(basePackages = {"com.wen.server.mapper.compliance"}, sqlSessionTemplateRef = "complianceSessionTemplate")
public class ComplianceDBConfig {@Value("${spring.profiles.active}")private String active;@Value("${spring.datasource.compliance.url}")private String url;@Value("${spring.datasource.compliance.username}")private String username;@Value("${spring.datasource.compliance.driver-class-name}")private String driverClassName;@Value("${spring.datasource.compliance.passwdServer}")private String passwdServer;@Value("${spring.datasource.compliance.password}")private String password;@Value("${spring.datasource.compliance.maxWait}")private long maxWait;@Value("${spring.datasource.compliance.phyTimeoutMillis}")private long phyTimeoutMillis;@Value("${spring.datasource.compliance.minEvictableIdleTimeMillis}")private long minEvictableIdleTimeMillis;@Value("${spring.datasource.compliance.minIdle}")private int minIdle;@Value("${spring.datasource.compliance.maxActive}")private int maxActive;@Value("${spring.datasource.compliance.initialSize}")private int initialSize;@Value("${spring.datasource.compliance.timeBetweenEvictionRunsMillis}")private long timeBetweenEvictionRunsMillis;@Value("${spring.datasource.compliance.testWhileIdle}")private boolean testWhileIdle;@Value("${spring.datasource.compliance.testOnBorrow}")private boolean testOnBorrow;@Value("${spring.datasource.compliance.testOnReturn}")private boolean testOnReturn;@Value("${spring.datasource.compliance.validationQueryTimeout}")private int validationQueryTimeout;@Value("${spring.datasource.compliance.connectTimeout}")private int connectTimeout;@Value("${spring.datasource.compliance.socketTimeout}")private int socketTimeout;@Value("${spring.datasource.compliance.fetchSize}")private int fetchSize;private static final String IP_REGEX = "((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)";@Bean(name = "complianceDataSource")public DataSource mysqlDataSource() {DruidDataSource druidDataSource = new DruidDataSource();druidDataSource.setDriverClassName(driverClassName);druidDataSource.setUsername(username);druidDataSource.setUrl(url);druidDataSource.setMaxWait(maxWait);druidDataSource.setPhyTimeoutMillis(phyTimeoutMillis);druidDataSource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);druidDataSource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);druidDataSource.setInitialSize(initialSize);druidDataSource.setMinIdle(minIdle);druidDataSource.setMaxActive(maxActive);druidDataSource.setTestWhileIdle(testWhileIdle);druidDataSource.setTestOnBorrow(testOnBorrow);druidDataSource.setTestOnReturn(testOnReturn);druidDataSource.setValidationQueryTimeout(validationQueryTimeout);druidDataSource.setConnectTimeout(connectTimeout);druidDataSource.setSocketTimeout(socketTimeout);if (!active.equals("dev")) {druidDataSource.setPasswordCallback(druidPasswordCallback());} else {druidDataSource.setPassword(password);}return druidDataSource;}@Bean(name = "complianceSessionFactory")public SqlSessionFactory mysqlSessionFactory(@Qualifier("complianceDataSource") DataSource dataSource) throws Exception {//如果用的是mybatis-plus 一定得是 MybatisSqlSessionFactoryBean//否则无法识别 mybatis-plus扩展的一些接口,如:selectList, selectOne, selectMap ..., 并出现invalid bound ExceptionMybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();bean.setDataSource(dataSource);//分页插件PageInterceptor pageHelper = new PageInterceptor();Properties properties = new Properties();properties.setProperty("reasonable", "true");properties.setProperty("supportMethodsArguments", "true");properties.setProperty("returnPageInfo", "check");pageHelper.setProperties(properties);//添加插件bean.setPlugins(pageHelper);bean.addMapperLocations(new PathMatchingResourcePatternResolver().getResources("file:./config/*Mapper.xml"));bean.addMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath*:mybatis/compliance/*.xml"));MybatisConfiguration conf = new MybatisConfiguration();
//        conf.setLogImpl(Slf4jImpl.class);conf.setDefaultFetchSize(fetchSize);addInterceptor(conf);bean.setConfiguration(conf);return bean.getObject();}private static void addInterceptor(MybatisConfiguration conf) {DeptDataPermissionRule rule = new DeptDataPermissionRule() {private final Set<String> userTables = new HashSet<>(Arrays.asList("user_0", "user_1", "user_2", "user_3", "user_4", "user_5", "user_6", "user_7", "user_8", "user_9"));private final Set<String> deptTables = new HashSet<>(Arrays.asList("dept_0", "dept_1", "dept_2", "dept_3", "dept_4", "dept_5", "dept_6", "dept_7", "dept_8", "dept_9"));private final Set<String> onlineUserTables = new HashSet<>(Arrays.asList("user_online_detail_0", "user_online_detail_1", "user_online_detail_2", "user_online_detail_3", "user_online_detail_4", "user_online_detail_5", "user_online_detail_6", "user_online_detail_7", "user_online_detail_8", "user_online_detail_9"));@Overridepublic boolean matches(String tableName) {return userTables.contains(tableName) || deptTables.contains(tableName) || isOnlineUserTables(tableName);}private boolean isUserTable(String tableName) {return userTables.contains(tableName);}private boolean isDeptTable(String tableName) {return deptTables.contains(tableName);}private boolean isOnlineUserTables(String tableName) { return userTables.contains(tableName);}@Overrideprotected Expression getExpression(String tableName, Alias tableAlias, CurrentUser loginUser, DeptDataPermission deptDataPermission) {Integer currentPage = UserHolder.getCurrentUser().getCurrentPage();if (isUserTable(tableName))return buildUserExpression(tableName, tableAlias, deptDataPermission.getDeptIds(currentPage));else if (isDeptTable(tableName))return buildDeptExpression(tableName, tableAlias, deptDataPermission.getDeptIds(currentPage));else if (isUserTables(tableName))return buildOnlineUserExpression(tableName, tableAlias, deptDataPermission.getUserIds(currentPage));return EXPRESSION_NULL;}private Expression buildOnlineUserExpression(String tableName, Alias tableAlias, Set<Long> userIds) {String columnName = getColumnName(tableName);if (StrUtil.isEmpty(columnName)) {return null;}if (CollUtil.isEmpty(userIds)) {return EXPRESSION_NULL;}return new InExpression(MyBatisUtils.buildColumn(tableName, tableAlias, columnName),// Parenthesis 的目的,是提供 (1,2,3) 的 () 左右括号new Parenthesis(new ExpressionList<>(convertList(userIds, LongValue::new))));}private Expression buildDeptExpression(String tableName, Alias tableAlias, Set<Long> deptIds) {// 如果不存在配置,则无需作为条件String columnName = getColumnName(tableName);if (StrUtil.isEmpty(columnName)) {return null;}// 如果为空,则无条件if (CollUtil.isEmpty(deptIds)) {return EXPRESSION_NULL;}// 拼接条件return new InExpression(MyBatisUtils.buildColumn(tableName, tableAlias, columnName),// Parenthesis 的目的,是提供 (1,2,3) 的 () 左右括号new Parenthesis(new ExpressionList<>(convertList(deptIds, LongValue::new))));}private Expression buildUserExpression(String tableName, Alias tableAlias, Set<Long> deptIds) {String columnName = getColumnName(tableName);if (StrUtil.isEmpty(columnName)) {return null;}if (CollUtil.isEmpty(deptIds)) {return new EqualsTo(MyBatisUtils.buildColumn(tableName, tableAlias, "uid"), new LongValue(UserHolder.getCurrentUser().getUserId()));}return new InExpression(MyBatisUtils.buildColumn(tableName, tableAlias, columnName),// Parenthesis 的目的,是提供 (1,2,3) 的 () 左右括号new Parenthesis(new ExpressionList<>(convertList(deptIds, LongValue::new))));}private String getColumnName(String tableName) {if (StrUtil.isBlank(tableName)) {return null;}if (isUserTable(tableName)) {return "dept_id";}if (isDeptTable(tableName)) {return "dept_id";}if (isOnlineUserTables(tableName) ) {return "uid";}return null;}};DataPermissionRuleHandler handler = new DataPermissionRuleHandler(new DataPermissionRuleFactoryImpl(Arrays.asList(rule)));DataPermissionInterceptor inner = new DataPermissionInterceptor(handler);MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();mybatisPlusInterceptor.addInnerInterceptor(inner);conf.addInterceptor(mybatisPlusInterceptor);}@Bean("complianceTransactionManager")@Primarypublic DataSourceTransactionManager mysqlTransactionManager(@Qualifier("complianceDataSource") DataSource dataSource) {return new DataSourceTransactionManager(dataSource);}@Bean("complianceSessionTemplate")public SqlSessionTemplate mysqlSessionTemplate(@Qualifier("complianceSessionFactory") SqlSessionFactory sqlSessionFactory) {return new SqlSessionTemplate(sqlSessionFactory);}public DruidPasswordCallback druidPasswordCallback() {return new DruidPasswordCallback() {@Overridepublic void setProperties(Properties properties) {String pwd = PasswordServiceHelper.getLastedPassword(passwdServer, username);if (StrUtil.isBlank(pwd)) {log.error("**COMPLIANCE_DB** 密码服务未拿到密码");} else {log.info("**COMPLIANCE_DB** get password from password service ok! password: {}", pwd);}setPassword(pwd.toCharArray());}};}
}

相关文章:

如何使用 SQL 语句创建一个 MySQL 数据库的表,以及对应的 XML 文件和 Mapper 文件

文章目录 1、SQL 脚本语句2、XML 文件3、Mapper 文件4、启动 ServiceInit 文件5、DataService 文件6、ComplianceDBConfig 配置文件 这个方式通常是放在项目代码中&#xff0c;使用配置在项目的启动时创建表格&#xff0c;SQL 语句放到一个 XML 文件中。在Spring 项目启动时&am…...

Unity性能优化---动态网格组合(二)

在上一篇中&#xff0c;组合的是同一个材质球的网格&#xff0c;如果其中有不一样的材质球会发生什么&#xff1f;如下图&#xff1a; 将场景中的一个物体替换为不同的材质球 运行之后&#xff0c;就变成了相同的材质。 要实现组合不同材质的网格步骤如下&#xff1a; 在父物体…...

JVM学习《垃圾回收算法和垃圾回收器》

目录 1.垃圾回收算法 1.1 标记-清除算法 1.2 复制算法 1.3 标记-整理算法 1.4 分代收集算法 2.垃圾回收器 2.1 熟悉一下垃圾回收的一些名词 2.2 垃圾回收器有哪些&#xff1f; 2.3 Serial收集器 2.4 Parallel Scavenge收集器 2.5 ParNew收集器 2.6 CMS收集器 1.垃圾…...

GPS模块/SATES-ST91Z8LR:电路搭建;直接用电脑的USB转串口进行通讯;模组上报定位数据转换地图识别的坐标手动查询地图位置

从事嵌入式单片机的工作算是符合我个人兴趣爱好的,当面对一个新的芯片我即想把芯片尽快搞懂完成项目赚钱,也想着能够把自己遇到的坑和注意事项记录下来,即方便自己后面查阅也可以分享给大家,这是一种冲动,但是这个或许并不是原厂希望的,尽管这样有可能会牺牲一些时间也有哪天原…...

什么是TCP的三次握手

TCP&#xff08;传输控制协议&#xff09;的三次握手是一个用于在两个网络通信的计算机之间建立连接的过程。这个过程确保了双方都有能力接收和发送数据&#xff0c;并且初始化双方的序列号。以下是三次握手的详细步骤&#xff1a; 第一次握手&#xff08;SYN&#xff09;&…...

《Clustering Propagation for Universal Medical Image Segmentation》CVPR2024

摘要 这篇论文介绍了S2VNet&#xff0c;这是一个用于医学图像分割的通用框架&#xff0c;它通过切片到体积的传播&#xff08;Slice-to-Volume propagation&#xff09;来统一自动&#xff08;AMIS&#xff09;和交互式&#xff08;IMIS&#xff09;医学图像分割任务。S2VNet利…...

Linux ifconfig ip 命令详解

简介 ifconfig 和 ip 命令用于配置和显示 Linux 上的网络接口。虽然 ifconfig 是传统工具&#xff0c;但现在已被弃用并被提供更多功能的 ip 命令取代。 ifconfig 安装 sudo apt install net-toolssudo yum install net-tools查看所有活动的网络接口 ifconfig启动/激活网络…...

Vue3 对于echarts使用 v-show,导致显示不全,宽度仅100px,无法重新渲染的问题

参考链接&#xff1a;解决Echarts图表使用v-show,显示不全,宽度仅100px的问题_echarts v-show图表不全-CSDN博客 Vue3 echarts v-show无法重新渲染的问题_v-show echarts不渲染-CSDN博客 原因不多赘述了&#xff0c;大概就是v-show 本身是结构已经存在&#xff0c;当数据发生…...

C++实现俄罗斯方块

俄罗斯方块 还记得俄罗斯方块吗&#xff1f;相信这是小时候我们每个人都喜欢玩的一个小游戏。顾名思义&#xff0c;俄罗斯方块自然是俄罗斯人发明的。这人叫阿列克谢帕基特诺夫。他设置这个游戏的规则是&#xff1a;由小方块组成的不同形状的板块陆续从屏幕上方落下来&#xf…...

鸿蒙分享:添加模块,修改app名称图标

新建公共模块common 在entry的oh-package.json5添加dependencies&#xff0c;引入common模块 "dependencies": {"common": "file:../common" } 修改app名称&#xff1a; common--src--resources--string.json 新增&#xff1a; {"name&q…...

扫描IP段内的使用的IP

扫描IP段内的使用的IP 方法一&#xff1a;命令行 命令行进入 for /L %i IN (1,1,254) DO ping -w 1 -n 1 192.168.3.%iarp -a方法二&#xff1a;python from scapy.all import ARP, Ether, srp import keyboarddef scan_network(ip_range):# 创建一个ARP请求包arp ARP(pds…...

【专题】虚拟存储器

前文提到的存储器管理方式有一个共同的特点&#xff0c;即它们都要求将一个作业全部装入内存后方能运行。 但有两种特殊情况&#xff1a; 有的作业很大&#xff0c;其所要求的内存空间超过了内存总容量&#xff0c;作业不能全部被装入内存&#xff0c;致使该作业无法运行&#…...

Python之爬虫入门--示例(2)

一、Requests库安装 可以使用命令提示符指令直接安装requests库使用 pip install requests 二、爬取JSON数据 &#xff08;1&#xff09;、点击网络 &#xff08;2&#xff09;、刷新网页 &#xff08;3&#xff09;、这里有一些数据类型&#xff0c;选择全部 &#xff08…...

5G CPE终端功能及性能评测(四)

5G CPE 功能性能评测 本文选取了几款在工业应用领域应用较多的5G CPE,对其功能和性能进行了对比评测。功能方面主要对比了网络接口数量,VPN功能 支持情况。以下测试为空口测试,测试结果受环境影响较大,性能仅供参考。总体看,高通X55芯片下行最优,速率稳定。 功能 对比CPE…...

人工智能驱动的骗局会模仿熟悉的声音

由于人工智能技术的进步&#xff0c;各种现代骗局变得越来越复杂。 这些骗局现在包括人工智能驱动的网络钓鱼技术&#xff0c;即使用人工智能模仿家人或朋友的声音和视频。 诈骗者使用来自社交媒体的内容来制作深度伪造内容&#xff0c;要求提供金钱或个人信息。个人应该通过…...

电子病历静态数据脱敏路径探索

一、引言 数据脱敏&#xff08;Data Masking&#xff09;&#xff0c;屏蔽敏感数据&#xff0c;对某些敏感信息&#xff08;比如patient_name、ip_no、ad、no、icd11、drug等等 &#xff09;通过脱敏规则进行数据的变形&#xff0c;实现隐私数据的可靠保护。电子病历作为医疗领…...

混合云策略在安全领域受到青睐

Genetec 发布了《2025 年物理安全状况报告》&#xff0c;该报告根据超过 5,600 名该领域领导者&#xff08;其中包括 100 多名来自澳大利亚和新西兰的领导者&#xff09;的回应&#xff0c;揭示了物理安全运营的趋势。 报告发现&#xff0c;澳大利亚和新西兰的组织采用混合云策…...

Echarts使用平面方法绘制三维立体柱状图表

目录 一、准备工作 1.下载引入ECharts库 2.创建容器 二、绘制基本柱状 三、绘制立体柱状方法一 1.定义立方体形状 2.注册立方体形状 3.配置custom系列 4.设置数据 5.渲染图表 四、绘制立体柱状方法二 1.画前知识 2.计算坐标renderItem 函数 &#xff08;1&#x…...

java-判断语句

题目一&#xff1a;选择练习1 657. 选择练习1 - AcWing题库 代码 import java.util.Scanner;public class Main {public static void main(String[] args) {Scanner sc new Scanner(System.in);int a sc.nextInt(), b sc.nextInt();int c sc.nextInt(), d sc.nextInt();…...

11.14【JAVA EXP3】【DEBUG】

比较疑惑的一点是当前页面&#xff08;资源的url)与请求的url? 请求的url由webService接收&#xff0c;servelt当中也可以发送出这个url 进行页面跳转&#xff0c;是跳转到某个Jsp页面&#xff0c;这个页面的url是在哪里定义的&#xff1f; 在Jsp打印信息&#xff0c;这个报…...

eNSP-Cloud(实现本地电脑与eNSP内设备之间通信)

说明&#xff1a; 想象一下&#xff0c;你正在用eNSP搭建一个虚拟的网络世界&#xff0c;里面有虚拟的路由器、交换机、电脑&#xff08;PC&#xff09;等等。这些设备都在你的电脑里面“运行”&#xff0c;它们之间可以互相通信&#xff0c;就像一个封闭的小王国。 但是&#…...

智慧医疗能源事业线深度画像分析(上)

引言 医疗行业作为现代社会的关键基础设施,其能源消耗与环境影响正日益受到关注。随着全球"双碳"目标的推进和可持续发展理念的深入,智慧医疗能源事业线应运而生,致力于通过创新技术与管理方案,重构医疗领域的能源使用模式。这一事业线融合了能源管理、可持续发…...

java_网络服务相关_gateway_nacos_feign区别联系

1. spring-cloud-starter-gateway 作用&#xff1a;作为微服务架构的网关&#xff0c;统一入口&#xff0c;处理所有外部请求。 核心能力&#xff1a; 路由转发&#xff08;基于路径、服务名等&#xff09;过滤器&#xff08;鉴权、限流、日志、Header 处理&#xff09;支持负…...

【网络安全产品大调研系列】2. 体验漏洞扫描

前言 2023 年漏洞扫描服务市场规模预计为 3.06&#xff08;十亿美元&#xff09;。漏洞扫描服务市场行业预计将从 2024 年的 3.48&#xff08;十亿美元&#xff09;增长到 2032 年的 9.54&#xff08;十亿美元&#xff09;。预测期内漏洞扫描服务市场 CAGR&#xff08;增长率&…...

el-switch文字内置

el-switch文字内置 效果 vue <div style"color:#ffffff;font-size:14px;float:left;margin-bottom:5px;margin-right:5px;">自动加载</div> <el-switch v-model"value" active-color"#3E99FB" inactive-color"#DCDFE6"…...

使用van-uploader 的UI组件,结合vue2如何实现图片上传组件的封装

以下是基于 vant-ui&#xff08;适配 Vue2 版本 &#xff09;实现截图中照片上传预览、删除功能&#xff0c;并封装成可复用组件的完整代码&#xff0c;包含样式和逻辑实现&#xff0c;可直接在 Vue2 项目中使用&#xff1a; 1. 封装的图片上传组件 ImageUploader.vue <te…...

Neo4j 集群管理:原理、技术与最佳实践深度解析

Neo4j 的集群技术是其企业级高可用性、可扩展性和容错能力的核心。通过深入分析官方文档,本文将系统阐述其集群管理的核心原理、关键技术、实用技巧和行业最佳实践。 Neo4j 的 Causal Clustering 架构提供了一个强大而灵活的基石,用于构建高可用、可扩展且一致的图数据库服务…...

linux 下常用变更-8

1、删除普通用户 查询用户初始UID和GIDls -l /home/ ###家目录中查看UID cat /etc/group ###此文件查看GID删除用户1.编辑文件 /etc/passwd 找到对应的行&#xff0c;YW343:x:0:0::/home/YW343:/bin/bash 2.将标红的位置修改为用户对应初始UID和GID&#xff1a; YW3…...

什么?连接服务器也能可视化显示界面?:基于X11 Forwarding + CentOS + MobaXterm实战指南

文章目录 什么是X11?环境准备实战步骤1️⃣ 服务器端配置(CentOS)2️⃣ 客户端配置(MobaXterm)3️⃣ 验证X11 Forwarding4️⃣ 运行自定义GUI程序(Python示例)5️⃣ 成功效果![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/55aefaea8a9f477e86d065227851fe3d.pn…...

AI病理诊断七剑下天山,医疗未来触手可及

一、病理诊断困局&#xff1a;刀尖上的医学艺术 1.1 金标准背后的隐痛 病理诊断被誉为"诊断的诊断"&#xff0c;医生需通过显微镜观察组织切片&#xff0c;在细胞迷宫中捕捉癌变信号。某省病理质控报告显示&#xff0c;基层医院误诊率达12%-15%&#xff0c;专家会诊…...