合集-Java中使用到的模板
摘要:2023-09-10 maven中配置多环境的写法 <!-- 多环境配置--> <profiles> <!-- 开发环境--> <profile> <id>env_dep</id> <properties> <jdbc.url>jdbc:mysql://127.0.0.1:3306/db01?use
阅读全文
摘要:2023-09-10 spring: profiles: active: dev spring: profiles: dev server: port: 8080 spring: profiles: pro server: port: 8081 spring: profiles: test serv
阅读全文
摘要:2023-09-10 spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:33
阅读全文
摘要:2023-09-10 mybatis-plus中添加的依赖 <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.4.0</version>
阅读全文
摘要:2023-09-10 目录结构 logback.xml <?xml version="1.0" encoding="UTF-8"?> <configuration> </configuration> application.yml spring: datasource: driver-class-n
阅读全文
摘要:2023-09-10 @Data @TableName("tbl_phone") public class Phone { @TableField(select = false) private Integer id; private String type; private String name
阅读全文
摘要:2023-09-10 version字段表示乐观锁 在表结构中添加一个字段表示乐观锁 package com.hh.domain; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatispl
阅读全文
摘要:2023-09-11 <!--代码生成器--> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-generator</artifactId> <version>3.3.1</version> </depend
阅读全文
摘要:2023-09-11 1、模糊查询 UserMapper List<User> getUserByLike(String mohu); UserMapper.xml <select id="getUserByLike" resultType="com.hh.pojo.User"> select *
阅读全文
摘要:2023-09-11 UserMapper void insertUser(User user); UserMapper.xml <insert id="insertUser" useGeneratedKeys="true" keyProperty="id"> insert into t_user
阅读全文
摘要:2023-09-12 仓库 StoreHouseMapper /** * 分步查询 * 首先通过仓库的id查询出仓库 */ StoreHouse getSHAndGoodsByStepOne(@Param("id")Integer id); StoreHouseMapper.xml <resultM
阅读全文
摘要:2023-09-12 StoreHouseMapper package com.hh.mapper; import com.hh.pojo.StoreHouse; import java.util.List; /** * @author hh * @version 1.0 * @DATE 2023-
阅读全文
摘要:2023-09-12 StoreHouseMapper /** * 批量添加 */ void insertMoreSH(@Param("storeHouses") List<StoreHouse> storeHouses); /** * 批量删除方式一 */ void deleteMoreSH(@P
阅读全文
摘要:2023-09-12 导入的依赖 <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> <version>5.3.2</version> </dependency> myba
阅读全文
摘要:2023-09-14 spring-jdbc.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.
阅读全文
摘要:2023-09-14 web.xml <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-
阅读全文
摘要:2023-09-14 web.xml <!--设置编码格式,解决字符乱码--> <filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class>org.springframework.web.filter.Chara
阅读全文
摘要:2023-09-15 web.xml <!--请求方式过滤器--> <filter> <filter-name>HiddenHttpMethodFilter</filter-name> <filter-class>org.springframework.web.filter.HiddenHttpMe
阅读全文
摘要:2023-09-15 <!--设置默认的servlet处理静态资源--> <mvc:default-servlet-handler/> <!--开启视图注解驱动器--> <mvc:annotation-driven /> <mvc:view-controller path="/" view-name
阅读全文
摘要:2023-09-15 web.xml <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-
阅读全文