有哪些好的做问卷调查的网站电商设计师常用的网站

news/2025/9/22 19:38:30/文章来源:
有哪些好的做问卷调查的网站,电商设计师常用的网站,h5做网站教程,wordpress 改变js路径引言 最近在学习Mybatis Plus的使用#xff0c;希望通过spring boot快速将mybatis plus整合进来。 对于springboot项目#xff0c;mybatis plus团队也有自己的启动器 #xff1a;mybatis-plus-boot-starter。这个依赖内部已经整合了mybatis-spring#xff0c;也包括非快速…引言 最近在学习Mybatis Plus的使用希望通过spring boot快速将mybatis plus整合进来。 对于springboot项目mybatis plus团队也有自己的启动器 mybatis-plus-boot-starter。这个依赖内部已经整合了mybatis-spring也包括非快速启动的mybatis-plus这个依赖需要额外的配置数据源等信息所以如果您在网上看到引入两个和mybatis-plus有关的依赖的话完全是多余的。 操作步骤 一、创建spring boot 首先创建一个spring boot项目参考《SpringBoot————快速搭建springboot项目》在创建项目时直接引入最基本的两个依赖 二、添加必需依赖 接着再去引一下阿里的fastjson以及模板生成需要的freemarkermybatis-plus默认使用velocity无需纠结于此两者任选其一。最重要的我们需要引入mybatis-plus-boot-starter依赖可以从maven库找到maven中央库 此处选用2.2.0版本的mp启动器 !-- https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter --dependencygroupIdcom.baomidou/groupIdartifactIdmybatis-plus-boot-starter/artifactIdversion2.2.0/version/dependency 说明mybatis plus 2.3版本引入后会出现莫名其妙的异常但是同样的应用环境下2.2.0就完全没有问题我在查询用户列表的时候使用2.2.0版本的依赖是完全OK的但是把版本号改为2.3后就会在查询时报错但未纠结于此有碰到同样问题的朋友欢迎文末留言。 至此我们的pom依赖全部完毕是不是很惊喜完整pom.xml如下 ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersiongroupIdcom.mht/groupIdartifactIdspring-boot-mybatis-plus/artifactIdversion0.0.1-SNAPSHOT/versionpackagingjar/packagingnamespring-boot-mybatis-plus/namedescriptionDemo project for Spring Boot/descriptionparentgroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-parent/artifactIdversion2.0.3.RELEASE/versionrelativePath/ !-- lookup parent from repository --/parentpropertiesproject.build.sourceEncodingUTF-8/project.build.sourceEncodingproject.reporting.outputEncodingUTF-8/project.reporting.outputEncodingjava.version1.8/java.version/propertiesdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependencydependencygroupIdmysql/groupIdartifactIdmysql-connector-java/artifactIdscoperuntime/scope/dependency!-- https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter --dependencygroupIdcom.baomidou/groupIdartifactIdmybatis-plus-boot-starter/artifactIdversion2.2.0/version/dependency!-- freemarker --dependencygroupIdorg.freemarker/groupIdartifactIdfreemarker/artifactId/dependency!-- fastjson --dependencygroupIdcom.alibaba/groupIdartifactIdfastjson/artifactIdversion1.2.15/version/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependency/dependenciesbuildpluginsplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactId/plugin/plugins/build /project说明可以看到包括web依赖和mysql驱动依赖总共就添加了五个依赖。当然此处也只是一个Demo样例并未添加阿里的Druid连接池但是完全不会影响我们实现大量而基本的持久层操作。 三、spring boot数据源配置 这个不说废话直接上完整application.properties文件 server.port8080#mysql spring.datasource.urljdbc:mysql://localhost:3306/ease-run?useUnicodetruecharacterEncodingutf8 spring.datasource.usernameroot spring.datasource.passwordroot spring.datasource.driver-class-namecom.mysql.jdbc.Driver #mybatis-plus mybatis-plus.mapper-locationsclasspath:com/mht/springbootmybatisplus/mapper/xml/*.xml mybatis-plus.type-aliases-packagecom.mht.springbootmybatisplus.entity说明mybatis plus的xml路径和实体类包名是要和你项目中一致的包括datasourse信息赋值粘贴请记得修改 四、代码生成器 数据库user表 生成器 package com.mht.springbootmybatisplus.generate;import com.baomidou.mybatisplus.generator.AutoGenerator; import com.baomidou.mybatisplus.generator.config.DataSourceConfig; import com.baomidou.mybatisplus.generator.config.GlobalConfig; import com.baomidou.mybatisplus.generator.config.PackageConfig; import com.baomidou.mybatisplus.generator.config.StrategyConfig; import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert; import com.baomidou.mybatisplus.generator.config.rules.DbColumnType; import com.baomidou.mybatisplus.generator.config.rules.DbType; import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;/*** p* 代码生成器演示* /p*/ public class MpGenerator {public static void main(String[] args) { // assert (false) : 代码生成属于危险操作请确定配置后取消断言执行代码生成;AutoGenerator mpg new AutoGenerator();// 选择 freemarker 引擎默认 Velocitympg.setTemplateEngine(new FreemarkerTemplateEngine());// 全局配置GlobalConfig gc new GlobalConfig();gc.setAuthor(Mht);gc.setOutputDir(D://workspace/spring-boot-mybatis-plus/src/main/java);gc.setFileOverride(false);// 是否覆盖同名文件默认是falsegc.setActiveRecord(true);// 不需要ActiveRecord特性的请改为falsegc.setEnableCache(false);// XML 二级缓存gc.setBaseResultMap(true);// XML ResultMapgc.setBaseColumnList(false);// XML columList/* 自定义文件命名注意 %s 会自动填充表实体属性 */// gc.setMapperName(%sDao);// gc.setXmlName(%sDao);// gc.setServiceName(MP%sService);// gc.setServiceImplName(%sServiceDiy);// gc.setControllerName(%sAction);mpg.setGlobalConfig(gc);// 数据源配置DataSourceConfig dsc new DataSourceConfig();dsc.setDbType(DbType.MYSQL);dsc.setTypeConvert(new MySqlTypeConvert() {// 自定义数据库表字段类型转换【可选】Overridepublic DbColumnType processTypeConvert(String fieldType) {System.out.println(转换类型 fieldType);// 注意processTypeConvert 存在默认类型转换如果不是你要的效果请自定义返回、非如下直接返回。return super.processTypeConvert(fieldType);}});dsc.setDriverName(com.mysql.jdbc.Driver);dsc.setUsername(root);dsc.setPassword(root);dsc.setUrl(jdbc:mysql://localhost:3306/ease-run?useUnicodetruecharacterEncodingutf8);mpg.setDataSource(dsc);// 策略配置StrategyConfig strategy new StrategyConfig();// strategy.setCapitalMode(true);// 全局大写命名 ORACLE 注意strategy.setTablePrefix(new String[] { user_ });// 此处可以修改为您的表前缀strategy.setNaming(NamingStrategy.nochange);// 表名生成策略strategy.setInclude(new String[] { user }); // 需要生成的表// strategy.setExclude(new String[]{test}); // 排除生成的表// 自定义实体父类// strategy.setSuperEntityClass(com.baomidou.demo.TestEntity);// 自定义实体公共字段// strategy.setSuperEntityColumns(new String[] { test_id, age });// 自定义 mapper 父类// strategy.setSuperMapperClass(com.baomidou.demo.TestMapper);// 自定义 service 父类// strategy.setSuperServiceClass(com.baomidou.demo.TestService);// 自定义 service 实现类父类// strategy.setSuperServiceImplClass(com.baomidou.demo.TestServiceImpl);// 自定义 controller 父类// strategy.setSuperControllerClass(com.baomidou.demo.TestController);// 【实体】是否生成字段常量默认 false// public static final String ID test_id;// strategy.setEntityColumnConstant(true);// 【实体】是否为构建者模型默认 false// public User setName(String name) {this.name name; return this;}// strategy.setEntityBuilderModel(true);mpg.setStrategy(strategy);// 包配置PackageConfig pc new PackageConfig();pc.setParent(com.mht.springbootmybatisplus);// pc.setModuleName(test);mpg.setPackageInfo(pc);// 注入自定义配置可以在 VM 中使用 cfg.abc 【可无】// InjectionConfig cfg new InjectionConfig() {// Override// public void initMap() {// MapString, Object map new HashMapString, Object();// map.put(abc, this.getConfig().getGlobalConfig().getAuthor() // -mp);// this.setMap(map);// }// };//// // 自定义 xxList.jsp 生成// ListFileOutConfig focList new ArrayList();// focList.add(new FileOutConfig(/template/list.jsp.vm) {// Override// public String outputFile(TableInfo tableInfo) {// // 自定义输入文件名称// return D://my_ tableInfo.getEntityName() .jsp;// }// });// cfg.setFileOutConfigList(focList);// mpg.setCfg(cfg);//// // 调整 xml 生成目录演示// focList.add(new FileOutConfig(/templates/mapper.xml.vm) {// Override// public String outputFile(TableInfo tableInfo) {// return /develop/code/xml/ tableInfo.getEntityName() .xml;// }// });// cfg.setFileOutConfigList(focList);// mpg.setCfg(cfg);//// // 关闭默认 xml 生成调整生成 至 根目录// TemplateConfig tc new TemplateConfig();// tc.setXml(null);// mpg.setTemplate(tc);// 自定义模板配置可以 copy 源码 mybatis-plus/src/main/resources/templates 下面内容修改// 放置自己项目的 src/main/resources/templates 目录下, 默认名称一下可以不配置也可以自定义模板名称// TemplateConfig tc new TemplateConfig();// tc.setController(...);// tc.setEntity(...);// tc.setMapper(...);// tc.setXml(...);// tc.setService(...);// tc.setServiceImpl(...);// 如上任何一个模块如果设置 空 OR Null 将不生成该模块。// mpg.setTemplate(tc);// 执行生成mpg.execute();// 打印注入设置【可无】// System.err.println(mpg.getCfg().getMap().get(abc));} }代码生成器请参考《Mybatis Plus————代码生成器》 注意事项 需要更改的地方有文件输出路径根据项目需要定制数据源此类是单独的数据库反向生成代码执行文件因此springboot的数据源不起作用包配置以及一些基本的生成策略...总之还是参考一下我的另一篇文章吧谢谢 执行刷新获得自动生成的业务代码不再赘述。 注意生成后一定记得在spring boot项目中添加mybatis的包扫描路径或Mapper注解 SpringBootApplication MapperScan(com.mht.springbootmybatisplus.mapper) public class SpringBootMybatisPlusApplication {private static final Logger logger LoggerFactory.getLogger(SpringBootMybatisPlusApplication.class);public static void main(String[] args) {SpringApplication.run(SpringBootMybatisPlusApplication.class, args);logger.info(启动完毕);} } 或 Mapper public interface UserMapper extends BaseMapperUser { } 否则会报Error creating bean with name xxxServiceImpl: Unsatisfied dependency expressed through field baseMapper; 至此我们的底层增删改查操作全部完毕下面来编写简单的controller来测试效果。 五、紧张有序的测试准备工作 controller package com.mht.springbootmybatisplus.web;import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.plugins.Page; import com.mht.springbootmybatisplus.entity.User; import com.mht.springbootmybatisplus.service.IUserService;/*** p* 前端控制器* /p** author Mht* since 2018-06-23*/ RestController RequestMapping(/user) public class UserController {Autowiredprivate IUserService userSvc;GetMapping(value /show)public JSONObject testEnum() {PageUser users userSvc.selectPage(new Page(1, 10));JSONObject result new JSONObject();result.put(users, users);return result;} }数据库中的数据 说明mybatis-plus已经为我们将基本的crud操作封装以待在代码生成的过程中我们也已经看到UserMapper接口自动继承了BaseMapper接口它里面有丰富的接口方法且已经按照常规的开发习惯实现完毕虽然我们的Mapper接口中一个方法都没有却可以实现大部分crud操作。 六、测试 结果如图 总结 通读全文我们轻松实现了自己的mybatis持久层整合操作。不得不说mybatis-plus真的非常不错本文的对应项目在我的GitHub上地址是https://github.com/DragonWatcher/spring-boot-mybatis-plus 简单高效使用起来清晰易懂。不过在整合过程中依然走了不少弯路网上的大多解释都不尽如人意另外本项目并未整合Druid因为还没接触过。 基本流程大概就是这样如果在按照上述步骤搭建和部署的过程中出现任何问题都可以在文末留言和我讨论。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/910152.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

2025年录音转文字技术解析与实用工具评测 - 指南

2025年录音转文字技术解析与实用工具评测 - 指南pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", …

CF2147H Maxflow GCD Coloring 题解

Description 给定一个无向图 \(G\),它有 \(n\) 个顶点,每条边上有一个正整数容量。我们记 \(\textsf{maxflow}(u,v)\) 为图中从源点 \(u\) 到汇点 \(v\) 的最大流值。 我们称图 \(G\) 是 好图,如果存在一个整数 \(d…

详细介绍:深入理解 JVM 字节码文件:从组成结构到 Arthas 工具实践

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

免费做网站优化网站建设需要费用

目录 1.算法运行效果图预览 2.算法运行软件版本 3.部分核心程序 4.算法理论概述 4.1 人脸检测 4.2 局部区域选择 4.3 特征提取 5.算法完整程序工程 1.算法运行效果图预览 2.算法运行软件版本 matlab2022a 3.部分核心程序 .........................................…

借助S参数测量评估电容器阻抗第 2 部分

借助S参数测量评估电容器阻抗第 2 部分2025-09-22 19:37 tlnshuju 阅读(0) 评论(0) 收藏 举报pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !…

诸城建设局网站郑州seo优化

为什么80%的码农都做不了架构师?>>> find / -name httpd.conf find / -name access_log 2>/dev/null find /etc -name *srm* find / -amin -10 # 查找在系统中最后10分钟访问的文件 find / -atime -2 # 查找在系统中最后48小时访问的文件 find / -mm…

网站管理设置湖州网站开发公司

解决办法: What solved was to go to Navigate > Reveal in Project Navigator . After this, the structure appeared again.

代做企业网站备案wordpress可视化模板编辑器

简介 本来宏哥一开始打算用真机做的,所以在前边搭建环境时候就没有下载SDK,但是由于许多小伙伴通过博客发短消息给宏哥留言说是没有真机,所以顺应民意整理一下模拟器,毕竟“得民心者,得天下”。SDK顾名思义&#xff0c…

瑞安做微网站平台公司信用评级

逆矩阵:解开线性代数之谜的魔法钥匙 大家好,我是免费搭建查券返利机器人赚佣金就用微赚淘客系统3.0的小编,也是冬天不穿秋裤,天冷也要风度的程序猿!今天,让我们一同深入探讨线性代数中的重要主题——逆矩阵…

天津品牌网站建设好处网站 建设 领导小组

计算机文件基本上分为二种:二进制文件和 ASCII(也称纯文本文件)。图形文件及文字处理程序等计算机程序都属于二进制文件。这些文件含有特殊的格式及计算机代码。ASCII 则是可以用任何文字处理程序阅读的简单文本文件,由一些字符的…

网站设计公司种类付费网站怎么做

目录: Java工具类:日期工具类文件上传工具类 短信工具类验证码工具类邮件工具类代码生成器 (SSM)各种依赖的作用:spring-context 依赖:spring-context-supprt 依赖:spring-tx 依赖:mysql-connector-java 依赖:spring-j…

提供常州网站建设俄罗斯的最新军事新闻

架构 先简单介绍zabbix监控的最主要的两个组件: zabbix server zabbix agent server 用来部署 web console以及相关的数据存储,所以需要配合一些数据库来保存数据,比如mysql,pgsql, 又有前端的页面所以还需要配置 nginx 和getway 所以 serve…

个人网站做联盟营销中山技术支持中山网站建设

代码分析 引入tkinter库,并从中导入messagebox模块。 read_users()函数用于读取存储用户信息的文本文件"users.txt"。它打开文件并逐行读取,将每行的用户名和密码以空格分隔后存储在一个列表中,最后返回该列表。 login(username,…

Uiverse.io 2.0 震撼发布:新增 3000+ 动效组件!适配 React、Vue

Uiverse官网https://uiverse.io/elements本文来自博客园,作者:jialiangzai,转载请注明原文链接:https://www.cnblogs.com/zsnhweb/p/19105896

问题及解决方法

语法基础问题 问题:变量作用域、数据类型转换、运算符优先级混淆。 解决:多写代码验证,比如用System.out.println()输出不同运算结果,对比预期和实际值。 面向对象概念模糊 问题:类与对象的关系、封装 / 继承 / 多…

成都武侯区建设厅官方网站浙江省工程建设监理管理协会网站

0 工具准备 1.EtherCAT主站 2.EtherCAT从站(本文使用步进电机驱动器) 3.Wireshark1 抓包分析 1.1 报文总览 本文设置从站1的对象字典,设置对象字典主索引为0x2000,子索引为0x00,设置值为1500。主站通过发送SDO写报文…

浙江专业网站建设商城报价潮州网站推广优化

戳下方链接,后台回复“230707PS插件”获取相关插件应用 回复“230708PS插件教程”获取教学链接; 回复“230730camera快捷键”获取快捷键链接。 原文链接:https://mp.weixin.qq.com/s/tVNDBPUtKrUtfGmPKJ0Tdw 目标调整工具 作用WindowsmacOS选取目标调整工…

大学生创业服务网站建设方案创业加盟

关于Primitive。 Primitive和Entity,一般翻译成图元和实体,图元更接近底层,实体是封装后的高级对象,使用更加简便。一般来说,Primitive的使用相对繁琐,相比Entity需要使用者自己初始化更多对象&#xff0c…

做关于车的网站好长沙网站制作平台

目录 一、bxCan简介 二、bxCAN总体描述 2.1概述 2.2CAN框图 三、bxCA的工作模式 3.1初始化模式 3.2正常模式 3.3睡眠模式(低功耗) 四、测试模式 4.1静默模式 4.2环回模式 五、bxCAN功能描述 5.1 发送处理 ​编辑 5.2接收管理 5.2.1 标识符过…

沈阳网站维护公司昌邑网站制作

项目场景: 做单链表反转题目,报错:member access within null pointer of type ‘struct ListNode’ 题目链接:LINK 问题描述 我明明在初始化指针时候,已经处理了n2->next情况却依然报错 这个报错提示含义是:大概就…