查找更新

master
zjh19990323 6 years ago
parent 84ff48056f
commit 8d72075194

@ -1,23 +1,17 @@
// chazhao/chazhao.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
Page({
shujichzhao: function (e) {
wx.request({
url: 'http://localhost:9527/zxbook/find1',
data: {
'search': e.detail.value.search,
},
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
/**
* 组件的方法列表
*/
methods: {
method: "POST",
}
})
}
})

@ -1,13 +1,15 @@
<!--chazhao/chazhao.wxml-->
<view class='page_row' bindtap="suo">
<form bindsubmit="shujichzhao" >
<view class='page_row' >
<view class="search">
<view class="df search_arr">
<icon class="searchcion" size='20' type='search'></icon>
<input placeholder="请输入书名或书号查询" value="{{searchValue}}"confirm-type="search"/>
<input placeholder="请输入书名或书号查询" value="{{searchValue}}"confirm-type="search"name="search"/>
</view>
</view>
<button class="button1" form-type="submit" >搜索</button>
</view>
</form>
<view class='page_row'>
<view class="font">分类</view>
<image class="image1"src="/image/1.png">

@ -1,4 +1,4 @@
<view class="c-minheight wx-view_3ZhLNq" />
<text class="c-block wx-text_efNLZY" >书名:</text>
<text class="c-block wx-text_07leZC" >书号:</text>
<text class="c-block wx-text_MWTyqb" >作者</text>
<text class="c-block wx-text_MWTyqb" >作者</text>

@ -2,7 +2,7 @@
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<generatorConfiguration>
<!-- JDBC数据库驱动jar文件 -->
<classPathEntry location="H:\Maven\repository\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar" />
<classPathEntry location="D:\maven\repository\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar" />
<context id="context1" defaultModelType="flat">
<!-- PO序列化 -->
<plugin type="org.mybatis.generator.plugins.SerializablePlugin">
@ -17,7 +17,7 @@
driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/zx"
userId="root"
password="zxy19971014">
password="zjh19990323">
</jdbcConnection>
<javaTypeResolver>
@ -25,7 +25,7 @@
</javaTypeResolver>
<!--生成实体类存放位置 -->
<javaModelGenerator targetPackage="edu.zx.domin"
<javaModelGenerator targetPackage="domain"
targetProject="src/main/java">
<property name="trimStrings" value="true" />
</javaModelGenerator>
@ -37,16 +37,13 @@
</sqlMapGenerator>
<!--生成Mapper接口存放位置 -->
<javaClientGenerator targetPackage="edu.peter.mapper"
<javaClientGenerator targetPackage="mapperDAO"
targetProject="src/main/java" type="XMLMAPPER" />
<table schema="hunnu" tableName="goods_type" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
</table>
<table schema="hunnu" tableName="goods" enableCountByExample="false"
<table schema="zx" tableName="student" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
</table>
</context>
</generatorConfiguration>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<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"
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">
<!-- 打开Spring的注解 -->
<context:annotation-config />
<context:component-scan base-package="mapperDAO,controller,serviceimpl"/>
</beans>

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
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.xsd">
<!-- 打开SpringMVC的注解 -->
<annotation-driven />
<!-- 配置静态资源的目录 -->
<resources mapping="/resources/**" location="/resources/" />
<!-- 配置视图处理器 -->
<beans:bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 视图前缀 -->
<beans:property name="prefix" value="/WEB-INF/view/" />
<!-- 视图后缀 -->
<beans:property name="suffix" value=".jsp" />
</beans:bean>
</beans:beans>

@ -13,7 +13,7 @@
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="username" value="root" />
<property name="password" value="zxy19971014" />
<property name="password" value="zjh19990323" />
<property name="url"
value="jdbc:mysql://127.0.0.1:3306/zx?useUnicode=true&amp;characterEncoding=utf8" />
</bean>
@ -22,24 +22,11 @@
<property name="configLocation" value="classpath:mybatis.xml" />
<property name="mapperLocations" value="classpath:mapper/*.xml" />
<property name="dataSource" ref="dataSource" />
<!-- 加载分页插件 -->
<property name="plugins">
<array>
<bean class="com.github.pagehelper.PageHelper">
<property name="properties">
<value>
dialect=mysql
reasonable=true
</value>
</property>
</bean>
</array>
</property>
</bean>
<!-- 映射Mapper目录 -->
<!-- Mapper接口所在包名Spring会自动查找其下的Mapper -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="edu.zx.mapper" />
<property name="basePackage" value="mapperDAO" />
</bean>
<!-- 可通过注解控制事务 -->
<tx:annotation-driven transaction-manager="transactionManager" />

@ -127,7 +127,7 @@ DROP TABLE IF EXISTS `borrowrecord`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8 ;
CREATE TABLE `borrowrecord` (
`s_id` int(20) NOT NULL,
`s_id` varchar(20) NOT NULL,
`book_id` int(20) NOT NULL,
`s_name` varchar(20) NOT NULL,
`book_name` varchar(20) NOT NULL,

@ -6,7 +6,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry including="**/*.java" kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
@ -18,5 +18,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

@ -1,3 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF8
encoding//src/main/resources=UTF-8
encoding/<project>=UTF-8

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<beansProjectDescription>
<version>1</version>
<pluginVersion><![CDATA[3.6.3.201411271034-RELEASE]]></pluginVersion>
<configSuffixes>
<configSuffix><![CDATA[xml]]></configSuffix>
</configSuffixes>
<enableImports><![CDATA[false]]></enableImports>
<configs>
<config>src/main/resources/spring-mvc.xml</config>
</configs>
<autoconfigs>
<config>src/main/resources/spring-context.xml</config>
</autoconfigs>
<configSets>
</configSets>
</beansProjectDescription>

@ -1,61 +1,3 @@
<<<<<<< HEAD
package controller;
import java.io.IOException;
import java.io.Writer;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import service.LoginService;
import domain.UserPO;
@Controller
public class LoginController {
@Autowired@Qualifier("LoginServiceImpl")
private LoginService loginService;
@RequestMapping("/login")
public void login(int s_id, int s_password,
HttpServletRequest request, HttpServletResponse response) throws IOException {
UserPO userPO=this.loginService.FindByUserid(s_id);
response.setContentType("text/html;charset=utf-8");
/* 设置响应头允许ajax跨域访问 */
response.setHeader("Access-Control-Allow-Origin", "*");
/* 星号表示所有的异域请求都可以接受, */
response.setHeader("Access-Control-Allow-Methods", "GET,POST");
System.out.println(s_id);
if(userPO!=null)
if(s_password==userPO.getUserpassword())
{
System.out.println("密码正确");
Writer out = response.getWriter();
out.write("111");
out.flush();
}
else{
System.out.println("密码错误");
Writer out = response.getWriter();
out.write("100");
out.flush();
}
else{
System.out.println("不存在用户名");
Writer out = response.getWriter();
out.write("001");
out.flush();
}
}
}
=======
package controller;
@ -112,4 +54,4 @@ public class LoginController {
}
}
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6

@ -1,34 +1,4 @@
<<<<<<< HEAD
package domain;
import java.io.Serializable;
public class UserPO implements Serializable{
private int s_id;
private int userpassword;
private String username;
public int getUserid() {
return userid;
}
public void setUserid(int userid) {
this.userid = userid;
}
public int getUserpassword() {
return userpassword;
}
public void setUserpassword(int userpassword) {
this.userpassword = userpassword;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
=======
package domain;
import java.io.Serializable;
@ -55,7 +25,7 @@ public class UserPO implements Serializable{
public void setUsername(String username) {
this.username = username;
}
}
}
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6

@ -1,17 +1,3 @@
<<<<<<< HEAD
package mapperDAO;
import org.springframework.stereotype.Repository;
import domain.UserPO;
@Repository("UserDAO")
public interface UserDAO {
public UserPO FindByUserid(int s_id);
}
=======
package mapperDAO;
import org.springframework.stereotype.Repository;
@ -24,4 +10,3 @@ public interface UserDAO {
}
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6

@ -1,13 +1,3 @@
<<<<<<< HEAD
package service;
import domain.UserPO;
public interface LoginService{
public UserPO FindByUserid(int s_id);
}
=======
package service;
import domain.UserPO;
@ -16,4 +6,4 @@ public interface LoginService{
public UserPO FindByUserid(int userid);
}
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6

@ -1,27 +1,4 @@
<<<<<<< HEAD
package serviceimpl;
import mapperDAO.UserDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import domain.UserPO;
import service.LoginService;
@Component("LoginServiceImpl")
public class LoginServiceImpl implements LoginService{
@Autowired@Qualifier("UserDAO")
private UserDAO userDAO;
public UserPO FindByUserid(int s_id){
return this.userDAO.FindByUserid(s_id);
}
}
=======
package serviceimpl;
import mapperDAO.UserDAO;
@ -44,4 +21,3 @@ public class LoginServiceImpl implements LoginService{
}
}
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6

@ -1,132 +0,0 @@
CREATE DATABASE IF NOT EXISTS `` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */;
USE ``;
-- MySQL dump 10.13 Distrib 8.0.13, for Win64 (x86_64)
--
-- Host: localhost Database: 真香图书管理系统
-- ------------------------------------------------------
-- Server version 8.0.13
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
SET NAMES utf8 ;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `book`
--
DROP TABLE IF EXISTS `book`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `book` (
`book_id` int(20) NOT NULL,
`book_name` varchar(45) NOT NULL,
`book_author` varchar(20) NOT NULL,
`book_num` int(5) NOT NULL,
`book_sort` varchar(20) NOT NULL,
`book_image` varchar(45) DEFAULT NULL,
PRIMARY KEY (`book_id`,`book_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `book`
--
LOCK TABLES `book` WRITE;
/*!40000 ALTER TABLE `book` DISABLE KEYS */;
INSERT INTO `book` VALUES (1,'中国史学入门','顾颉刚',10,'历史人文类',NULL),(2,'明朝那些事儿','石悦',10,'历史人文类',NULL),(3,'袁氏当国','唐德刚',10,'历史人文类',NULL),(4,'天朝的崩溃','茅海建',10,'历史人文类',NULL),(5,'东晋门阀政治','田余庆',10,'历史人文类',NULL),(6,'通俗天文学','(美)西蒙·纽康 ',10,'自然科学类',NULL),(7,'自私的基因','[英]理查德·道金斯',10,'自然科学类',NULL),(8,'发现之旅','托尼赖斯',10,'自然科学类',NULL),(9,'宇宙之书','约翰.D.巴罗',10,'自然科学类',NULL);
/*!40000 ALTER TABLE `book` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `borrowrecord`
--
DROP TABLE IF EXISTS `borrowrecord`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `borrowrecord` (
`s_id` int(20) NOT NULL,
`book_id` int(20) NOT NULL,
`s_name` varchar(20) NOT NULL,
`book_name` varchar(20) NOT NULL,
`book_num` int(5) NOT NULL,
PRIMARY KEY (`s_id`,`book_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `borrowrecord`
--
LOCK TABLES `borrowrecord` WRITE;
/*!40000 ALTER TABLE `borrowrecord` DISABLE KEYS */;
/*!40000 ALTER TABLE `borrowrecord` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `manager`
--
DROP TABLE IF EXISTS `manager`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `manager` (
`m_id` int(20) NOT NULL,
`m_password` varchar(20) NOT NULL,
PRIMARY KEY (`m_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `manager`
--
LOCK TABLES `manager` WRITE;
/*!40000 ALTER TABLE `manager` DISABLE KEYS */;
INSERT INTO `manager` VALUES (1,'000000'),(2,'000000');
/*!40000 ALTER TABLE `manager` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `student`
--
DROP TABLE IF EXISTS `student`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `student` (
`s_id` int(20) NOT NULL,
`s_password` varchar(20) NOT NULL,
`s_name` varchar(20) NOT NULL,
PRIMARY KEY (`s_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `student`
--
LOCK TABLES `student` WRITE;
/*!40000 ALTER TABLE `student` DISABLE KEYS */;
INSERT INTO `student` VALUES (20160801,'123456','xzy'),(20160802,'123456','zxy'),(20160803,'123456','myj'),(20160804,'123456','zjh');
/*!40000 ALTER TABLE `student` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2019-01-11 10:30:38

@ -15,7 +15,7 @@
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
SET NAMES utf8mb4;
SET NAMES utf8;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

Loading…
Cancel
Save