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