如何使用 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 文件
- 通常开发中,所有的
update
和insert
都要使用批量的方式。
<?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 配置文件 这个方式通常是放在项目代码中,使用配置在项目的启动时创建表格,SQL 语句放到一个 XML 文件中。在Spring 项目启动时&am…...

Unity性能优化---动态网格组合(二)
在上一篇中,组合的是同一个材质球的网格,如果其中有不一样的材质球会发生什么?如下图: 将场景中的一个物体替换为不同的材质球 运行之后,就变成了相同的材质。 要实现组合不同材质的网格步骤如下: 在父物体…...

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

GPS模块/SATES-ST91Z8LR:电路搭建;直接用电脑的USB转串口进行通讯;模组上报定位数据转换地图识别的坐标手动查询地图位置
从事嵌入式单片机的工作算是符合我个人兴趣爱好的,当面对一个新的芯片我即想把芯片尽快搞懂完成项目赚钱,也想着能够把自己遇到的坑和注意事项记录下来,即方便自己后面查阅也可以分享给大家,这是一种冲动,但是这个或许并不是原厂希望的,尽管这样有可能会牺牲一些时间也有哪天原…...

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

《Clustering Propagation for Universal Medical Image Segmentation》CVPR2024
摘要 这篇论文介绍了S2VNet,这是一个用于医学图像分割的通用框架,它通过切片到体积的传播(Slice-to-Volume propagation)来统一自动(AMIS)和交互式(IMIS)医学图像分割任务。S2VNet利…...

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

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

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

鸿蒙分享:添加模块,修改app名称图标
新建公共模块common 在entry的oh-package.json5添加dependencies,引入common模块 "dependencies": {"common": "file:../common" } 修改app名称: common--src--resources--string.json 新增: {"name&q…...

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

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

Python之爬虫入门--示例(2)
一、Requests库安装 可以使用命令提示符指令直接安装requests库使用 pip install requests 二、爬取JSON数据 (1)、点击网络 (2)、刷新网页 (3)、这里有一些数据类型,选择全部 (…...

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

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

电子病历静态数据脱敏路径探索
一、引言 数据脱敏(Data Masking),屏蔽敏感数据,对某些敏感信息(比如patient_name、ip_no、ad、no、icd11、drug等等 )通过脱敏规则进行数据的变形,实现隐私数据的可靠保护。电子病历作为医疗领…...

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

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

java-判断语句
题目一:选择练习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】
比较疑惑的一点是当前页面(资源的url)与请求的url? 请求的url由webService接收,servelt当中也可以发送出这个url 进行页面跳转,是跳转到某个Jsp页面,这个页面的url是在哪里定义的? 在Jsp打印信息,这个报…...

UE5 和 UE4 中常用的控制台命令总结
调用控制台 按下键盘上的 ~ 键可以调用控制台命令。 技巧 使用键盘的 ↑ 键可以查看之前输入过的指令。控制台指令并不需要打全名,输入空格后跟随指令的部分字符可以进行模糊搜索。按下 Ctrl Shift , 打开 GPUProfile 面板。 命令如下: 调试类 s…...

MR30分布式IO模块赋能喷水织机
纺织行业作为我国传统支柱产业,历经数千年的演变,如今仍面临着诸多困境,在纺织行业中,每一次技术的飞跃都是对行业边界的勇敢探索。在纺织行业,喷水织机作为关键生产设备,其性能直接影响到产品质量和产能。…...

C++中的封装性
定义: 封装性: 1.将属性(成员变量)和行为(成员函数)作为一个整体,表现在生活中的事物 2.将属性和行为加以权限控制 (将事物的属性(成员变量)和行为&#…...

PyTorch 深度学习框架简介:灵活、高效的 AI 开发工具
PyTorch 深度学习框架简介:灵活、高效的 AI 开发工具 PyTorch 作为一个深度学习框架,以其灵活性、可扩展性和高效性广受欢迎。无论是在研究领域进行创新实验,还是在工业界构建生产级的深度学习模型,PyTorch 都能提供所需的工具和…...

leetcode-22.括号生成
暴力 感谢分享这个思路和算法。生成括号的问题可以通过生成所有可能的括号序列并验证其有效性来解决。以下是对该思路的详细解释和实现: 思路 生成所有可能的序列: 使用递归生成所有长度为 2n 的括号序列。在每个位置可以选择放置 ( 或 )。 验证序列的…...

devops-Dockerfile+Jenkinsfile方式部署Java前后端应用
文章目录 概述部署前端Vue应用一、环境准备1、Dockerfile2、.dockerignore3、nginx.conf4、Jenkinsfile 二、Jenkins部署1、新建任务2、流水线3、Build Now 构建 & 访问 Springboot后端应用1. 准备工作2. 创建项目结构3. 编写 Dockerfile后端 Dockerfile (backend/Dockerfi…...

【Apache Paimon】-- 4 -- Flink 消费 kafka 数据,然后写入 paimon
目录 1、本地开发环境 2、kafka2paimon 实现流程 3、代码实现 3.1、项目名称 3.2、项目结构 3.3、Pom.xml 和 log4j.properties 文件 3.4、代码核心类 3.4.1、入口类:Kafka2PaimonDemo.java 3.4.2、参数解析类 3.4.2.1、JobParameterUtil.java( flink job schedule…...

【成功解决】:VS2019(Visual Studio 2019)遇到E2870问题:此配置中不支持 128 位浮点类型
起因:项目中需要用json来操作数据,就引了cJSON库(cJSON.h和cJSON.c文件),但是发现编译报错如下 E2870 此配置中不支持 128 位浮点类型 test0 ...\usr\include\x86_64-linux-gnu\bits\floatn.h 75 然后先新建了个工程来检查问题(甚至在这之前还以为是cjson…...

什么是TCP的三次握手?
TCP的三次握手:深入理解建立可靠连接的过程 引言 在计算机网络中,传输控制协议(TCP)是确保数据可靠传输的核心协议之一。TCP通过三次握手机制来建立一个稳定的、双向的连接,这对于确保数据的完整性和顺序至关重要。本…...

SQL教程(2):SQL基础语法及用途
在上一篇文章中,我们介绍了 SQL(结构化查询语言)的基本概念,以及它在用户研究中的重要作用。今天,我们将深入了解 SQL 的基本语法,并通过实际应用场景帮助你更好地理解如何使用 SQL 提取和分析数据。对于刚…...