查询个人信息和数据库更新

master
zxy19971014 6 years ago
parent 1942cd395a
commit d6b06dfd04

@ -13,7 +13,7 @@
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.4.0", "libVersion": "2.4.0",
"appid": "wxb280d1925541c356", "appid": "wxb280d1925541c356",
"projectname": "%E7%9C%9F%E9%A6%9913", "projectname": "33",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
}, },

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" path="src/main/java"/> <classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

@ -1,42 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>yhSearch</name> <name>yhSearch</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand> <buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name> <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name> <name>org.eclipse.jdt.core.javabuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name> <name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name> <name>org.eclipse.m2e.core.maven2Builder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name> <name>org.eclipse.wst.validation.validationbuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature> <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src/main/webapp"/> <classpathentry kind="src" path="src/main/webapp"/>
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/> <classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"> <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes> <attributes>
<attribute name="hide" value="true"/> <attribute name="hide" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/> <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/> <classpathentry kind="output" path=""/>
</classpath> </classpath>

@ -1,8 +1,8 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5 org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5 org.eclipse.jdt.core.compiler.source=1.5

@ -1,4 +1,4 @@
activeProfiles= activeProfiles=
eclipse.preferences.version=1 eclipse.preferences.version=1
resolveWorkspaceProjects=true resolveWorkspaceProjects=true
version=1 version=1

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="yhSearch"> <wb-module deploy-name="yhSearch">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<property name="context-root" value="yhSearch"/> <property name="context-root" value="yhSearch"/>
<property name="java-output-path" value="/yhSearch/target/classes"/> <property name="java-output-path" value="/yhSearch/target/classes"/>
</wb-module> </wb-module>
</project-modules> </project-modules>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<faceted-project> <faceted-project>
<fixed facet="wst.jsdt.web"/> <fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.5"/> <installed facet="java" version="1.5"/>
<installed facet="jst.web" version="2.3"/> <installed facet="jst.web" version="2.3"/>
<installed facet="wst.jsdt.web" version="1.0"/> <installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project> </faceted-project>

@ -1,2 +1,2 @@
disabled=06target disabled=06target
eclipse.preferences.version=1 eclipse.preferences.version=1

@ -14,33 +14,40 @@
<!-- Spring --> <!-- Spring -->
<spring.version>4.3.10.RELEASE</spring.version> <spring.version>4.3.10.RELEASE</spring.version>
</properties> </properties>
<dependencies> <dependencies>
<!-- mysql数据库驱动类 --> <dependency>
<dependency> <groupId>com.alibaba</groupId>
<groupId>mysql</groupId> <artifactId>fastjson</artifactId>
<artifactId>mysql-connector-java</artifactId> <version>1.2.44</version>
<version>5.1.46</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>3.8.1</version> <version>3.8.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- 导入MyBatis生成器 --> <!-- mysql数据库驱动类 -->
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
</dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<version>5.1.46</version> <version>5.1.46</version>
</dependency> </dependency>
<!-- Spring -->
<!-- 1)包含Spring 框架基本的核心工具类。Spring 其它组件要都要使用到这个包里的类, <!-- 导入MyBatis生成器 -->
是其它组件的基本核心 --> <!-- https://mvnrepository.com/artifact/org.mybatis.generator/mybatis-generator-core -->
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
</dependency>
<!-- Spring -->
<!-- 1)包含Spring 框架基本的核心工具类。Spring 其它组件要都要使用到这个包里的类, 是其它组件的基本核心 -->
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId> <artifactId>spring-core</artifactId>
@ -92,8 +99,7 @@
<version>${spring.version}</version> <version>${spring.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- DAO: MyBatis -->
<!-- DAO: MyBatis -->
<dependency> <dependency>
<groupId>org.mybatis</groupId> <groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId> <artifactId>mybatis</artifactId>
@ -104,6 +110,7 @@
<artifactId>mybatis-spring</artifactId> <artifactId>mybatis-spring</artifactId>
<version>1.3.1</version> <version>1.3.1</version>
</dependency> </dependency>
<!-- 连接技术 -->
<dependency> <dependency>
<groupId>c3p0</groupId> <groupId>c3p0</groupId>
<artifactId>c3p0</artifactId> <artifactId>c3p0</artifactId>
@ -114,19 +121,23 @@
<artifactId>commons-dbcp</artifactId> <artifactId>commons-dbcp</artifactId>
<version>1.4</version> <version>1.4</version>
</dependency> </dependency>
<!-- 单元测试 --> <!-- Servlet web -->
<!-- https://mvnrepository.com/artifact/junit/junit --> <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency> <dependency>
<groupId>junit</groupId> <groupId>javax.servlet</groupId>
<artifactId>junit</artifactId> <artifactId>javax.servlet-api</artifactId>
<version>4.12</version> <version>3.1.0</version>
<scope>test</scope> <scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>booksService</finalName> <plugins>
<plugins><!--插件--> <!-- 配置JDK插件 -->
<!-- 配置JDK插件 -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
@ -137,18 +148,17 @@
<skip>true</skip> <skip>true</skip>
</configuration> </configuration>
</plugin> </plugin>
<!-- 配置MyBatis生成器插件 --> <plugin>
<plugin> <groupId>org.mybatis.generator</groupId>
<groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId>
<artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.5</version>
<version>1.3.5</version> <configuration>
<configuration> <!--配置文件的路径 -->
<!--配置文件的路径 --> <configurationFile>${basedir}/src/main/resources/generatorConfig.xml</configurationFile>
<configurationFile>${basedir}/src/main/resources/generatorConfig.xml</configurationFile> <overwrite>true</overwrite>
<overwrite>true</overwrite> </configuration>
</configuration> </plugin>
</plugin> </plugins>
</plugins> <finalName>zxbook</finalName>
</build> </build>
</project> </project>

@ -1,32 +1,51 @@
package controller; package controller;
import org.springframework.beans.factory.annotation.Autowired; import java.io.IOException;
import org.springframework.beans.factory.annotation.Qualifier; import java.io.PrintWriter;
import org.springframework.stereotype.Controller; import java.io.Writer;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import domain.yhPO;
import service.yhService; import org.springframework.beans.factory.annotation.Autowired;
@Controller import org.springframework.beans.factory.annotation.Qualifier;
public class yhController { import org.springframework.stereotype.Controller;
@Autowired@Qualifier("yhServiceImpl") import org.springframework.web.bind.annotation.RequestMapping;
private yhService yhService;
import com.google.gson.Gson;
@RequestMapping("/search")
public String search(Model model,String s_id){ import domain.yhPO;
yhPO yhPO=yhService.search(s_id); import service.yhService;
model.addAttribute("s_id", yhPO.getS_id()); @Controller
model.addAttribute("s_name", yhPO.getS_name()); public class yhController {
model.addAttribute("s_password", yhPO.getS_password()); @Autowired@Qualifier("yhServiceImpl")
private yhService yhService;
} @RequestMapping("find2")
public void find1(String search,HttpServletRequest request, HttpServletResponse response) throws IOException {
@RequestMapping("/update") response.setContentType("text/html;charset=utf-8");
public String update(yhPO yhPO){ /* 设置响应头允许ajax跨域访问 */
yhService.update(yhPO); response.setHeader("Access-Control-Allow-Origin", "*");
/* 星号表示所有的异域请求都可以接受, */
} response.setHeader("Access-Control-Allow-Methods", "GET,POST");
yhPO yhPO=this.yhService.FindBysname(search);
if(yhPO!=null) {
} String ss = new Gson().toJson(yhPO);
System.out.println(ss);
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
out.print(ss);
out.flush();
out.close();
}
else
{
System.out.println("查询失败");
Writer out = response.getWriter();
out.write("zhaobudao");
out.flush();
}
}
}

@ -1,35 +1,35 @@
package domain; package domain;
import java.io.Serializable; import java.io.Serializable;
public class yhPO implements Serializable { public class yhPO implements Serializable {
private String s_id; private String s_id;
private String s_name; private String s_name;
private String s_password; private String s_password;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public String getS_id() { public String getS_id() {
return s_id; return s_id;
} }
public void setS_id(String s_id) { public void setS_id(String s_id) {
this.s_id = s_id; this.s_id = s_id;
} }
public String getS_name() { public String getS_name() {
return s_name; return s_name;
} }
public void setS_name(String s_name) { public void setS_name(String s_name) {
this.s_name = s_name; this.s_name = s_name;
} }
public String getS_password() { public String getS_password() {
return s_password; return s_password;
} }
public void setS_password(String s_password) { public void setS_password(String s_password) {
this.s_password = s_password; this.s_password = s_password;
} }
} }

@ -1,16 +1,16 @@
package mapperDAO; package mapperDAO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import domain.yhPO; import domain.yhPO;
@Repository("yhMapperDao") @Repository("yhMapperDao")
public interface yhMapperDao { public interface yhMapperDao {
public yhPO search(String s_id); public yhPO FindBysname(String search );
public void update(yhPO yhPO); public void update(yhPO yhPO);
} }

@ -1,13 +1,13 @@
package service; package service;
import domain.yhPO; import domain.yhPO;
public interface yhService { public interface yhService {
public yhPO search(String bs_id); public yhPO FindBysname(String search );
public void update(yhPO yhpo); public void update(yhPO yhpo);
} }

@ -1,32 +1,30 @@
package serviceimpl; package serviceimpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import domain.yhPO; import domain.yhPO;
import mapperDAO.yhMapperDao; import service.yhService;
import service.yhService; import mapperDAO.yhMapperDao;
@Component("yhServiceImpl")
@Component("yhServiceImpl") public class yhServiceImpl implements yhService{
public class yhServiceImpl implements yhService{ @Autowired@Qualifier("yhMapperDao")
@Autowired@Qualifier("yhMapperDao") private yhMapperDao yhMapperDAO;
private yhMapperDao yhMapperDao;
public yhPO FindBysname(String search) {
public yhPO search(String s_id) { // TODO Auto-generated method stub
return this.yhMapperDao.search(s_id); return this.yhMapperDAO.FindBysname(search);
}
}
public void update(yhPO yhpo) {
// TODO Auto-generated method stub
public void update(yhPO yhpo) {
// TODO Auto-generated method stub }
yhMapperDao.update(yhpo);
}
}
}

@ -1,52 +1,52 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" > <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<generatorConfiguration> <generatorConfiguration>
<!-- JDBC数据库驱动jar文件 --> <!-- JDBC数据库驱动jar文件 -->
<classPathEntry location="H:\Maven\repository\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar" /> <classPathEntry location="H:\Maven\repository\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar" />
<context id="context1" defaultModelType="flat"> <context id="context1" defaultModelType="flat">
<!-- PO序列化 --> <!-- PO序列化 -->
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"> <plugin type="org.mybatis.generator.plugins.SerializablePlugin">
</plugin> </plugin>
<commentGenerator> <commentGenerator>
<!-- 是否去除自动生成的注释 true false:否 --> <!-- 是否去除自动生成的注释 true false:否 -->
<property name="suppressAllComments" value="false" /> <property name="suppressAllComments" value="false" />
</commentGenerator> </commentGenerator>
<!-- 配置一个连接 --> <!-- 配置一个连接 -->
<jdbcConnection <jdbcConnection
driverClass="com.mysql.jdbc.Driver" driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/zx" connectionURL="jdbc:mysql://127.0.0.1:3306/zx"
userId="root" userId="root"
password="zxy19971014"> password="zxy19971014">
</jdbcConnection> </jdbcConnection>
<javaTypeResolver> <javaTypeResolver>
<property name="forceBigDecimals" value="false" /> <property name="forceBigDecimals" value="false" />
</javaTypeResolver> </javaTypeResolver>
<!--生成实体类存放位置 --> <!--生成实体类存放位置 -->
<javaModelGenerator targetPackage="edu.zx.domin" <javaModelGenerator targetPackage="edu.zx.domin"
targetProject="src/main/java"> targetProject="src/main/java">
<property name="trimStrings" value="true" /> <property name="trimStrings" value="true" />
</javaModelGenerator> </javaModelGenerator>
<!--生成映射文件存放位置 --> <!--生成映射文件存放位置 -->
<sqlMapGenerator targetPackage="mapper" <sqlMapGenerator targetPackage="mapper"
targetProject="src/main/resources"> targetProject="src/main/resources">
<property name="trimStrings" value="true" /> <property name="trimStrings" value="true" />
</sqlMapGenerator> </sqlMapGenerator>
<!--生成Mapper接口存放位置 --> <!--生成Mapper接口存放位置 -->
<javaClientGenerator targetPackage="edu.peter.mapper" <javaClientGenerator targetPackage="edu.peter.mapper"
targetProject="src/main/java" type="XMLMAPPER" /> targetProject="src/main/java" type="XMLMAPPER" />
<table schema="hunnu" tableName="goods_type" enableCountByExample="false" <table schema="hunnu" tableName="goods_type" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false"> enableSelectByExample="false" selectByExampleQueryId="false">
</table> </table>
<table schema="hunnu" tableName="goods" enableCountByExample="false" <table schema="hunnu" tableName="goods" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false"> enableSelectByExample="false" selectByExampleQueryId="false">
</table> </table>
</context> </context>
</generatorConfiguration> </generatorConfiguration>

@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="mapperDAO.yhMapperDao"> <mapper namespace="mapperDAO.yhMapperDao">
<resultMap id="yhMap" type="domain.yhPO"> <resultMap id="yhMap" type="domain.yhPO">
<id column="s_id" jdbcType="int" property="s_id" /> <id column="s_id" jdbcType="int" property="s_id" />
<result column="s_password" jdbcType="VARCHAR" property="s_password" /> <result column="s_password" jdbcType="VARCHAR" property="s_password" />
<result column="s_name" jdbcType="VARCHAR" property="s_name" /> <result column="s_name" jdbcType="VARCHAR" property="s_name" />
</resultMap> </resultMap>
<select id="search" resultMap="yhMap" parameterType="String"> <select id="FindBysname" resultMap="yhMap" parameterType="String">
SELECT SELECT
student.s_id, student.s_id,
student.s_name, student.s_name,
student.s_password, student.s_password,
FROM FROM
student student
WHERE WHERE
student.s_id=#{s_id} student.s_id=#{search}
</select> </select>
<select id="update" parameterType="domain.yhPO"> <select id="update" parameterType="domain.yhPO">
UPDATE yh.student UPDATE yh.student
SET s_id=#{s_id},s_password=#{s_password},s_name=#{s_name} SET s_id=#{s_id},s_password=#{s_password},s_name=#{s_name}
WHERE student.s_id=#{s_id}; WHERE student.s_id=#{s_id};
</select> </select>
</mapper> </mapper>

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd"> "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration> <configuration>
</configuration> </configuration>

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd"> http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
<!-- 打开Spring的注解 --> <!-- 打开Spring的注解 -->
<context:annotation-config /> <context:annotation-config />
<context:component-scan base-package="mapperDAO,controller,serviceimpl"/> <context:component-scan base-package="mapperDAO,controller,serviceimpl"/>
</beans> </beans>

@ -1,51 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.3.xsd"> http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
<!-- 整合MyBatis 开始 --> <!-- 整合MyBatis 开始 -->
<!--创建jdbc数据源 --> <!--创建jdbc数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="username" value="root" /> <property name="username" value="root" />
<property name="password" value="zxy19971014" /> <property name="password" value="zxy19971014" />
<property name="url" <property name="url"
value="jdbc:mysql://127.0.0.1:3306/zx?useUnicode=true&amp;characterEncoding=utf8" /> value="jdbc:mysql://127.0.0.1:3306/zx?useUnicode=true&amp;characterEncoding=utf8" />
</bean> </bean>
<!-- 配置MyBatis的sqlSession --> <!-- 配置MyBatis的sqlSession -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="configLocation" value="classpath:mybatis.xml" /> <property name="configLocation" value="classpath:mybatis.xml" />
<property name="mapperLocations" value="classpath:mapper/*.xml" /> <property name="mapperLocations" value="classpath:mapper/*.xml" />
<property name="dataSource" ref="dataSource" /> <property name="dataSource" ref="dataSource" />
<!-- 加载分页插件 --> <!-- 加载分页插件 -->
<property name="plugins"> <property name="plugins">
<array> <array>
<bean class="com.github.pagehelper.PageHelper"> <bean class="com.github.pagehelper.PageHelper">
<property name="properties"> <property name="properties">
<value> <value>
dialect=mysql dialect=mysql
reasonable=true reasonable=true
</value> </value>
</property> </property>
</bean> </bean>
</array> </array>
</property> </property>
</bean> </bean>
<!-- 映射Mapper目录 --> <!-- 映射Mapper目录 -->
<!-- Mapper接口所在包名Spring会自动查找其下的Mapper --> <!-- Mapper接口所在包名Spring会自动查找其下的Mapper -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="edu.zx.mapper" /> <property name="basePackage" value="edu.zx.mapper" />
</bean> </bean>
<!-- 可通过注解控制事务 --> <!-- 可通过注解控制事务 -->
<tx:annotation-driven transaction-manager="transactionManager" /> <tx:annotation-driven transaction-manager="transactionManager" />
<bean id="transactionManager" <bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" /> <property name="dataSource" ref="dataSource" />
</bean> </bean>
<!-- 整合MyBatis 结束 --> <!-- 整合MyBatis 结束 -->
</beans> </beans>

@ -1,7 +1,20 @@
<!DOCTYPE web-app PUBLIC <!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" > "http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app> <web-app>
<display-name>Archetype Created Web Application</display-name> <display-name>Archetype Created Web Application</display-name>
</web-app> <!-- Processes application requests -->
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-*.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>

@ -1,52 +1,52 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" > <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<generatorConfiguration> <generatorConfiguration>
<!-- JDBC数据库驱动jar文件 --> <!-- JDBC数据库驱动jar文件 -->
<classPathEntry location="H:\Maven\repository\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar" /> <classPathEntry location="H:\Maven\repository\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar" />
<context id="context1" defaultModelType="flat"> <context id="context1" defaultModelType="flat">
<!-- PO序列化 --> <!-- PO序列化 -->
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"> <plugin type="org.mybatis.generator.plugins.SerializablePlugin">
</plugin> </plugin>
<commentGenerator> <commentGenerator>
<!-- 是否去除自动生成的注释 true false:否 --> <!-- 是否去除自动生成的注释 true false:否 -->
<property name="suppressAllComments" value="false" /> <property name="suppressAllComments" value="false" />
</commentGenerator> </commentGenerator>
<!-- 配置一个连接 --> <!-- 配置一个连接 -->
<jdbcConnection <jdbcConnection
driverClass="com.mysql.jdbc.Driver" driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/zx" connectionURL="jdbc:mysql://127.0.0.1:3306/zx"
userId="root" userId="root"
password="zxy19971014"> password="zxy19971014">
</jdbcConnection> </jdbcConnection>
<javaTypeResolver> <javaTypeResolver>
<property name="forceBigDecimals" value="false" /> <property name="forceBigDecimals" value="false" />
</javaTypeResolver> </javaTypeResolver>
<!--生成实体类存放位置 --> <!--生成实体类存放位置 -->
<javaModelGenerator targetPackage="edu.zx.domin" <javaModelGenerator targetPackage="edu.zx.domin"
targetProject="src/main/java"> targetProject="src/main/java">
<property name="trimStrings" value="true" /> <property name="trimStrings" value="true" />
</javaModelGenerator> </javaModelGenerator>
<!--生成映射文件存放位置 --> <!--生成映射文件存放位置 -->
<sqlMapGenerator targetPackage="mapper" <sqlMapGenerator targetPackage="mapper"
targetProject="src/main/resources"> targetProject="src/main/resources">
<property name="trimStrings" value="true" /> <property name="trimStrings" value="true" />
</sqlMapGenerator> </sqlMapGenerator>
<!--生成Mapper接口存放位置 --> <!--生成Mapper接口存放位置 -->
<javaClientGenerator targetPackage="edu.peter.mapper" <javaClientGenerator targetPackage="edu.peter.mapper"
targetProject="src/main/java" type="XMLMAPPER" /> targetProject="src/main/java" type="XMLMAPPER" />
<table schema="hunnu" tableName="goods_type" enableCountByExample="false" <table schema="hunnu" tableName="goods_type" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false"> enableSelectByExample="false" selectByExampleQueryId="false">
</table> </table>
<table schema="hunnu" tableName="goods" enableCountByExample="false" <table schema="hunnu" tableName="goods" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false"> enableSelectByExample="false" selectByExampleQueryId="false">
</table> </table>
</context> </context>
</generatorConfiguration> </generatorConfiguration>

@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="mapperDAO.yhMapperDao"> <mapper namespace="mapperDAO.yhMapperDao">
<resultMap id="yhMap" type="domain.yhPO"> <resultMap id="yhMap" type="domain.yhPO">
<id column="s_id" jdbcType="int" property="s_id" /> <id column="s_id" jdbcType="int" property="s_id" />
<result column="s_password" jdbcType="VARCHAR" property="s_password" /> <result column="s_password" jdbcType="VARCHAR" property="s_password" />
<result column="s_name" jdbcType="VARCHAR" property="s_name" /> <result column="s_name" jdbcType="VARCHAR" property="s_name" />
</resultMap> </resultMap>
<select id="search" resultMap="yhMap" parameterType="String"> <select id="FindBysname" resultMap="yhMap" parameterType="String">
SELECT SELECT
student.s_id, student.s_id,
student.s_name, student.s_name,
student.s_password, student.s_password,
FROM FROM
student student
WHERE WHERE
student.s_id=#{s_id} student.s_id=#{search}
</select> </select>
<select id="update" parameterType="domain.yhPO"> <select id="update" parameterType="domain.yhPO">
UPDATE yh.student UPDATE yh.student
SET s_id=#{s_id},s_password=#{s_password},s_name=#{s_name} SET s_id=#{s_id},s_password=#{s_password},s_name=#{s_name}
WHERE student.s_id=#{s_id}; WHERE student.s_id=#{s_id};
</select> </select>
</mapper> </mapper>

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd"> "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration> <configuration>
</configuration> </configuration>

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd"> http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
<!-- 打开Spring的注解 --> <!-- 打开Spring的注解 -->
<context:annotation-config /> <context:annotation-config />
<context:component-scan base-package="mapperDAO,controller,serviceimpl"/> <context:component-scan base-package="mapperDAO,controller,serviceimpl"/>
</beans> </beans>

@ -1,51 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.3.xsd"> http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
<!-- 整合MyBatis 开始 --> <!-- 整合MyBatis 开始 -->
<!--创建jdbc数据源 --> <!--创建jdbc数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="username" value="root" /> <property name="username" value="root" />
<property name="password" value="zxy19971014" /> <property name="password" value="zxy19971014" />
<property name="url" <property name="url"
value="jdbc:mysql://127.0.0.1:3306/zx?useUnicode=true&amp;characterEncoding=utf8" /> value="jdbc:mysql://127.0.0.1:3306/zx?useUnicode=true&amp;characterEncoding=utf8" />
</bean> </bean>
<!-- 配置MyBatis的sqlSession --> <!-- 配置MyBatis的sqlSession -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="configLocation" value="classpath:mybatis.xml" /> <property name="configLocation" value="classpath:mybatis.xml" />
<property name="mapperLocations" value="classpath:mapper/*.xml" /> <property name="mapperLocations" value="classpath:mapper/*.xml" />
<property name="dataSource" ref="dataSource" /> <property name="dataSource" ref="dataSource" />
<!-- 加载分页插件 --> <!-- 加载分页插件 -->
<property name="plugins"> <property name="plugins">
<array> <array>
<bean class="com.github.pagehelper.PageHelper"> <bean class="com.github.pagehelper.PageHelper">
<property name="properties"> <property name="properties">
<value> <value>
dialect=mysql dialect=mysql
reasonable=true reasonable=true
</value> </value>
</property> </property>
</bean> </bean>
</array> </array>
</property> </property>
</bean> </bean>
<!-- 映射Mapper目录 --> <!-- 映射Mapper目录 -->
<!-- Mapper接口所在包名Spring会自动查找其下的Mapper --> <!-- Mapper接口所在包名Spring会自动查找其下的Mapper -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="edu.zx.mapper" /> <property name="basePackage" value="edu.zx.mapper" />
</bean> </bean>
<!-- 可通过注解控制事务 --> <!-- 可通过注解控制事务 -->
<tx:annotation-driven transaction-manager="transactionManager" /> <tx:annotation-driven transaction-manager="transactionManager" />
<bean id="transactionManager" <bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" /> <property name="dataSource" ref="dataSource" />
</bean> </bean>
<!-- 整合MyBatis 结束 --> <!-- 整合MyBatis 结束 -->
</beans> </beans>

@ -1,5 +1,5 @@
Manifest-Version: 1.0 Manifest-Version: 1.0
Built-By: yuanhangpc Built-By: yuanhangpc
Build-Jdk: 1.8.0_152 Build-Jdk: 1.8.0_152
Created-By: Maven Integration for Eclipse Created-By: Maven Integration for Eclipse

@ -1,7 +1,7 @@
#Generated by Maven Integration for Eclipse #Generated by Maven Integration for Eclipse
#Sat Jan 12 16:17:25 CST 2019 #Mon Jan 14 16:52:07 CST 2019
version=0.0.1-SNAPSHOT version=0.0.1-SNAPSHOT
groupId=yonghu groupId=yonghu
m2e.projectName=yhSearch m2e.projectName=yhSearch
m2e.projectLocation=H\:\\sts-bundle\\yhSearch m2e.projectLocation=H\:\\sts-bundle\\yhSearch
artifactId=yhSearch artifactId=yhSearch

@ -14,33 +14,40 @@
<!-- Spring --> <!-- Spring -->
<spring.version>4.3.10.RELEASE</spring.version> <spring.version>4.3.10.RELEASE</spring.version>
</properties> </properties>
<dependencies> <dependencies>
<!-- mysql数据库驱动类 --> <dependency>
<dependency> <groupId>com.alibaba</groupId>
<groupId>mysql</groupId> <artifactId>fastjson</artifactId>
<artifactId>mysql-connector-java</artifactId> <version>1.2.44</version>
<version>5.1.46</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>3.8.1</version> <version>3.8.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- 导入MyBatis生成器 --> <!-- mysql数据库驱动类 -->
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
</dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<version>5.1.46</version> <version>5.1.46</version>
</dependency> </dependency>
<!-- Spring -->
<!-- 1)包含Spring 框架基本的核心工具类。Spring 其它组件要都要使用到这个包里的类, <!-- 导入MyBatis生成器 -->
是其它组件的基本核心 --> <!-- https://mvnrepository.com/artifact/org.mybatis.generator/mybatis-generator-core -->
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
</dependency>
<!-- Spring -->
<!-- 1)包含Spring 框架基本的核心工具类。Spring 其它组件要都要使用到这个包里的类, 是其它组件的基本核心 -->
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId> <artifactId>spring-core</artifactId>
@ -92,8 +99,7 @@
<version>${spring.version}</version> <version>${spring.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- DAO: MyBatis -->
<!-- DAO: MyBatis -->
<dependency> <dependency>
<groupId>org.mybatis</groupId> <groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId> <artifactId>mybatis</artifactId>
@ -104,6 +110,7 @@
<artifactId>mybatis-spring</artifactId> <artifactId>mybatis-spring</artifactId>
<version>1.3.1</version> <version>1.3.1</version>
</dependency> </dependency>
<!-- 连接技术 -->
<dependency> <dependency>
<groupId>c3p0</groupId> <groupId>c3p0</groupId>
<artifactId>c3p0</artifactId> <artifactId>c3p0</artifactId>
@ -114,19 +121,23 @@
<artifactId>commons-dbcp</artifactId> <artifactId>commons-dbcp</artifactId>
<version>1.4</version> <version>1.4</version>
</dependency> </dependency>
<!-- 单元测试 --> <!-- Servlet web -->
<!-- https://mvnrepository.com/artifact/junit/junit --> <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency> <dependency>
<groupId>junit</groupId> <groupId>javax.servlet</groupId>
<artifactId>junit</artifactId> <artifactId>javax.servlet-api</artifactId>
<version>4.12</version> <version>3.1.0</version>
<scope>test</scope> <scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>booksService</finalName> <plugins>
<plugins><!--插件--> <!-- 配置JDK插件 -->
<!-- 配置JDK插件 -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
@ -137,18 +148,17 @@
<skip>true</skip> <skip>true</skip>
</configuration> </configuration>
</plugin> </plugin>
<!-- 配置MyBatis生成器插件 --> <plugin>
<plugin> <groupId>org.mybatis.generator</groupId>
<groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId>
<artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.5</version>
<version>1.3.5</version> <configuration>
<configuration> <!--配置文件的路径 -->
<!--配置文件的路径 --> <configurationFile>${basedir}/src/main/resources/generatorConfig.xml</configurationFile>
<configurationFile>${basedir}/src/main/resources/generatorConfig.xml</configurationFile> <overwrite>true</overwrite>
<overwrite>true</overwrite> </configuration>
</configuration> </plugin>
</plugin> </plugins>
</plugins> <finalName>zxbook</finalName>
</build> </build>
</project> </project>

@ -3,14 +3,14 @@ Navicat MySQL Data Transfer
Source Server : localhost Source Server : localhost
Source Server Version : 50639 Source Server Version : 50639
Source Host : localhost:3306 Source Host : 127.0.0.1:3306
Source Database : zx Source Database : zx
Target Server Type : MYSQL Target Server Type : MYSQL
Target Server Version : 50639 Target Server Version : 50639
File Encoding : 65001 File Encoding : 65001
Date: 2019-01-14 15:20:33 Date: 2019-01-14 17:31:38
*/ */
SET FOREIGN_KEY_CHECKS=0; SET FOREIGN_KEY_CHECKS=0;
@ -31,7 +31,7 @@ CREATE TABLE `book` (
-- ---------------------------- -- ----------------------------
-- Records of book -- Records of book
-- ---------------------------- -- ----------------------------
INSERT INTO `book` VALUES ('1', '四书五经合集', '古代多人', '20', '文学名著类'); INSERT INTO `book` VALUES ('1', '四书五经合集', '古代多人', '20', '文学名著类');
INSERT INTO `book` VALUES ('10', '《格列佛游记》', '佚名', '18', '文学名著类'); INSERT INTO `book` VALUES ('10', '《格列佛游记》', '佚名', '18', '文学名著类');
INSERT INTO `book` VALUES ('11', '《洛丽塔》', '佚名', '18', '文学名著类'); INSERT INTO `book` VALUES ('11', '《洛丽塔》', '佚名', '18', '文学名著类');
INSERT INTO `book` VALUES ('12', '《林徽因传》', '张清平', '16', '文学名著类'); INSERT INTO `book` VALUES ('12', '《林徽因传》', '张清平', '16', '文学名著类');

Loading…
Cancel
Save