suochencheng 6 vuotta sitten
vanhempi
commit
38966ee09d

+ 16 - 0
.idea/artifacts/FangYuan_war_exploded.xml

@@ -0,0 +1,16 @@
+<component name="ArtifactManager">
+  <artifact type="exploded-war" name="FangYuan:war exploded">
+    <output-path>$PROJECT_DIR$/out/artifacts/FangYuan_war_exploded</output-path>
+    <root id="root">
+      <element id="directory" name="WEB-INF">
+        <element id="directory" name="classes">
+          <element id="module-output" name="FangYuan" />
+        </element>
+        <element id="directory" name="lib">
+          <element id="library" level="project" name="lib" />
+        </element>
+      </element>
+      <element id="javaee-facet-resources" facet="FangYuan/web/Web" />
+    </root>
+  </artifact>
+</component>

+ 16 - 0
.idea/libraries/Java_EE_6_Java_EE_6.xml

@@ -0,0 +1,16 @@
+<component name="libraryTable">
+  <library name="Java EE 6-Java EE 6">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/lib/javax.annotation.jar!/" />
+      <root url="jar://$PROJECT_DIR$/lib/javax.jms.jar!/" />
+      <root url="jar://$PROJECT_DIR$/lib/javax.persistence.jar!/" />
+      <root url="jar://$PROJECT_DIR$/lib/javax.ejb.jar!/" />
+      <root url="jar://$PROJECT_DIR$/lib/javax.transaction.jar!/" />
+      <root url="jar://$PROJECT_DIR$/lib/javax.resource.jar!/" />
+      <root url="jar://$PROJECT_DIR$/lib/javax.servlet.jar!/" />
+      <root url="jar://$PROJECT_DIR$/lib/javax.servlet.jsp.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>

+ 53 - 0
.idea/libraries/lib.xml

@@ -0,0 +1,53 @@
+<component name="libraryTable">
+  <library name="lib">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/aliyun-sdk-oss-2.0.6.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/org.springframework.web.servlet-3.1.2.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/thumbnailator-0.4.5.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/commons-beanutils-1.7.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/jackson-core-lgpl-1.9.13.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/c3p0-0.9.1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/jboss-vfs-3.1.0.Final.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/commons-fileupload-1.2.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/json-lib-2.3-jdk15.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/org.springframework.core-3.1.2.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/activation-1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/aopalliance-1.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/commons-logging-1.1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/httpclient-4.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/commons-codec-1.9.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/jettison-1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/org.springframework.beans-3.1.2.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/org.springframework.web-3.1.2.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/mail-1.4.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/xstream-1.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/ezmorph-1.0.6.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/commons-lang-2.5.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/httpcore-4.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/log4j-1.2.17.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/ueditor-1.1.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/mybatis-3.3.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/org.springframework.test-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/dom4j-1.6.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/mysql-connector-java-5.1.30-bin.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/commons-collections-3.2.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/jdom-1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/mybatis-spring-1.1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/org.springframework.aop-3.1.2.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/gson-2.2.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/org.springframework.asm-3.1.2.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/jstl-1.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/org.springframework.jdbc-3.1.2.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/org.springframework.context-3.1.2.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/commons-io-2.0.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/org.springframework.expression-3.1.2.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/jboss-logging-3.0.0.CR1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/xpp3_min-1.1.4c.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/jackson-mapper-lgpl-1.9.13.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/org.springframework.transaction-3.1.2.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/WebRoot/WEB-INF/lib/json.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>

+ 6 - 0
.idea/misc.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="false" project-jdk-name="1.7" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/FangYuan.iml" filepath="$PROJECT_DIR$/FangYuan.iml" />
+    </modules>
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

+ 35 - 0
FangYuan.iml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="web" name="Web">
+      <configuration>
+        <descriptors>
+          <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/WebRoot/WEB-INF/web.xml" />
+        </descriptors>
+        <webroots>
+          <root url="file://$MODULE_DIR$/WebRoot" relative="/" />
+        </webroots>
+      </configuration>
+    </facet>
+    <facet type="Spring" name="Spring">
+      <configuration>
+        <fileset id="fileset" name="Spring Application Context" removed="false">
+          <file>file://$MODULE_DIR$/src/appDataSource.xml</file>
+          <file>file://$MODULE_DIR$/src/applicationContext.xml</file>
+          <file>file://$MODULE_DIR$/src/appWebService.xml</file>
+          <file>file://$MODULE_DIR$/src/appWebServlet.xml</file>
+        </fileset>
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="lib" level="project" />
+    <orderEntry type="library" name="Java EE 6-Java EE 6" level="project" />
+  </component>
+</module>

+ 32 - 7
WebRoot/WEB-INF/jsp/newAdmin/rentInfo.jsp

@@ -345,7 +345,7 @@
             </el-form-item> -->
             <el-form-item label="审核">
 
-                <el-input  :value="formatReviewFlag(row_info.reviewFlag)" disabled ></el-input>
+                <el-input :value="formatReviewFlag(row_info.reviewFlag)" disabled></el-input>
             </el-form-item>
             <el-form-item label="审核原因">
                 <el-input v-model="row_info.reviewRemark" disabled></el-input>
@@ -356,8 +356,10 @@
             <el-form-item label="视频">
                 <el-input v-model="row_info.houseVideo"></el-input>
             </el-form-item>
-            <el-form-item>
-                <el-button type="primary" v-show='userLimit==2||userLimit==3||userLimit==4' v-if="row_info.reviewFlag=='N'"
+            <el-form-item style="position: fixed;bottom: -20px" >
+
+                <el-button type="primary" v-show='userLimit==1||userLimit==2||userLimit==3||userLimit==4'
+                           v-if="row_info.reviewFlag=='N'"
                            @click="onSubmit">{{edit?'修改并保存':'立即创建'}}
                 </el-button>
                 <el-button @click="reback()">返回</el-button>
@@ -371,10 +373,23 @@
     function getQueryString(name) {
         var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
         var r = window.location.search.substr(1).match(reg);
-        if (r != null) return unescape(r[2]);
+        if (r != null) return decodeURIComponent(r[2]);
         return null;
     }
 
+    function getPageString(headStr) {
+
+        var pageString = "";
+        if (getQueryString('currentPage')) {
+            console.log("getQueryString('searchId'):" + getQueryString('searchId'));
+            pageString = headStr + "currentPage=" + getQueryString('currentPage') + "&pageSize=" + getQueryString('pageSize')
+                + "&typeId=" + getQueryString('typeId') + "&searchId=" + getQueryString('searchId');
+        }
+
+        return pageString;
+    }
+
+
     new Vue({
         el: '#app',
 
@@ -472,7 +487,7 @@
                         }
                         that.edit = true;
                         that.$message.success(that.edit ? '保存成功' : '创建成功');
-                        history.back();
+                        this.reback();
                     } else {
                         this.$message.error(that.edit ? '保存失败' : '创建失败');
                     }
@@ -495,7 +510,18 @@
                 this.row_info[e] = '';
             },
             reback: function () {
-                window.history.back();
+                if (getQueryString('typeFlag')) {
+
+                    if (getQueryString('typeFlag') == 2) {
+
+                        window.location.href = '../admin/rentInfos' + getPageString("?");
+
+                    } else {
+                        window.location.href = '../admin/saleinfos' + getPageString("?");
+                    }
+                } else {
+                    history.back()
+                }
             },
             getUserLimit: function () {
                 var that = this;
@@ -547,7 +573,6 @@
         },
 
 
-
     })
 </script>
 </html>

+ 33 - 15
WebRoot/WEB-INF/jsp/newAdmin/rentInfos.jsp

@@ -8,9 +8,9 @@
 <jsp:include page="contentBefore.jsp"/>
 <template>
     <div class="filters">
-        <input id="searchId" class="h34" type="text" name="searchText" value="请输入内容"/>
-        <select id="typeId" v-model="value8" class="h34">
-            <option>请选择类型</option>
+        <input id="searchId" v-model="searchId" class="h34" type="text" name="searchText" placeholder="请输入内容"/>
+        <select id="typeId" v-model="typeId" class="h34">
+            <option value="">请选择类型</option>
             <option value="name">名字</option>
             <option value="address">地区</option>
             <option value="phone">电话</option>
@@ -309,7 +309,8 @@
                 <el-button size="small" @click="editRow(row)"
                            v-show="userLimit==1||userLimit==2||userLimit==3||userLimit==4">查看
                 </el-button>
-                <el-button size="small" @click="auditorRow(row)" v-show="userLimit==2||userLimit==3||userLimit==4" v-if="row.reviewFlag=='N'" >
+                <el-button size="small" @click="auditorRow(row)" v-show="userLimit==2||userLimit==3||userLimit==4"
+                           v-if="row.reviewFlag=='N'">
                     审核
                 </el-button>
                 <!-- <el-button size="small" @click="editRow(row)" v-show="userLimit==2||userLimit==3">查看</el-button> -->
@@ -350,15 +351,27 @@
     function getQueryString(name) {
         var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
         var r = window.location.search.substr(1).match(reg);
-        if (r != null) return unescape(r[2]);
+        if (r != null) return decodeURIComponent(r[2]);
         return null;
     }
 
     new Vue({
         el: '#app',
         created: function () {
+
+            if (getQueryString('currentPage')) {
+                this.currentPage = parseInt(getQueryString('currentPage'));
+                this.pageSize = parseInt(getQueryString('pageSize'));
+            }
+            if (getQueryString('typeId')) {
+               this.typeId = getQueryString('typeId');
+            }
+            if (getQueryString('searchId')) {
+               this.searchId =  getQueryString('searchId')
+            }
+
             this.getUserLimit();
-            this.getRows();
+            this.serchLike();
         },
         data: function () {
             return {
@@ -396,6 +409,8 @@
                     content: ''
                 },
                 auditorId: '',
+                typeId: '',
+                searchId: '',
             };
         },
         methods: {
@@ -439,14 +454,17 @@
             },
             pageChange: function (page) {
                 this.currentPage = page;
-                this.getRows();
+                this.serchLike();
             },
             sizeChange: function (size) {
                 this.pageSize = size;
-                this.getRows();
+                this.serchLike();
             },
             editRow: function (row) {
-                window.location = 'rentInfo?id=' + row.id;
+
+                window.location = 'rentInfo?id=' + row.id
+                    + "&currentPage=" + this.currentPage + "&pageSize=" + this.pageSize
+                    + "&typeId=" + this.typeId + "&searchId=" + this.searchId+ "&typeFlag=2";
             },
             deleteRow: function (row) {
                 this.$confirm('确定要删除吗?', '提示', {
@@ -463,7 +481,7 @@
                 }.bind(this)).then(function (res) {
                     if (res.success) {
                         this.$message.success('删除成功');
-                        this.getRows();
+                        this.serchLike();
                     } else {
                         this.$message.error('删除失败');
                     }
@@ -475,9 +493,9 @@
                 window.location = 'rentInfo?type=2';
             },
             serchLike: function () {
-                console.log(this.value8)
-                var type = $("#typeId").val();
-                var value = $("#searchId").val();
+                //console.log(this.value8)
+                var type = this.typeId;
+                var value = this.searchId;
                 var nameVal;
                 var addressVal;
                 var phoneVal;
@@ -538,7 +556,7 @@
                     success: function (res) {
                         if (res.success) {
                             this.$message.success('保存成功');
-                            this.getRows();
+                            this.serchLike();
                             this.showDialog = false
                         } else {
                             this.$message.error('保存失败');
@@ -565,7 +583,7 @@
                     success: function (res) {
                         if (res.success) {
                             this.$message.success('保存成功');
-                            this.getRows();
+                            this.serchLike();
                             this.showDialog = false
                         } else {
                             this.$message.error('保存失败');

+ 28 - 13
WebRoot/WEB-INF/jsp/newAdmin/saleinfos.jsp

@@ -13,9 +13,9 @@
 <jsp:include page="contentBefore.jsp"/>
 <template>
     <div class="filters">
-        <input id="searchId" class="h34" type="text" name="searchText" value="请输入内容"/>
-        <select id="typeId" class="h34">
-            <option>请选择类型</option>
+        <input id="searchId" v-model="searchId" class="h34" type="text" name="searchText" placeholder="请输入内容"/>
+        <select id="typeId" v-model="typeId" class="h34">
+            <option value="">请选择类型</option>
             <option value="name">名字</option>
             <option value="address">地区</option>
             <option value="phone">电话</option>
@@ -356,15 +356,26 @@
     function getQueryString(name) {
         var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
         var r = window.location.search.substr(1).match(reg);
-        if (r != null) return unescape(r[2]);
+        if (r != null) return decodeURIComponent(r[2]);
         return null;
     }
 
     new Vue({
         el: '#app',
         created: function () {
+            if (getQueryString('currentPage')) {
+                this.currentPage = parseInt(getQueryString('currentPage'));
+                this.pageSize = parseInt(getQueryString('pageSize'));
+            }
+            if (getQueryString('typeId')) {
+                this.typeId = getQueryString('typeId');
+            }
+            if (getQueryString('searchId')) {
+                this.searchId =  getQueryString('searchId')
+            }
+
             this.getUserLimit();
-            this.getRows();
+            this.serchLike();
         },
         data: function () {
             return {
@@ -388,6 +399,8 @@
                     content: ''
                 },
                 auditorId: '',
+                typeId: '',
+                searchId: '',
             };
         },
         methods: {
@@ -431,14 +444,16 @@
             },
             pageChange: function (page) {
                 this.currentPage = page;
-                this.getRows();
+                this.serchLike();
             },
             sizeChange: function (size) {
                 this.pageSize = size;
-                this.getRows();
+                this.serchLike();
             },
             editRow: function (row) {
-                window.location = 'rentInfo?id=' + row.id;
+                window.location = 'rentInfo?id=' + row.id
+                    + "&currentPage=" + this.currentPage + "&pageSize=" + this.pageSize
+                    + "&typeId=" + this.typeId + "&searchId=" + this.searchId+ "&typeFlag=1";
             },
             deleteRow: function (row) {
                 this.$confirm('确定要删除吗?', '提示', {
@@ -455,7 +470,7 @@
                 }.bind(this)).then(function (res) {
                     if (res.success) {
                         this.$message.success('删除成功');
-                        this.getRows();
+                        this.serchLike();
                     } else {
                         this.$message.error('删除失败');
                     }
@@ -468,8 +483,8 @@
             },
             serchLike: function () {
 
-                var type = $("#typeId").val();
-                var value = $("#searchId").val();
+                var type = this.typeId;
+                var value = this.searchId;
                 var nameVal;
                 var addressVal;
                 var phoneVal;
@@ -533,7 +548,7 @@
                     success: function (res) {
                         if (res.success) {
                             this.$message.success('保存成功');
-                            this.getRows();
+                            this.serchLike();
                             this.showDialog = false
                         } else {
                             this.$message.error('保存失败');
@@ -560,7 +575,7 @@
                     success: function (res) {
                         if (res.success) {
                             this.$message.success('保存成功');
-                            this.getRows();
+                            this.serchLike();
                             this.showDialog = false
                         } else {
                             this.$message.error('保存失败');

BIN
lib/javax.annotation.jar


BIN
lib/javax.ejb.jar


BIN
lib/javax.jms.jar


BIN
lib/javax.persistence.jar


BIN
lib/javax.resource.jar


BIN
lib/javax.servlet.jar


BIN
lib/javax.servlet.jsp.jar


BIN
lib/javax.transaction.jar


+ 12 - 11
src/com/suyuan/dao/RentInfoMapper.java

@@ -1,30 +1,31 @@
 package com.suyuan.dao;
 
 import com.suyuan.model.RentInfo;
+
 import java.util.List;
 import java.util.Map;
+
 import org.springframework.stereotype.Repository;
 
 @Repository("com.suyuan.dao.RentInfoMapper")
-public abstract interface RentInfoMapper
-{
-  public abstract int deleteByPrimaryKey(Integer paramInteger);
+public abstract interface RentInfoMapper {
+    public abstract int deleteByPrimaryKey(Integer paramInteger);
 
-  public abstract int insertSelective(RentInfo paramRentInfo);
+    public abstract int insertSelective(RentInfo paramRentInfo);
 
-  public abstract RentInfo selectByPrimaryKey(Integer paramInteger);
+    public abstract RentInfo selectByPrimaryKey(Integer paramInteger);
 
-  public abstract int updateByPrimaryKeySelective(RentInfo paramRentInfo);
+    public abstract int updateByPrimaryKeySelective(RentInfo paramRentInfo);
 
-  public abstract List<RentInfo> queryAllRentInfo(RentInfo paramRentInfo);
+    public abstract List<RentInfo> queryAllRentInfo(RentInfo paramRentInfo);
 
-  public abstract List<RentInfo> queryRentInfosByPage(Map<String, Object> paramMap);
+    public abstract List<RentInfo> queryRentInfosByPage(Map<String, Object> paramMap);
 
-  public abstract int delete(String paramString);
+    public abstract int delete(String paramString);
 
-  public abstract RentInfo queryRentInfo(RentInfo paramRentInfo);
+    public abstract RentInfo queryRentInfo(RentInfo paramRentInfo);
 
-  public abstract List<RentInfo> queryByLike(RentInfo paramRentInfo);
+    public abstract List<RentInfo> queryByLikeByPage(Map<String, Object> paramMap);
 }
 
 /* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\

+ 15 - 15
src/com/suyuan/dao/RentInfoMapper.xml

@@ -1290,33 +1290,33 @@
         </where>
     </update>
 
-    <select id="queryByLike" parameterType="java.util.Map" resultType="com.suyuan.model.RentInfo">
+    <select id="queryByLikeByPage" parameterType="java.util.Map" resultType="com.suyuan.model.RentInfo">
         select * from rent_info
         <where>
             del_flag = 'N'
-            <if test="id != null and id != ''">
-                and id = #{id}
+            <if test="record.id != null and record.id != ''">
+                and id = #{record.id}
             </if>
-            <if test="address != null and address != ''">
-                and address like concat('%',#{address},'%')
+            <if test="record.address != null and record.address != ''">
+                and address like concat('%',#{record.address},'%')
             </if>
-            <if test="name != null and name != ''">
-                and name like concat('%',#{name},'%')
+            <if test="record.name != null and record.name != ''">
+                and name like concat('%',#{record.name},'%')
             </if>
 
-            <if test="phone != null and phone != ''">
-                and phone like concat('%',#{phone},'%')
+            <if test="record.phone != null and record.phone != ''">
+                and phone like concat('%',#{record.phone},'%')
             </if>
 
-            <if test="note != null and note !=''">
-                and note like concat('%',#{note},'%')
+            <if test="note != null and record.note !=''">
+                and note like concat('%',#{record.note},'%')
             </if>
 
-            <if test="submitter != null and submitter != ''">
-                and submitter like concat('%',#{submitter},'%')
+            <if test="record.submitter != null and record.submitter != ''">
+                and submitter like concat('%',#{record.submitter},'%')
             </if>
-            <if test="type != null and type != ''">
-                and type = #{type}
+            <if test="record.type != null and record.type != ''">
+                and type = #{record.type}
             </if>
 
         </where>

+ 1 - 1
src/com/suyuan/service/RentInfoService.java

@@ -14,7 +14,7 @@ public abstract interface RentInfoService
 
   public abstract RentInfo getRentInfo(RentInfo paramRentInfo);
 
-  public abstract List<RentInfo> getRentInfoByLike(RentInfo paramRentInfo);
+  public abstract List<RentInfo> getRentInfoByLike(Page paramPage,RentInfo paramRentInfo);
 
   public abstract boolean createRentInfo(RentInfo paramRentInfo);
 

+ 233 - 139
src/com/suyuan/service/impl/RentInfoServiceImpl.java

@@ -1,6 +1,9 @@
-/*     */ package com.suyuan.service.impl;
-/*     */ 
-/*     */ import com.suyuan.dao.RentInfoMapper;
+/*     */
+package com.suyuan.service.impl;
+/*     */
+/*     */
+
+import com.suyuan.dao.RentInfoMapper;
 /*     */ import com.suyuan.dto.Page;
 /*     */ import com.suyuan.model.RentInfo;
 /*     */ import com.suyuan.service.RentInfoService;
@@ -11,143 +14,234 @@
 /*     */ import org.springframework.beans.factory.annotation.Autowired;
 /*     */ import org.springframework.stereotype.Service;
 /*     */ import org.springframework.transaction.annotation.Transactional;
-/*     */ 
-/*     */ @Service
+
+/*     */
+/*     */
+@Service
 /*     */ public class RentInfoServiceImpl
-/*     */   implements RentInfoService
-/*     */ {
-/*  27 */   private static Logger logger = Logger.getLogger(RentInfoServiceImpl.class);
-/*     */ 
-/*     */   @Autowired
-/*     */   private RentInfoMapper rentInfoMapper;
-/*     */ 
-/*     */   public List<RentInfo> getRentInfoList(RentInfo record)
-/*     */   {
-/*  35 */     logger.info("getRentInfoList");
-/*     */     try
-/*     */     {
-/*  38 */       return this.rentInfoMapper.queryAllRentInfo(record);
-/*     */     } catch (Exception e) {
-/*  40 */       logger.error("getRentInfoList", e);
-/*     */     }
-/*     */ 
-/*  43 */     return null;
-/*     */   }
-/*     */ 
-/*     */   @Transactional(rollbackFor={Exception.class})
-/*     */   public List<RentInfo> getRentInfoByPage(Page page, RentInfo record)
-/*     */   {
-/*  50 */     logger.info("getRentInfoByPage");
-/*     */     try
-/*     */     {
-/*  53 */       Map parameter = new HashMap();
-/*  54 */       parameter.put("record", record);
-/*  55 */       parameter.put("page", page);
-/*     */ 
-/*  57 */       return this.rentInfoMapper.queryRentInfosByPage(parameter);
-/*     */     } catch (Exception e) {
-/*  59 */       logger.error("getRentInfoByPage", e);
-/*     */     }
-/*     */ 
-/*  62 */     return null;
-/*     */   }
-/*     */ 
-/*     */   @Transactional(rollbackFor={Exception.class})
-/*     */   public RentInfo getRentInfoById(String id)
-/*     */   {
-/*  69 */     logger.info("getRentInfoById");
-/*     */     try
-/*     */     {
-/*  72 */       return this.rentInfoMapper.selectByPrimaryKey(Integer.valueOf(id));
-/*     */     } catch (Exception e) {
-/*  74 */       logger.error("getRentInfoById", e);
-/*     */     }
-/*     */ 
-/*  77 */     return null;
-/*     */   }
-/*     */ 
-/*     */   @Transactional(rollbackFor={Exception.class})
-/*     */   public RentInfo getRentInfo(RentInfo record)
-/*     */   {
-/*  84 */     logger.info("getRentInfo");
-/*     */     try
-/*     */     {
-/*  87 */       return this.rentInfoMapper.queryRentInfo(record);
-/*     */     } catch (Exception e) {
-/*  89 */       logger.error("getRentInfo", e);
-/*     */     }
-/*     */ 
-/*  92 */     return null;
-/*     */   }
-/*     */ 
-/*     */   @Transactional(rollbackFor={Exception.class})
-/*     */   public boolean createRentInfo(RentInfo record)
-/*     */   {
-/*  99 */     logger.info("createRentInfo");
-/*     */     try
-/*     */     {
-/* 102 */       int updates = this.rentInfoMapper.insertSelective(record);
-/*     */ 
-/* 104 */       if (updates > 0)
-/* 105 */         return true;
-/*     */     }
-/*     */     catch (Exception e) {
-/* 108 */       logger.error("createRentInfo", e);
-/*     */     }
-/*     */ 
-/* 111 */     return false;
-/*     */   }
-/*     */ 
-/*     */   @Transactional(rollbackFor={Exception.class})
-/*     */   public boolean deleteRentInfo(String id)
-/*     */   {
-/* 118 */     logger.info("deleteRentInfo");
-/*     */     try
-/*     */     {
-/* 121 */       int updates = this.rentInfoMapper.delete(id);
-/*     */ 
-/* 123 */       if (updates > 0)
-/* 124 */         return true;
-/*     */     }
-/*     */     catch (Exception e) {
-/* 127 */       logger.error("deleteRentInfo", e);
-/*     */     }
-/*     */ 
-/* 130 */     return false;
-/*     */   }
-/*     */ 
-/*     */   @Transactional(rollbackFor={Exception.class})
-/*     */   public boolean updateRentInfo(RentInfo record)
-/*     */   {
-/* 137 */     logger.info("updateRentInfo");
-/*     */     try
-/*     */     {
-/* 140 */       int updates = this.rentInfoMapper.updateByPrimaryKeySelective(record);
-/*     */ 
-/* 142 */       if (updates > 0)
-/* 143 */         return true;
-/*     */     }
-/*     */     catch (Exception e) {
-/* 146 */       logger.error("updateRentInfo", e);
-/*     */     }
-/*     */ 
-/* 149 */     return false;
-/*     */   }
-/*     */ 
-/*     */   @Transactional(rollbackFor={Exception.class})
-/*     */   public List<RentInfo> getRentInfoByLike(RentInfo record)
-/*     */   {
-/* 156 */     logger.info("getRentInfoByLike");
-/*     */     try
-/*     */     {
-/* 160 */       return this.rentInfoMapper.queryByLike(record);
-/*     */     } catch (Exception e) {
-/* 162 */       logger.error("getRentInfoByLike", e);
-/*     */     }
-/*     */ 
-/* 165 */     return null;
-/*     */   }
-/*     */ }
+        /*     */ implements RentInfoService
+        /*     */ {
+    /*  27 */   private static Logger logger = Logger.getLogger(RentInfoServiceImpl.class);
+    /*     */
+    /*     */
+    @Autowired
+    /*     */ private RentInfoMapper rentInfoMapper;
+
+    /*     */
+    /*     */
+    public List<RentInfo> getRentInfoList(RentInfo record)
+    /*     */ {
+        /*  35 */
+        logger.info("getRentInfoList");
+        /*     */
+        try
+            /*     */ {
+            /*  38 */
+            return this.rentInfoMapper.queryAllRentInfo(record);
+            /*     */
+        } catch (Exception e) {
+            /*  40 */
+            logger.error("getRentInfoList", e);
+            /*     */
+        }
+        /*     */
+        /*  43 */
+        return null;
+        /*     */
+    }
+
+    /*     */
+    /*     */
+    @Transactional(rollbackFor = {Exception.class})
+    /*     */ public List<RentInfo> getRentInfoByPage(Page page, RentInfo record)
+    /*     */ {
+        /*  50 */
+        logger.info("getRentInfoByPage");
+        /*     */
+        try
+            /*     */ {
+            /*  53 */
+            Map parameter = new HashMap();
+            /*  54 */
+            parameter.put("record", record);
+            /*  55 */
+            parameter.put("page", page);
+            /*     */
+            /*  57 */
+            return this.rentInfoMapper.queryRentInfosByPage(parameter);
+            /*     */
+        } catch (Exception e) {
+            /*  59 */
+            logger.error("getRentInfoByPage", e);
+            /*     */
+        }
+        /*     */
+        /*  62 */
+        return null;
+        /*     */
+    }
+
+    /*     */
+    /*     */
+    @Transactional(rollbackFor = {Exception.class})
+    /*     */ public RentInfo getRentInfoById(String id)
+    /*     */ {
+        /*  69 */
+        logger.info("getRentInfoById");
+        /*     */
+        try
+            /*     */ {
+            /*  72 */
+            return this.rentInfoMapper.selectByPrimaryKey(Integer.valueOf(id));
+            /*     */
+        } catch (Exception e) {
+            /*  74 */
+            logger.error("getRentInfoById", e);
+            /*     */
+        }
+        /*     */
+        /*  77 */
+        return null;
+        /*     */
+    }
+
+    /*     */
+    /*     */
+    @Transactional(rollbackFor = {Exception.class})
+    /*     */ public RentInfo getRentInfo(RentInfo record)
+    /*     */ {
+        /*  84 */
+        logger.info("getRentInfo");
+        /*     */
+        try
+            /*     */ {
+            /*  87 */
+            return this.rentInfoMapper.queryRentInfo(record);
+            /*     */
+        } catch (Exception e) {
+            /*  89 */
+            logger.error("getRentInfo", e);
+            /*     */
+        }
+        /*     */
+        /*  92 */
+        return null;
+        /*     */
+    }
+
+    /*     */
+    /*     */
+    @Transactional(rollbackFor = {Exception.class})
+    /*     */ public boolean createRentInfo(RentInfo record)
+    /*     */ {
+        /*  99 */
+        logger.info("createRentInfo");
+        /*     */
+        try
+            /*     */ {
+            /* 102 */
+            int updates = this.rentInfoMapper.insertSelective(record);
+            /*     */
+            /* 104 */
+            if (updates > 0)
+                /* 105 */ return true;
+            /*     */
+        }
+        /*     */ catch (Exception e) {
+            /* 108 */
+            logger.error("createRentInfo", e);
+            /*     */
+        }
+        /*     */
+        /* 111 */
+        return false;
+        /*     */
+    }
+
+    /*     */
+    /*     */
+    @Transactional(rollbackFor = {Exception.class})
+    /*     */ public boolean deleteRentInfo(String id)
+    /*     */ {
+        /* 118 */
+        logger.info("deleteRentInfo");
+        /*     */
+        try
+            /*     */ {
+            /* 121 */
+            int updates = this.rentInfoMapper.delete(id);
+            /*     */
+            /* 123 */
+            if (updates > 0)
+                /* 124 */ return true;
+            /*     */
+        }
+        /*     */ catch (Exception e) {
+            /* 127 */
+            logger.error("deleteRentInfo", e);
+            /*     */
+        }
+        /*     */
+        /* 130 */
+        return false;
+        /*     */
+    }
+
+    /*     */
+    /*     */
+    @Transactional(rollbackFor = {Exception.class})
+    /*     */ public boolean updateRentInfo(RentInfo record)
+    /*     */ {
+        /* 137 */
+        logger.info("updateRentInfo");
+        /*     */
+        try
+            /*     */ {
+            /* 140 */
+            int updates = this.rentInfoMapper.updateByPrimaryKeySelective(record);
+            /*     */
+            /* 142 */
+            if (updates > 0)
+                /* 143 */ return true;
+            /*     */
+        }
+        /*     */ catch (Exception e) {
+            /* 146 */
+            logger.error("updateRentInfo", e);
+            /*     */
+        }
+        /*     */
+        /* 149 */
+        return false;
+        /*     */
+    }
+
+    /*     */
+    /*     */
+    @Transactional(rollbackFor = {Exception.class})
+    /*     */ public List<RentInfo> getRentInfoByLike(Page page, RentInfo record)
+    /*     */ {
+        /* 156 */
+        logger.info("getRentInfoByLike");
+        /*     */
+        try {
+
+            Map parameter = new HashMap();
+            parameter.put("record", record);
+            parameter.put("page", page);
+            return this.rentInfoMapper.queryByLikeByPage(parameter);
+        } catch (Exception e) {
+            /* 162 */
+            logger.error("getRentInfoByLike", e);
+            /*     */
+        }
+        /*     */
+        /* 165 */
+        return null;
+        /*     */
+    }
+    /*     */
+}
 
 /* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
  * Qualified Name:     com.suyuan.service.impl.RentInfoServiceImpl

+ 2 - 6
src/com/suyuan/web/RentInfoController.java

@@ -165,13 +165,9 @@ public class RentInfoController extends BaseController {
     /*     */ public Result rentInfoLike(HttpServletRequest req, Page page, RentInfo record) {
         /* 134 */
         record.setAddress(EncodingTool.encodeStr(record.getAddress()));
-        /* 135 */
         record.setName(EncodingTool.encodeStr(record.getName()));
-        /* 136 */
         record.setNote(EncodingTool.encodeStr(record.getNote()));
-        /* 137 */
         record.setSubmitter(EncodingTool.encodeStr(record.getSubmitter()));
-        /* 138 */
         System.out.println("一阶段       " + record);
         /* 139 */
         UserInfo user = (UserInfo) req.getSession().getAttribute("userInfo");
@@ -183,7 +179,7 @@ public class RentInfoController extends BaseController {
         /* 154 */
         if ((record.getAddress() == null) || (record.getAddress().equals(""))) {
             /* 155 */
-            record.setAddress(EncodingTool.encodeStr(user.getAddress()));
+            record.setAddress(user.getAddress());
             /*     */
         }
         /* 157 */
@@ -194,7 +190,7 @@ public class RentInfoController extends BaseController {
         Map result = new HashMap();
         /*     */
         /* 161 */
-        List<RentInfo> pp = this.rentInfoService.getRentInfoByLike(record);
+        List<RentInfo> pp = this.rentInfoService.getRentInfoByLike(page, record);
         /* 162 */
         for (RentInfo rent : pp) {
             /* 163 */

+ 45 - 45
src/com/suyuan/web/admin/AdminController.java

@@ -183,51 +183,51 @@ import org.apache.http.HttpEntity;
     @Transactional(rollbackFor = {Exception.class})
     /*     */ public ModelAndView index(HttpServletRequest req, HttpServletResponse res, String code, String state) {
         //临时绕过钉钉登录
-        req.getSession(true).setAttribute("superUserId", String.valueOf(10001));
-        req.getSession(true).setAttribute("superUserName", "管理员1");
-        UserInfo user = this.mapper.selectByUserName("scc");
-        req.getSession().setAttribute("userInfo", user);
-        return new ModelAndView("jsp/newAdmin/index.jsp");
-
-//        System.out.println("222  访问index  222");
-//        if (StringUtils.isNotEmpty(code)) {
-//
-//            String tmp_auth_code = code;
-//            JSONObject json = null;
-//            try {
-//                String access_token = getAccess_token();
-//                String path = "https://oapi.dingtalk.com/sns/get_persistent_code?access_token=" + access_token;
-//                json = getPersistent_code(path, tmp_auth_code);
-//
-//                path = "https://oapi.dingtalk.com/sns/get_sns_token?access_token=" + access_token;
-//                String sns_token = getSNS_TOKEN(path, json);
-//                path = "https://oapi.dingtalk.com/sns/getuserinfo?sns_token=" + sns_token;
-//                json = getUserInfo(path);
-//                JSONObject userInfo = JSONObject.fromObject(json.getString("user_info"));
-//                String userName = userInfo.getString("nick");
-//                UserInfo user = this.mapper.selectByUserName(userName);
-//                if (user == null) {
-//                    UserInfo newUser = new UserInfo();
-//                    newUser.setUserName(userInfo.getString("nick"));
-//                    newUser.setLimitF("1");
-//                    newUser.setAddress("");
-//                    this.mapper.insertUserInfo(newUser);
-//                    req.getSession().setAttribute("userInfo", newUser);
-//                } else {
-//
-//                    req.getSession().setAttribute("userInfo", user);
-//                }
-//            } catch (Exception e) {
-//                e.printStackTrace();
-//                return new ModelAndView("redirect:login");
-//            }
-//            req.getSession(true).setAttribute("superUserId", String.valueOf(10001));
-//            req.getSession(true).setAttribute("superUserName", "管理员1");
-//            return new ModelAndView("jsp/newAdmin/index.jsp");
-//
-//        } else {
-//            return new ModelAndView("redirect:login");
-//        }
+//        req.getSession(true).setAttribute("superUserId", String.valueOf(10001));
+//        req.getSession(true).setAttribute("superUserName", "管理员1");
+//        UserInfo user = this.mapper.selectByUserName("scc");
+//        req.getSession().setAttribute("userInfo", user);
+//        return new ModelAndView("jsp/newAdmin/index.jsp");
+
+        System.out.println("222  访问index  222");
+        if (StringUtils.isNotEmpty(code)) {
+
+            String tmp_auth_code = code;
+            JSONObject json = null;
+            try {
+                String access_token = getAccess_token();
+                String path = "https://oapi.dingtalk.com/sns/get_persistent_code?access_token=" + access_token;
+                json = getPersistent_code(path, tmp_auth_code);
+
+                path = "https://oapi.dingtalk.com/sns/get_sns_token?access_token=" + access_token;
+                String sns_token = getSNS_TOKEN(path, json);
+                path = "https://oapi.dingtalk.com/sns/getuserinfo?sns_token=" + sns_token;
+                json = getUserInfo(path);
+                JSONObject userInfo = JSONObject.fromObject(json.getString("user_info"));
+                String userName = userInfo.getString("nick");
+                UserInfo user = this.mapper.selectByUserName(userName);
+                if (user == null) {
+                    UserInfo newUser = new UserInfo();
+                    newUser.setUserName(userInfo.getString("nick"));
+                    newUser.setLimitF("1");
+                    newUser.setAddress("");
+                    this.mapper.insertUserInfo(newUser);
+                    req.getSession().setAttribute("userInfo", newUser);
+                } else {
+
+                    req.getSession().setAttribute("userInfo", user);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+                return new ModelAndView("redirect:login");
+            }
+            req.getSession(true).setAttribute("superUserId", String.valueOf(10001));
+            req.getSession(true).setAttribute("superUserName", "管理员1");
+            return new ModelAndView("jsp/newAdmin/index.jsp");
+
+        } else {
+            return new ModelAndView("redirect:login");
+        }
     }