如何使用 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打印信息,这个报…...

遍历 Map 类型集合的方法汇总
1 方法一 先用方法 keySet() 获取集合中的所有键。再通过 gey(key) 方法用对应键获取值 import java.util.HashMap; import java.util.Set;public class Test {public static void main(String[] args) {HashMap hashMap new HashMap();hashMap.put("语文",99);has…...

STM32F4基本定时器使用和原理详解
STM32F4基本定时器使用和原理详解 前言如何确定定时器挂载在哪条时钟线上配置及使用方法参数配置PrescalerCounter ModeCounter Periodauto-reload preloadTrigger Event Selection 中断配置生成的代码及使用方法初始化代码基本定时器触发DCA或者ADC的代码讲解中断代码定时启动…...
Golang dig框架与GraphQL的完美结合
将 Go 的 Dig 依赖注入框架与 GraphQL 结合使用,可以显著提升应用程序的可维护性、可测试性以及灵活性。 Dig 是一个强大的依赖注入容器,能够帮助开发者更好地管理复杂的依赖关系,而 GraphQL 则是一种用于 API 的查询语言,能够提…...
uniapp中使用aixos 报错
问题: 在uniapp中使用aixos,运行后报如下错误: AxiosError: There is no suitable adapter to dispatch the request since : - adapter xhr is not supported by the environment - adapter http is not available in the build 解决方案&…...

搭建DNS域名解析服务器(正向解析资源文件)
正向解析资源文件 1)准备工作 服务端及客户端都关闭安全软件 [rootlocalhost ~]# systemctl stop firewalld [rootlocalhost ~]# setenforce 0 2)服务端安装软件:bind 1.配置yum源 [rootlocalhost ~]# cat /etc/yum.repos.d/base.repo [Base…...
作为测试我们应该关注redis哪些方面
1、功能测试 数据结构操作:验证字符串、列表、哈希、集合和有序的基本操作是否正确 持久化:测试aof和aof持久化机制,确保数据在开启后正确恢复。 事务:检查事务的原子性和回滚机制。 发布订阅:确保消息正确传递。 2、性…...
「全栈技术解析」推客小程序系统开发:从架构设计到裂变增长的完整解决方案
在移动互联网营销竞争白热化的当下,推客小程序系统凭借其裂变传播、精准营销等特性,成为企业抢占市场的利器。本文将深度解析推客小程序系统开发的核心技术与实现路径,助力开发者打造具有市场竞争力的营销工具。 一、系统核心功能架构&…...
tomcat指定使用的jdk版本
说明 有时候需要对tomcat配置指定的jdk版本号,此时,我们可以通过以下方式进行配置 设置方式 找到tomcat的bin目录中的setclasspath.bat。如果是linux系统则是setclasspath.sh set JAVA_HOMEC:\Program Files\Java\jdk8 set JRE_HOMEC:\Program Files…...
前端中slice和splic的区别
1. slice slice 用于从数组中提取一部分元素,返回一个新的数组。 特点: 不修改原数组:slice 不会改变原数组,而是返回一个新的数组。提取数组的部分:slice 会根据指定的开始索引和结束索引提取数组的一部分。不包含…...

VisualXML全新升级 | 新增数据库编辑功能
VisualXML是一个功能强大的网络总线设计工具,专注于简化汽车电子系统中复杂的网络数据设计操作。它支持多种主流总线网络格式的数据编辑(如DBC、LDF、ARXML、HEX等),并能够基于Excel表格的方式生成和转换多种数据库文件。由此&…...