返回顶部

08 2020 档案

摘要:1.扩展转换 > byte,char,short,int,long,float,doule 从整数类型到另一种整数类型或者float到double不损失信息 从整形到浮点数将丢失信息 2.窄化转换 --> double,float,long,int,short,char 窄化转换可能丢失信息 3.隐 阅读全文
posted @ 2020-08-30 09:46 meng2113 阅读(189) 评论(0) 推荐(0)
摘要:parent的版本不能随便选择!!!!!!!!!!!!!!!!!!!! 依赖的版本要对应 阅读全文
posted @ 2020-08-30 09:45 meng2113 阅读(1035) 评论(0) 推荐(0)
摘要:在使用mybatis自定义sql时,注意参数的形式,如果sql语句中参数被单引号 ‘ ’ 包裹,则参数使用 ${参数名} 的形式, 如果没有符号包裹,参数使用 #{参数名} 的形式。 阅读全文
posted @ 2020-08-28 11:11 meng2113 阅读(134) 评论(0) 推荐(0)
摘要:SELECT SUBDATE(CURDATE(), DAYOFMONTH(CURDATE())-1) 阅读全文
posted @ 2020-08-27 13:24 meng2113 阅读(388) 评论(0) 推荐(0)
摘要:1、根据sql的select查询语句字段来在VO包中创建对应的VO类 例如sql语句: SELECT SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(city,'市',1),'市'),'省',-1)as 'city',bod51 as 'inBod5',bod52 as 阅读全文
posted @ 2020-08-26 15:10 meng2113 阅读(9019) 评论(0) 推荐(1)
摘要:SELECT SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(a.XXX,'市',1),'市'),'省',-1)as 'city' from (SELECT XXX,factory_name from sewage_plant)a 注意点:只需要把XXX字段换成对应具体 阅读全文
posted @ 2020-08-26 14:36 meng2113 阅读(1109) 评论(0) 推荐(0)
摘要:要查询的mysql语句: SELECT DISTINCT a.pool_name,a.equipment_name,a.commissioning_time from equipment a,sewage_pool b where a.pool_name=b.pool_name 1、添加VO类:Eq 阅读全文
posted @ 2020-08-24 14:43 meng2113 阅读(3708) 评论(1) 推荐(1)
摘要:前提:wrapper方法汇总 1、wrapper方法:isNotNull(不为空)、ge(大于) 2、wrapper方法: 3、wrapper方法: 4、模糊查询 5、 6、排序 阅读全文
posted @ 2020-08-23 14:49 meng2113 阅读(646) 评论(0) 推荐(0)
摘要:1、添加字段,设置默认值 2、实体类添加属性和注解 3、配置类中添加配置 4、properties文件中添加配置 阅读全文
posted @ 2020-08-23 14:13 meng2113 阅读(849) 评论(0) 推荐(0)
摘要:一、首先是mybatis-plus自带的分页 注意:下面的分页的页数和页面大小语句一定一定要写在select查询语句之前才能分页生效!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ① ② PageHelper.startPage(pNum,10); 第一种自带分页方式:配置类添 阅读全文
posted @ 2020-08-23 14:05 meng2113 阅读(2008) 评论(0) 推荐(0)
摘要:@ResponseBody @PostMapping("/uploadPicture") public String insertPicture(MultipartFile file) { //获取上传图片的地址,保存图片的路径 String filePath = "XXX\\resources\\ 阅读全文
posted @ 2020-08-20 15:40 meng2113 阅读(302) 评论(0) 推荐(0)
摘要:1、数据库添加逻辑删除字段 deleted,类型int,默认0,0为未删除。 2、实体类添加属性 deleted,并用注解@TableLogin @TableLogic private Integer deleted; 3、配置yml文件(一定要在mybatis-plus下) mybatis-plu 阅读全文
posted @ 2020-08-19 23:51 meng2113 阅读(735) 评论(0) 推荐(0)
摘要:1、com.meng.mybatisplus.enums路径下创建枚举类StatusEnum package com.meng.mybatisplus.enums; import com.baomidou.mybatisplus.annotation.EnumValue; public enum S 阅读全文
posted @ 2020-08-19 23:21 meng2113 阅读(2177) 评论(0) 推荐(0)
摘要:1、xml文件放在src路径下,无法识别。pom.xml添加: <!--静态资源导出问题--> <build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.propertie 阅读全文
posted @ 2020-08-18 14:56 meng2113 阅读(1024) 评论(0) 推荐(0)
摘要:如果更新操作中涉及关键字id,更新表单的jsp页面要回传id,不然id默认为0.而mysql的id从1开始。 可以使用隐藏域返回id <input type="hidden" name="bookID" class="form-control" value="${QBook.bookID}" > 完 阅读全文
posted @ 2020-08-16 10:54 meng2113 阅读(203) 评论(0) 推荐(0)
摘要:1、新建一个config包和一个配置拦截类MyInterceptor,并继承接口HandlerInterceptor. 快捷键(Ctrl + o)实现该接口的三个方法: public class MyInterceptor implements HandlerInterceptor { public 阅读全文
posted @ 2020-08-14 17:50 meng2113 阅读(162) 评论(0) 推荐(0)
摘要:1、前情提要: 注意事项: ①将maven项目添加web框架 ②项目结构新建lib包导入所有依赖(此步请在pom.cml导入依赖后完成) ③配置Tomcat ④项目结构概览 ⑤数据库 2、文件配置 2.1 pom.xml 配置依赖 <?xml version="1.0" encoding="UTF- 阅读全文
posted @ 2020-08-14 15:00 meng2113 阅读(219) 评论(0) 推荐(0)
摘要:具体报错如下 1、rg.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'bookID' not found. Avail 阅读全文
posted @ 2020-08-14 10:39 meng2113 阅读(278) 评论(0) 推荐(0)
摘要:写在前面:项目出现的问题: ①xml格式缩进要严格,不然会报红 ②配置项目结构,新建lib包带入所有依赖jar ③配置Tomcat添加本项目 ④database.properties文件配置每行后面不要留空格,鼠标点进去可以看到是否有空格 ⑤dao层数据库传进参数parametertype与返回参数 阅读全文
posted @ 2020-08-13 10:59 meng2113 阅读(207) 评论(0) 推荐(0)
摘要:1、在peroperties文件中配置以下代码即可 <!-- 处理请求返回json字符串的中文乱码问题 --> <mvc:annotation-driven> <mvc:message-converters register-defaults="true"> <!-- StringHttpMessa 阅读全文
posted @ 2020-08-12 15:10 meng2113 阅读(158) 评论(0) 推荐(0)
摘要:1、maven项目启动springMVC的前提: ①项目结构添加lib包并导入依赖 ②项目的Tomcat配置 2、pom.xml配置 <build> <resources> <resource> <directory>src/main/java</directory> <includes> <inc 阅读全文
posted @ 2020-08-11 14:28 meng2113 阅读(149) 评论(0) 推荐(0)
摘要:1、pom.xml依赖 <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> <dependency> <gr 阅读全文
posted @ 2020-08-11 12:01 meng2113 阅读(113) 评论(0) 推荐(0)
摘要:1、pom.xml导入依赖 <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> <dependency> < 阅读全文
posted @ 2020-08-11 10:55 meng2113 阅读(221) 评论(0) 推荐(0)
摘要:1、SpingMVC的pom.xml依赖 <build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.x 阅读全文
posted @ 2020-08-10 15:34 meng2113 阅读(334) 评论(0) 推荐(0)