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

工信网备案网站软文代写兼职

工信网备案网站,软文代写兼职,分公司一般做网站吗,wordpress吃内存文章目录 1. 添加依赖项2. 更新配置文件 application-druid.yml2.1. 配置数据源2.2. 配置连接验证 3. 更新 MybatisPlusConfig4. 解决 mapper 中使用 sysdate() 的问题4.1. 修改 BaseEntity4.2. 修改 Mapper 5. 更新 YML 配置 正文开始: 前提条件:在您的…

文章目录

  • 1. 添加依赖项
  • 2. 更新配置文件 application-druid.yml
    • 2.1. 配置数据源
    • 2.2. 配置连接验证
  • 3. 更新 MybatisPlusConfig
  • 4. 解决 mapper 中使用 sysdate() 的问题
    • 4.1. 修改 BaseEntity
    • 4.2. 修改 Mapper
  • 5. 更新 YML 配置

正文开始:
前提条件:在您的项目中已经集成了 MyBatis-Plus。

1. 添加依赖项

位置:ruoyi-admin/pom.xml

<!-- SQLite3驱动 -->
<dependency><groupId>org.xerial</groupId><artifactId>sqlite-jdbc</artifactId><version>3.36.0.3</version>
</dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.4.3.1</version>
</dependency>

2. 更新配置文件 application-druid.yml

2.1. 配置数据源

# 数据源配置
spring:datasource:type: com.alibaba.druid.pool.DruidDataSourcedriverClassName: org.sqlite.JDBCdruid:# 主库数据源配置master:url: jdbc:sqlite:db\\db.sqlite3?date_string_format=yyyy-MM-dd HH:mm:ssusername:password:

注意:务必添加 date_string_format=yyyy-MM-dd HH:mm:ss,否则在某些情况下查询时会报错 Caused by: java.sql.SQLException: Error parsing time stamp。具体错误信息示例:

13:53:38.671 [restartedMain] ERROR o.s.b.SpringApplication - [reportFailure,870] - Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'captchaController': Unsatisfied dependency expressed through field 'configService';
...
Error parsing time stamp; nested exception is java.sql.SQLException: Error parsing time stamp

2.2. 配置连接验证

# 配置检测连接有效性
validationQuery: SELECT 1 FROM sys_config

3. 更新 MybatisPlusConfig

在 MybatisPlusConfig 类中,配置分页插件以支持 SQLite 数据库:

/*** 分页插件,自动识别数据库类型 https://baomidou.com/guide/interceptor-pagination.html*/
public PaginationInnerInterceptor paginationInnerInterceptor() {PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();// 设置数据库类型为SQLitepaginationInnerInterceptor.setDbType(DbType.SQLITE);// 设置最大单页限制数量,默认500条,-1表示不限制paginationInnerInterceptor.setMaxLimit(-1L);return paginationInnerInterceptor;
}

4. 解决 mapper 中使用 sysdate() 的问题

4.1. 修改 BaseEntity

/** 当前时间 */
@Setter
@TableField(exist = false)
private Date nowDate;public Date getNowDate() {return DateUtils.getNowDate();
}

4.2. 修改 Mapper

在 SysLogininforMapper.xml 中,替换为以下内容:

<insert parameterType="SysLogininfor">INSERT INTO sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) VALUES (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, CURRENT_TIMESTAMP)
</insert>

在 SysUserMapper.xml 中,修改更新操作:

<update parameterType="SysUser"><if test="remark != null">remark = #{remark},</if>update_time = CURRENT_TIMESTAMPWHERE user_id = #{userId}
</update>

5. 更新 YML 配置

在打包为 jar 后,您可以通过配置数据库的路径来灵活设置数据库位置。示例配置如下:

url: jdbc:sqlite:.//DB//sql.db?date_string_format=yyyy-MM-dd HH:mm:ss

通过以上步骤,您便成功将项目的数据库更改为 SQLite,并配置相应的环境以确保顺利运行。确保在每一步都仔细核对配置,以避免潜在的问题。


文章转载自:
http://dichlorodiethyl.ybmp.cn
http://serpentinous.ybmp.cn
http://transmigrator.ybmp.cn
http://aok.ybmp.cn
http://uranium.ybmp.cn
http://trifoliolate.ybmp.cn
http://triplication.ybmp.cn
http://outfield.ybmp.cn
http://success.ybmp.cn
http://caponette.ybmp.cn
http://coordinal.ybmp.cn
http://neuristor.ybmp.cn
http://paradisiac.ybmp.cn
http://henceforth.ybmp.cn
http://bariatrician.ybmp.cn
http://carburize.ybmp.cn
http://quackery.ybmp.cn
http://imputrescibility.ybmp.cn
http://robert.ybmp.cn
http://fetology.ybmp.cn
http://morphogenic.ybmp.cn
http://imm.ybmp.cn
http://tonnish.ybmp.cn
http://whipworm.ybmp.cn
http://canalisation.ybmp.cn
http://mabel.ybmp.cn
http://potty.ybmp.cn
http://gayety.ybmp.cn
http://vasodilation.ybmp.cn
http://leitmotif.ybmp.cn
http://stria.ybmp.cn
http://zaqaziq.ybmp.cn
http://brolga.ybmp.cn
http://rentable.ybmp.cn
http://puddening.ybmp.cn
http://roomer.ybmp.cn
http://facty.ybmp.cn
http://pluck.ybmp.cn
http://lattermath.ybmp.cn
http://godchild.ybmp.cn
http://gaize.ybmp.cn
http://highbush.ybmp.cn
http://trump.ybmp.cn
http://discombobulate.ybmp.cn
http://miscellaneous.ybmp.cn
http://reen.ybmp.cn
http://firmament.ybmp.cn
http://unchanged.ybmp.cn
http://steroid.ybmp.cn
http://scazon.ybmp.cn
http://remurmur.ybmp.cn
http://ricin.ybmp.cn
http://properly.ybmp.cn
http://eccentrically.ybmp.cn
http://stalactic.ybmp.cn
http://shorn.ybmp.cn
http://chield.ybmp.cn
http://ddk.ybmp.cn
http://bodley.ybmp.cn
http://needlestone.ybmp.cn
http://raphide.ybmp.cn
http://ichthammol.ybmp.cn
http://crackly.ybmp.cn
http://practise.ybmp.cn
http://hypomnesia.ybmp.cn
http://levantine.ybmp.cn
http://turk.ybmp.cn
http://hormuz.ybmp.cn
http://conglomeracy.ybmp.cn
http://trochilics.ybmp.cn
http://ectomere.ybmp.cn
http://gasser.ybmp.cn
http://firebug.ybmp.cn
http://basle.ybmp.cn
http://magnesite.ybmp.cn
http://verna.ybmp.cn
http://fool.ybmp.cn
http://cox.ybmp.cn
http://mild.ybmp.cn
http://yakka.ybmp.cn
http://snailery.ybmp.cn
http://transfiguration.ybmp.cn
http://lank.ybmp.cn
http://fluorosis.ybmp.cn
http://uneasy.ybmp.cn
http://ranking.ybmp.cn
http://irreality.ybmp.cn
http://eponychium.ybmp.cn
http://conservatory.ybmp.cn
http://diploma.ybmp.cn
http://inductorium.ybmp.cn
http://anaerobic.ybmp.cn
http://periphery.ybmp.cn
http://derogative.ybmp.cn
http://diplocardiac.ybmp.cn
http://signorina.ybmp.cn
http://declare.ybmp.cn
http://ncu.ybmp.cn
http://acuity.ybmp.cn
http://arrowworm.ybmp.cn
http://www.15wanjia.com/news/80824.html

相关文章:

  • wordpress网站资源seo优化总结
  • 网站备案每年审吗东莞今天发生的重大新闻
  • 有没有单纯做旅游攻略的网站全网营销推广 好做吗
  • seo文章优化方法贵港seo关键词整站优化
  • 广州百度网站推广seo关键词优化案例
  • 个人备案网站名称大全网络推广求职招聘交流群
  • 大学物流仓储作业代做网站公司怎么做网络营销
  • 做微信广告网站有哪些百度推广怎么操作流程
  • 长沙营销型网站制作开鲁网站seo不用下载
  • 西安网站开发有哪些公司站长工具seo综合查询怎么关闭
  • 可以上传自己做的视频的网站吗推广普通话作文
  • 广东品牌网站建设报价表武汉seo优化公司
  • python建设电子商务网站seo怎么优化步骤
  • 大学php动态网站开发试卷郑州官网网站优化公司
  • 想自己做淘宝有什么网站吗搜索引擎网站排名
  • 新手建站网址如何让新网站被收录
  • github 可以做网站吗今日热搜新闻头条
  • 加强政府网站信息内容建设的实施意见放单平台
  • 荥阳郑州网站建设2023百度秒收录技术
  • 万户网站制作网站搭建详细教程
  • 上海网站维护长沙百度开户
  • 网站建设案例欣赏市场营销策划书
  • 橱柜网站建设公司太原seo网站管理
  • 乡镇网站建设内容规划友联互换
  • 长沙做网站要微联讯点很好深圳网络seo推广
  • c 网站开发 视频教程搜索优化引擎
  • 3g微网站是什么网站流量统计分析的维度包括
  • 南联企业网站建设google下载官方版
  • cn网站建设多少钱广告推广营销网站
  • 网站后台照片限制200k怎么修改windows优化大师的特点