diff --git a/mybatis_all/.idea/.gitignore b/mybatis_all/.idea/.gitignore
new file mode 100644
index 0000000..5c98b42
--- /dev/null
+++ b/mybatis_all/.idea/.gitignore
@@ -0,0 +1,2 @@
+# Default ignored files
+/workspace.xml
\ No newline at end of file
diff --git a/mybatis_all/.idea/codeStyles b/mybatis_all/.idea/codeStyles
new file mode 100644
index 0000000..d37c0a2
--- /dev/null
+++ b/mybatis_all/.idea/codeStyles
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/compiler.xml b/mybatis_all/.idea/compiler.xml
new file mode 100644
index 0000000..df268c2
--- /dev/null
+++ b/mybatis_all/.idea/compiler.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/encodings.xml b/mybatis_all/.idea/encodings.xml
new file mode 100644
index 0000000..c2bae49
--- /dev/null
+++ b/mybatis_all/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_11_4.xml b/mybatis_all/.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_11_4.xml
new file mode 100644
index 0000000..cf24073
--- /dev/null
+++ b/mybatis_all/.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_11_4.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/libraries/Maven__junit_junit_4_13_1.xml b/mybatis_all/.idea/libraries/Maven__junit_junit_4_13_1.xml
new file mode 100644
index 0000000..cb993f7
--- /dev/null
+++ b/mybatis_all/.idea/libraries/Maven__junit_junit_4_13_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_28.xml b/mybatis_all/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_28.xml
new file mode 100644
index 0000000..b427b86
--- /dev/null
+++ b/mybatis_all/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_28.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_12_1.xml b/mybatis_all/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_12_1.xml
new file mode 100644
index 0000000..22181b5
--- /dev/null
+++ b/mybatis_all/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_12_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/libraries/Maven__org_apache_logging_log4j_log4j_core_2_12_1.xml b/mybatis_all/.idea/libraries/Maven__org_apache_logging_log4j_log4j_core_2_12_1.xml
new file mode 100644
index 0000000..ffb7179
--- /dev/null
+++ b/mybatis_all/.idea/libraries/Maven__org_apache_logging_log4j_log4j_core_2_12_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/mybatis_all/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
new file mode 100644
index 0000000..75e6014
--- /dev/null
+++ b/mybatis_all/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/libraries/Maven__org_mybatis_mybatis_3_5_3.xml b/mybatis_all/.idea/libraries/Maven__org_mybatis_mybatis_3_5_3.xml
new file mode 100644
index 0000000..3a5aaaa
--- /dev/null
+++ b/mybatis_all/.idea/libraries/Maven__org_mybatis_mybatis_3_5_3.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/libraries/Maven__org_projectlombok_lombok_1_18_12.xml b/mybatis_all/.idea/libraries/Maven__org_projectlombok_lombok_1_18_12.xml
new file mode 100644
index 0000000..473a9e9
--- /dev/null
+++ b/mybatis_all/.idea/libraries/Maven__org_projectlombok_lombok_1_18_12.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/misc.xml b/mybatis_all/.idea/misc.xml
new file mode 100644
index 0000000..2340d62
--- /dev/null
+++ b/mybatis_all/.idea/misc.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/modules.xml b/mybatis_all/.idea/modules.xml
new file mode 100644
index 0000000..0fad2be
--- /dev/null
+++ b/mybatis_all/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/mybatis_all.iml b/mybatis_all/.idea/mybatis_all.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/mybatis_all/.idea/mybatis_all.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/.idea/uiDesigner.xml b/mybatis_all/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/mybatis_all/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/mybatisTest01/log/test.log b/mybatis_all/mybatisTest01/log/test.log
new file mode 100644
index 0000000..35a445f
Binary files /dev/null and b/mybatis_all/mybatisTest01/log/test.log differ
diff --git a/mybatis_all/mybatisTest01/mybatisTest01.iml b/mybatis_all/mybatisTest01/mybatisTest01.iml
new file mode 100644
index 0000000..7832fee
--- /dev/null
+++ b/mybatis_all/mybatisTest01/mybatisTest01.iml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/mybatisTest01/pom.xml b/mybatis_all/mybatisTest01/pom.xml
new file mode 100644
index 0000000..26e7744
--- /dev/null
+++ b/mybatis_all/mybatisTest01/pom.xml
@@ -0,0 +1,53 @@
+
+
+ 4.0.0
+
+ org.zhangzeyuan
+ mybatisTest01
+ 1.0-SNAPSHOT
+ jar
+
+
+
+ mysql
+ mysql-connector-java
+ 8.0.28
+
+
+
+
+ org.mybatis
+ mybatis
+ 3.5.3
+
+
+
+ org.apache.logging.log4j
+ log4j-core
+ 2.12.1
+
+
+
+ junit
+ junit
+ 4.13.1
+ test
+
+
+
+ org.projectlombok
+ lombok
+ 1.18.12
+ provided
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/mapper/DeptMapper.java b/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/mapper/DeptMapper.java
new file mode 100644
index 0000000..8beba43
--- /dev/null
+++ b/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/mapper/DeptMapper.java
@@ -0,0 +1,14 @@
+package com.zhangzeyuan.mapper;
+
+import com.zhangzeyuan.pojo.Emp;
+
+import java.util.List;
+
+/**
+ * @Author ZZY_1
+ * @Date 2023/12/26 22:13
+ * @Version 1.0
+ */
+public interface DeptMapper {
+ List findEmpByDeptnoAndSal(Integer deptno, Double sal);
+}
diff --git a/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/mapper/EmpCurdMapper.java b/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/mapper/EmpCurdMapper.java
new file mode 100644
index 0000000..23405c8
--- /dev/null
+++ b/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/mapper/EmpCurdMapper.java
@@ -0,0 +1,14 @@
+package com.zhangzeyuan.mapper;
+
+import com.zhangzeyuan.pojo.Emp;
+
+/**
+ * @Author ZZY_1
+ * @Date 2023/12/27 14:18
+ * @Version 1.0
+ */
+public interface EmpCurdMapper {
+ public int add1(Emp emp);
+
+ int add2(Emp emp);
+}
diff --git a/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/mapper/EmpMapper2.java b/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/mapper/EmpMapper2.java
new file mode 100644
index 0000000..2739125
--- /dev/null
+++ b/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/mapper/EmpMapper2.java
@@ -0,0 +1,9 @@
+package com.zhangzeyuan.mapper;
+
+/**
+ * @Author ZZY_1
+ * @Date 2023/12/27 23:15
+ * @Version 1.0
+ */
+public interface EmpMapper2 {
+}
diff --git a/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/pojo/Dept.java b/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/pojo/Dept.java
new file mode 100644
index 0000000..7e3e7e7
--- /dev/null
+++ b/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/pojo/Dept.java
@@ -0,0 +1,19 @@
+package com.zhangzeyuan.pojo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @Author ZZY_1
+ * @Date 2023/12/26 22:14
+ * @Version 1.0
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class Dept {
+ private Integer deptno;
+ private String dname;
+ private String loc;
+}
diff --git a/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/pojo/Emp.java b/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/pojo/Emp.java
new file mode 100644
index 0000000..0784db2
--- /dev/null
+++ b/mybatis_all/mybatisTest01/src/main/java/com/zhangzeyuan/pojo/Emp.java
@@ -0,0 +1,27 @@
+package com.zhangzeyuan.pojo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+/**
+ * @Author ZZY_1
+ * @Date 2023/12/27 13:41
+ * @Version 1.0
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class Emp {
+ private Integer empno ;
+ private String ename ;
+ private String job ;
+ private Integer mgr ;
+ private Date hiredate;
+ private Double sal ;
+ private Double comm ;
+ private Integer deptno ;
+
+}
diff --git a/mybatis_all/mybatisTest01/src/main/resources/com/zhangzeyuan/mapper/DeptMapper.xml b/mybatis_all/mybatisTest01/src/main/resources/com/zhangzeyuan/mapper/DeptMapper.xml
new file mode 100644
index 0000000..2f07470
--- /dev/null
+++ b/mybatis_all/mybatisTest01/src/main/resources/com/zhangzeyuan/mapper/DeptMapper.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/mybatisTest01/src/main/resources/com/zhangzeyuan/mapper/EmpCurdMapper.xml b/mybatis_all/mybatisTest01/src/main/resources/com/zhangzeyuan/mapper/EmpCurdMapper.xml
new file mode 100644
index 0000000..5059f9c
--- /dev/null
+++ b/mybatis_all/mybatisTest01/src/main/resources/com/zhangzeyuan/mapper/EmpCurdMapper.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+ insert into emp values (default ,#{ename},#{job},#{mgr},#{hiredate},#{sal},#{comm},#{deptno})
+
+
+
+
+ select @@identity
+
+ insert into emp values (default ,#{ename},#{job},#{mgr},#{hiredate},#{sal},#{comm},#{deptno})
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/mybatisTest01/src/main/resources/db.properties b/mybatis_all/mybatisTest01/src/main/resources/db.properties
new file mode 100644
index 0000000..af5900a
--- /dev/null
+++ b/mybatis_all/mybatisTest01/src/main/resources/db.properties
@@ -0,0 +1,4 @@
+jdbc_driver=com.mysql.cj.jdbc.Driver
+jdbc_url=jdbc:mysql://192.168.56.99:3306/mydb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
+jdbc_username=root
+jdbc_password=root
\ No newline at end of file
diff --git a/mybatis_all/mybatisTest01/src/main/resources/log4j2.xml b/mybatis_all/mybatisTest01/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..322503c
--- /dev/null
+++ b/mybatis_all/mybatisTest01/src/main/resources/log4j2.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/mybatisTest01/src/main/resources/sqlMapConfig.xml b/mybatis_all/mybatisTest01/src/main/resources/sqlMapConfig.xml
new file mode 100644
index 0000000..b7d63df
--- /dev/null
+++ b/mybatis_all/mybatisTest01/src/main/resources/sqlMapConfig.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mybatis_all/mybatisTest01/src/test/java/com/zhangzeyuan/test/TestCURD.java b/mybatis_all/mybatisTest01/src/test/java/com/zhangzeyuan/test/TestCURD.java
new file mode 100644
index 0000000..7262569
--- /dev/null
+++ b/mybatis_all/mybatisTest01/src/test/java/com/zhangzeyuan/test/TestCURD.java
@@ -0,0 +1,99 @@
+package com.zhangzeyuan.test;
+
+import com.zhangzeyuan.mapper.EmpCurdMapper;
+import com.zhangzeyuan.pojo.Dept;
+import com.zhangzeyuan.pojo.Emp;
+import org.apache.ibatis.io.Resources;
+import org.apache.ibatis.session.SqlSession;
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.apache.ibatis.session.SqlSessionFactoryBuilder;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @Author ZZY_1
+ * @Date 2023/12/26 22:16
+ * @Version 1.0
+ */
+public class TestCURD {
+ SqlSession sqlSession ;
+ //在之前运行
+ @Before
+ public void init() {
+ SqlSessionFactoryBuilder ssfb = new SqlSessionFactoryBuilder();
+ InputStream resourceAsStream = null;
+ try {
+ resourceAsStream = Resources.getResourceAsStream("sqlMapConfig.xml");
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ SqlSessionFactory factory = ssfb.build(resourceAsStream);
+ sqlSession = factory.openSession();
+
+ }
+
+ @Test
+ public void incr() {
+ EmpCurdMapper mapper = sqlSession.getMapper(EmpCurdMapper.class);
+ Emp emp =new Emp(null,"按住啦Baby","SALESMAN",7839,new Date(),3100.0, 200.0,10 );
+ int i= mapper.add1( emp);
+ System.out.println(i);
+ sqlSession.commit();
+ System.out.println(emp.getEmpno());
+ System.out.println(emp);
+
+ }
+ @Test
+ public void incr2() {
+ EmpCurdMapper mapper = sqlSession.getMapper(EmpCurdMapper.class);
+ Emp emp =new Emp(null,"按住啦Baby","SALESMAN",7839,new Date(),3100.0, 200.0,10 );
+ int i= mapper.add2( emp);
+ System.out.println(i);
+ sqlSession.commit();
+ System.out.println(emp.getEmpno());
+ System.out.println(emp);
+
+ }
+
+
+ @Test
+ public void update() {
+ Map