mybatis
parent
2461fb044c
commit
705da8204f
228
pom.xml
228
pom.xml
|
@ -1,116 +1,112 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<!--指定了当前pom的版本,4.0.0是固定的 -->
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<!-- 主项目标识,用来定义当前maven属于哪个实际的项目 -->
|
||||
<groupId>ecology-weaver</groupId>
|
||||
<!-- 模块名,maven项目和实际的项目不是一一对应的关系,maven项目提现的是模块化的概念,一个实际项目往往会被划分为很多个模块 -->
|
||||
<artifactId>ecology-weaver</artifactId>
|
||||
<!-- 当前项目版本号,一般有三个数字组成 第一个数字:大版本号 第二个数字:分支版本号 第三个数字:先版本号 snapshot: 快照 alpha:
|
||||
内测版本 beta: 公测版本 Release: 稳定版本 GA: 正式发布版本 -->
|
||||
<version>E9</version>
|
||||
<!-- maven项目打包方式,默认情况为jar,还可打包为war,zip,pom等 -->
|
||||
<packaging>war</packaging>
|
||||
<!-- 项目描述名 -->
|
||||
<name>ecology本地开发环境</name>
|
||||
<!-- 项目地址 -->
|
||||
<!-- <url></url>-->
|
||||
<!-- 项目描述 -->
|
||||
<description>ecology 本地开发环境E9</description>
|
||||
|
||||
<!-- 开发人员列表 -->
|
||||
<developers>
|
||||
<developer>
|
||||
<!-- 项目开发者的唯一标识符 -->
|
||||
<id>aiyh</id>
|
||||
<!-- 项目开发者的全名 -->
|
||||
<name>aiYouHong</name>
|
||||
<!-- 项目开发者的email -->
|
||||
<email>youhong.ai@weaver.com.cn</email>
|
||||
<!-- 项目开发者的主页的URL -->
|
||||
<url>https://gitee.com/it-xiaoxiong</url>
|
||||
<!-- 项目开发者在项目中扮演的角色,角色元素描述了各种角色 -->
|
||||
<roles>
|
||||
<role>二开</role>
|
||||
</roles>
|
||||
<!-- 项目开发者所属组织 -->
|
||||
<organization>泛微-昂泰</organization>
|
||||
<!-- 项目开发者所属组织的URL -->
|
||||
<organizationUrl>https://www.e-cology.com.cn/</organizationUrl>
|
||||
</developer>
|
||||
</developers>
|
||||
<!-- 许可证信息 -->
|
||||
<!-- <licenses></licenses>-->
|
||||
<!-- 组织信息 -->
|
||||
<!-- <organization></organization>-->
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<encoding>UTF-8</encoding>
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<lombok.version>1.18.22</lombok.version>
|
||||
<hutool.version>5.7.12</hutool.version>
|
||||
<metadata-extractor.version>2.16.0</metadata-extractor.version>
|
||||
</properties>
|
||||
|
||||
|
||||
<!-- 依赖列表 -->
|
||||
<dependencies>
|
||||
<!-- lombok-->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${lombok.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- 糊涂工具包,法大大验签指定版本-->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
<!-- 图片efi信息,识别ps,贵酒-->
|
||||
<dependency>
|
||||
<groupId>com.drewnoakes</groupId>
|
||||
<artifactId>metadata-extractor</artifactId>
|
||||
<version>${metadata-extractor.version}</version>
|
||||
</dependency>
|
||||
<!-- 单元测试-->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<!-- 为构建行为提供相应的支持 -->
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<!-- <resources>-->
|
||||
<!-- <resource>-->
|
||||
<!-- <directory>test/mybatisTest</directory>-->
|
||||
<!-- <includes>-->
|
||||
<!-- <include>**/*.xml</include>-->
|
||||
<!-- </includes>-->
|
||||
<!-- <filtering>true</filtering>-->
|
||||
<!-- </resource>-->
|
||||
<!-- </resources>-->
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
<!--mvn dependency:copy-dependencies-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<!--指定了当前pom的版本,4.0.0是固定的 -->
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<!-- 主项目标识,用来定义当前maven属于哪个实际的项目 -->
|
||||
<groupId>ecology-weaver</groupId>
|
||||
<!-- 模块名,maven项目和实际的项目不是一一对应的关系,maven项目提现的是模块化的概念,一个实际项目往往会被划分为很多个模块 -->
|
||||
<artifactId>ecology-weaver</artifactId>
|
||||
<!-- 当前项目版本号,一般有三个数字组成 第一个数字:大版本号 第二个数字:分支版本号 第三个数字:先版本号 snapshot: 快照 alpha:
|
||||
内测版本 beta: 公测版本 Release: 稳定版本 GA: 正式发布版本 -->
|
||||
<version>E9</version>
|
||||
<!-- maven项目打包方式,默认情况为jar,还可打包为war,zip,pom等 -->
|
||||
<packaging>war</packaging>
|
||||
<!-- 项目描述名 -->
|
||||
<name>ecology本地开发环境</name>
|
||||
<!-- 项目地址 -->
|
||||
<!-- <url></url>-->
|
||||
<!-- 项目描述 -->
|
||||
<description>ecology 本地开发环境E9</description>
|
||||
|
||||
<!-- 开发人员列表 -->
|
||||
<developers>
|
||||
<developer>
|
||||
<!-- 项目开发者的唯一标识符 -->
|
||||
<id>aiyh</id>
|
||||
<!-- 项目开发者的全名 -->
|
||||
<name>aiYouHong</name>
|
||||
<!-- 项目开发者的email -->
|
||||
<email>youhong.ai@weaver.com.cn</email>
|
||||
<!-- 项目开发者的主页的URL -->
|
||||
<url>https://gitee.com/it-xiaoxiong</url>
|
||||
<!-- 项目开发者在项目中扮演的角色,角色元素描述了各种角色 -->
|
||||
<roles>
|
||||
<role>二开</role>
|
||||
</roles>
|
||||
<!-- 项目开发者所属组织 -->
|
||||
<organization>泛微-昂泰</organization>
|
||||
<!-- 项目开发者所属组织的URL -->
|
||||
<organizationUrl>https://www.e-cology.com.cn/</organizationUrl>
|
||||
</developer>
|
||||
</developers>
|
||||
<!-- 许可证信息 -->
|
||||
<!-- <licenses></licenses>-->
|
||||
<!-- 组织信息 -->
|
||||
<!-- <organization></organization>-->
|
||||
|
||||
<properties>
|
||||
<project.build.resource.test.mapper>mybatisTest/mapper</project.build.resource.test.mapper>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<encoding>UTF-8</encoding>
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<lombok.version>1.18.22</lombok.version>
|
||||
<hutool.version>5.7.12</hutool.version>
|
||||
<metadata-extractor.version>2.16.0</metadata-extractor.version>
|
||||
</properties>
|
||||
|
||||
|
||||
<!-- 依赖列表 -->
|
||||
<dependencies>
|
||||
<!-- lombok-->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${lombok.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- 糊涂工具包,法大大验签指定版本-->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
<!-- 图片efi信息,识别ps,贵酒-->
|
||||
<dependency>
|
||||
<groupId>com.drewnoakes</groupId>
|
||||
<artifactId>metadata-extractor</artifactId>
|
||||
<version>${metadata-extractor.version}</version>
|
||||
</dependency>
|
||||
<!-- 单元测试-->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<!-- 为构建行为提供相应的支持 -->
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
</resources>
|
||||
<testResources>
|
||||
</testResources>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
<!--mvn dependency:copy-dependencies-->
|
||||
|
|
|
@ -2,8 +2,8 @@ package mybatisTest;
|
|||
|
||||
import aiyh.utils.MybatisUtil;
|
||||
import baseTest.BaseTest;
|
||||
import mybatisTest.dao.ITestDAO;
|
||||
import mybatisTest.entity.License;
|
||||
import mybatisTest.mapper.ITestMapper;
|
||||
import org.apache.ibatis.io.Resources;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
|
@ -27,7 +27,7 @@ public class MybatisTest extends BaseTest {
|
|||
Reader resourceAsReader = Resources.getResourceAsReader("WEB-INF/test-mybatis-config.xml");
|
||||
SqlSessionFactory build = new SqlSessionFactoryBuilder().build(resourceAsReader);
|
||||
session = build.openSession();
|
||||
ITestDAO mapper = session.getMapper(ITestDAO.class);
|
||||
ITestMapper mapper = session.getMapper(ITestMapper.class);
|
||||
// Map<String, String> map = mapper.selectOne();
|
||||
// System.err.println(map);
|
||||
session.close();
|
||||
|
@ -36,7 +36,7 @@ public class MybatisTest extends BaseTest {
|
|||
@Test
|
||||
public void test(){
|
||||
SqlSessionManager sessionManager = MybatisUtil.getSessionManager("test-mybatis-config.xml");
|
||||
ITestDAO mapper = sessionManager.getMapper(ITestDAO.class);
|
||||
ITestMapper mapper = sessionManager.getMapper(ITestMapper.class);
|
||||
License license = mapper.selectOne();
|
||||
System.out.println(license);
|
||||
}
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
package mybatisTest.dao;
|
||||
|
||||
import mybatisTest.entity.License;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author EBU7-dev1-ayh
|
||||
* create 2021/12/14 0014 13:20
|
||||
*/
|
||||
|
||||
|
||||
public interface ITestDAO {
|
||||
License selectOne();
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package mybatisTest.mapper;
|
||||
|
||||
import mybatisTest.entity.License;
|
||||
|
||||
/**
|
||||
* @author @author EBU7-dev1-ay
|
||||
* create 2021/12/16 0016 13:33
|
||||
*/
|
||||
|
||||
public interface ITestMapper {
|
||||
License selectOne();
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="mybatisTest.mapper.ITestMapper">
|
||||
<select id="selectOne" resultType="License">
|
||||
select companyname company_name,license,expiredate expire_date,CVERSION c_version from license;
|
||||
</select>
|
||||
</mapper>
|
|
@ -24,6 +24,7 @@
|
|||
</environments>
|
||||
|
||||
<mappers>
|
||||
<mapper resource="WEB-INF/mapper/test-mapper/ItestDAO.xml"/>
|
||||
<!-- <mapper resource="WEB-INF/mapper/test-mapper/ItestDAO.xml"/>-->
|
||||
<package name="mybatisTest.mapper"/>
|
||||
</mappers>
|
||||
</configuration>
|
Loading…
Reference in New Issue