集成mybatis和改造maven
parent
d4176b69c4
commit
2461fb044c
|
@ -18,7 +18,7 @@ log
|
||||||
classbeanLib/*
|
classbeanLib/*
|
||||||
weaverLib/*
|
weaverLib/*
|
||||||
/web/**/*.properties
|
/web/**/*.properties
|
||||||
/web/**/*.xml
|
!/web/**/*.xml
|
||||||
/target
|
/target
|
||||||
/classbean
|
/classbean
|
||||||
.idea/
|
.idea/
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
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,16 @@
|
||||||
|
package mybatisTest.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author EBU7-dev1-ayh
|
||||||
|
* create 2021/12/14 0014 16:31
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class License {
|
||||||
|
private String license;
|
||||||
|
private String companyName;
|
||||||
|
private String cVersion;
|
||||||
|
private String expireDate;
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
|
||||||
|
<log4j:configuration debug="false">
|
||||||
|
<!--Console appender -->
|
||||||
|
<appender name="stdout" class="org.apache.log4j.ConsoleAppender">
|
||||||
|
<layout class="org.apache.log4j.PatternLayout">
|
||||||
|
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %p %m%n"/>
|
||||||
|
</layout>
|
||||||
|
</appender>
|
||||||
|
<logger name="java.sql">
|
||||||
|
<level value="debug" />
|
||||||
|
</logger>
|
||||||
|
<logger name="org.apache.ibatis">
|
||||||
|
<level value="info" />
|
||||||
|
</logger>
|
||||||
|
<root>
|
||||||
|
<level value="DEBUG"/>
|
||||||
|
<appender-ref ref="stdout"/>
|
||||||
|
</root>
|
||||||
|
</log4j:configuration>
|
|
@ -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.dao.ITestDAO">
|
||||||
|
<select id="selectOne" resultType="License">
|
||||||
|
select companyname company_name,license,expiredate expire_date,CVERSION c_version from license;
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE configuration
|
||||||
|
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||||
|
<configuration>
|
||||||
|
<properties resource="WEB-INF/prop/weaver.properties" />
|
||||||
|
<settings>
|
||||||
|
<!-- 下换线转驼峰-->
|
||||||
|
<setting name="mapUnderscoreToCamelCase" value="true"/>
|
||||||
|
</settings>
|
||||||
|
<typeAliases>
|
||||||
|
<package name="mybatisTest.entity"/>
|
||||||
|
</typeAliases>
|
||||||
|
<environments default="development">
|
||||||
|
<environment id="development">
|
||||||
|
<transactionManager type="JDBC" />
|
||||||
|
<dataSource type="POOLED">
|
||||||
|
<property name="driver" value="${DriverClasses}" />
|
||||||
|
<property name="url" value="${ecology.url}" />
|
||||||
|
<property name="username" value="${ecology.user}" />
|
||||||
|
<property name="password" value="${ecology.password}" />
|
||||||
|
</dataSource>
|
||||||
|
</environment>
|
||||||
|
</environments>
|
||||||
|
|
||||||
|
<mappers>
|
||||||
|
<mapper resource="WEB-INF/mapper/test-mapper/ItestDAO.xml"/>
|
||||||
|
</mappers>
|
||||||
|
</configuration>
|
Loading…
Reference in New Issue