张延森 пре 4 година
родитељ
комит
d00971daa6
53 измењених фајлова са 3728 додато и 0 уклоњено
  1. 219
    0
      house-service/pom.xml
  2. 35
    0
      house-service/src/main/assembly/assembly.xml
  3. 92
    0
      house-service/src/main/bin/dump.sh
  4. 4
    0
      house-service/src/main/bin/restart.sh
  5. 24
    0
      house-service/src/main/bin/server.sh
  6. 22
    0
      house-service/src/main/bin/start.bat
  7. 69
    0
      house-service/src/main/bin/start.sh
  8. 44
    0
      house-service/src/main/bin/stop.sh
  9. 34
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/ServerApplication.java
  10. 34
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/dao/building/BuildingMapper.java
  11. 24
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/dao/building/SchoolMapper.java
  12. 16
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/dao/cms/ArticleInfoMapper.java
  13. 14
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/dao/cms/HotSearchMapper.java
  14. 12
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/dao/cms/NewRoomRecommendMapper.java
  15. 15
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/dao/cms/PictureInfoMapper.java
  16. 17
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/dao/cms/RoomRecommendMapper.java
  17. 28
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/dao/loanratecfg/LoanRateCfgMapper.java
  18. 41
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/dao/room/RoomInfoMapper.java
  19. 25
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/dao/sys/BusiCityMapper.java
  20. 24
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/dao/sys/MetroMapper.java
  21. 45
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/dao/util/SysDictionaryMapper.java
  22. 188
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/persistence/plugin/PageHelper.java
  23. 136
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/service/Building/BuildingServiceImpl.java
  24. 54
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/service/cms/ArticleInfoServiceImpl.java
  25. 126
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/service/cms/CmsServiceImpl.java
  26. 35
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/service/cms/HotSearchServiceImpl.java
  27. 242
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/service/cms/NewRoomRecommendServiceImpl.java
  28. 52
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/service/cms/PictureInfoServiceImpl.java
  29. 71
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/service/cms/RoomRecommendServiceImpl.java
  30. 22
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/service/loanratecfg/LoanRateCfgServiceimpl.java
  31. 160
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/service/room/RoomInfoServiceImpl.java
  32. 64
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/service/sys/BusiCityServiceImpl.java
  33. 46
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/service/sys/MetroServiceImpl.java
  34. 82
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/service/util/SysDictionaryServiceImpl.java
  35. 43
    0
      house-service/src/main/java/com/yincheng/jcjy/huiju/util/ApplicationContextUtil.java
  36. 27
    0
      house-service/src/main/resources/application.properties
  37. 7
    0
      house-service/src/main/resources/banner.txt
  38. 37
    0
      house-service/src/main/resources/dubbo-provider.xml
  39. 3
    0
      house-service/src/main/resources/dubbo.properties
  40. 47
    0
      house-service/src/main/resources/logback-boot.xml
  41. 229
    0
      house-service/src/main/resources/mapper/BuildingMapper.xml
  42. 87
    0
      house-service/src/main/resources/mapper/articleInfoMapper.xml
  43. 62
    0
      house-service/src/main/resources/mapper/busiCityMapper.xml
  44. 54
    0
      house-service/src/main/resources/mapper/hotSearchMapper.xml
  45. 33
    0
      house-service/src/main/resources/mapper/loanRateCfgMapper.xml
  46. 183
    0
      house-service/src/main/resources/mapper/newRoomRecommendMapper.xml
  47. 62
    0
      house-service/src/main/resources/mapper/pictureInfoMapper.xml
  48. 457
    0
      house-service/src/main/resources/mapper/roomInfoMapper.xml
  49. 87
    0
      house-service/src/main/resources/mapper/roomRecommendMapper.xml
  50. 77
    0
      house-service/src/main/resources/mapper/schoolMapper.xml
  51. 48
    0
      house-service/src/main/resources/mapper/sysDictionaryMapper.xml
  52. 50
    0
      house-service/src/main/resources/mapper/sysMetroMapper.xml
  53. 19
    0
      house-service/src/main/resources/mybatis-config.xml

+ 219
- 0
house-service/pom.xml Прегледај датотеку

@@ -0,0 +1,219 @@
1
+<?xml version="1.0"?>
2
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4
+    <modelVersion>4.0.0</modelVersion>
5
+    <artifactId>house-service</artifactId>
6
+    <packaging>jar</packaging>
7
+    <name>house-service</name>
8
+
9
+    <parent>
10
+        <groupId>com.yincheng.jcjy.huiju</groupId>
11
+        <artifactId>huiju-house</artifactId>
12
+        <version>0.0.1</version>
13
+    </parent>
14
+    <properties>
15
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16
+    </properties>
17
+
18
+    <dependencies>
19
+        
20
+        <!-- Spring Boot Web 依赖 -->
21
+        <dependency>
22
+            <groupId>org.springframework.boot</groupId>
23
+            <artifactId>spring-boot-starter-web</artifactId>
24
+            <version>${spring.boot.version}</version>
25
+            <!--<exclusions>-->
26
+                <!--<exclusion>-->
27
+                    <!--<groupId>org.springframework.boot</groupId>-->
28
+                    <!--<artifactId>spring-boot-starter-tomcat</artifactId>-->
29
+                <!--</exclusion>-->
30
+            <!--</exclusions>-->
31
+        </dependency>
32
+        <dependency>
33
+            <groupId>redis.clients</groupId>
34
+            <artifactId>jedis</artifactId>
35
+            <version>${redis.version}</version>
36
+        </dependency>
37
+
38
+        <dependency>
39
+            <groupId>com.yincheng.jcjy.huiju</groupId>
40
+            <artifactId>house-api</artifactId>
41
+            <version>${current.version}</version>
42
+        </dependency>
43
+        <dependency>
44
+            <groupId>com.yincheng.jcjy.huiju</groupId>
45
+            <artifactId>house-common</artifactId>
46
+            <version>${current.version}</version>
47
+        </dependency>
48
+        <!-- dubbo -->
49
+        <dependency>
50
+            <groupId>com.alibaba</groupId>
51
+            <artifactId>dubbo</artifactId>
52
+            <exclusions>
53
+                <exclusion>
54
+                    <groupId>log4j</groupId>
55
+                    <artifactId>log4j</artifactId>
56
+                </exclusion>
57
+                <exclusion>
58
+                    <groupId>commons-logging</groupId>
59
+                    <artifactId>commons-logging</artifactId>
60
+                </exclusion>
61
+                <exclusion>
62
+                    <groupId>org.springframework</groupId>
63
+                    <artifactId>spring</artifactId>
64
+                </exclusion>
65
+                <exclusion>
66
+                    <groupId>com.alibaba</groupId>
67
+                    <artifactId>fastjson</artifactId>
68
+                </exclusion>
69
+            </exclusions>
70
+            <version>${dubbo.version}</version>
71
+        </dependency>
72
+        <!-- commons-lang3 -->
73
+        <dependency>
74
+            <groupId>org.apache.commons</groupId>
75
+            <artifactId>commons-lang3</artifactId>
76
+            <version>${commons-lang3.version}</version>
77
+        </dependency>
78
+        <dependency>
79
+            <groupId>org.apache.zookeeper</groupId>
80
+            <artifactId>zookeeper</artifactId>
81
+            <exclusions>
82
+                <exclusion>
83
+                    <artifactId>jmxtools</artifactId>
84
+                    <groupId>com.sun.jdmk</groupId>
85
+                </exclusion>
86
+                <exclusion>
87
+                    <artifactId>jmxri</artifactId>
88
+                    <groupId>com.sun.jmx</groupId>
89
+                </exclusion>
90
+                <exclusion>
91
+                    <artifactId>jms</artifactId>
92
+                    <groupId>javax.jms</groupId>
93
+                </exclusion>
94
+                <exclusion>
95
+                    <groupId>log4j</groupId>
96
+                    <artifactId>log4j</artifactId>
97
+                </exclusion>
98
+                <exclusion>
99
+                    <artifactId>slf4j-log4j12</artifactId>
100
+                    <groupId>org.slf4j</groupId>
101
+                </exclusion>
102
+            </exclusions>
103
+            <version>${zookeeper.version}</version>
104
+        </dependency>
105
+        <dependency>
106
+            <groupId>com.github.sgroschupf</groupId>
107
+            <artifactId>zkclient</artifactId>
108
+            <version>${zkclient.version}</version>
109
+        </dependency>
110
+
111
+        <!-- MySQL 连接驱动依赖 -->
112
+        <dependency>
113
+            <groupId>mysql</groupId>
114
+            <artifactId>mysql-connector-java</artifactId>
115
+            <version>${mysql-connector}</version>
116
+        </dependency>
117
+        <dependency>
118
+            <groupId>org.mybatis.spring.boot</groupId>
119
+            <artifactId>mybatis-spring-boot-starter</artifactId>
120
+            <version>${mybatis-spring-boot}</version>
121
+        </dependency>
122
+
123
+
124
+
125
+    </dependencies>
126
+
127
+    <profiles>
128
+        <profile>
129
+            <id>development</id>
130
+            <activation>
131
+                <activeByDefault>true</activeByDefault>
132
+            </activation>
133
+            <properties>
134
+                <environment>development</environment>
135
+            </properties>
136
+        </profile>
137
+        <profile>
138
+            <id>test</id>
139
+            <properties>
140
+                <environment>test</environment>
141
+            </properties>
142
+        </profile>
143
+        <profile>
144
+            <id>production</id>
145
+            <properties>
146
+                <environment>production</environment>
147
+            </properties>
148
+        </profile>
149
+    </profiles>
150
+    <build>
151
+        <finalName>house-service</finalName>
152
+        <plugins>
153
+            <plugin>
154
+                <groupId>org.mybatis.generator</groupId>
155
+                <artifactId>mybatis-generator-maven-plugin</artifactId>
156
+                <version>1.3.2</version>
157
+                <configuration>
158
+                    <verbose>true</verbose>
159
+                    <overwrite>true</overwrite>
160
+                </configuration>
161
+            </plugin>
162
+            <plugin>
163
+                <groupId>org.apache.maven.plugins</groupId>
164
+                <artifactId>maven-compiler-plugin</artifactId>
165
+                <version>2.3.2</version>
166
+                <configuration>
167
+                    <source>1.7</source>
168
+                    <target>1.7</target>
169
+                    <encoding>utf-8</encoding>
170
+                </configuration>
171
+            </plugin>
172
+            <plugin>
173
+                <groupId>org.apache.maven.plugins</groupId>
174
+                <artifactId>maven-surefire-plugin</artifactId>
175
+                <version>2.9</version>
176
+                <configuration>
177
+                    <skip>true</skip>
178
+                </configuration>
179
+            </plugin>
180
+            <plugin>
181
+                <groupId>org.apache.maven.plugins</groupId>
182
+                <artifactId>maven-assembly-plugin</artifactId>
183
+                <configuration>
184
+                    <descriptors>
185
+                        <descriptor>src/main/assembly/assembly.xml</descriptor>
186
+                    </descriptors>
187
+                </configuration>
188
+                <executions>
189
+                    <execution>
190
+                        <id>make-assembly</id>
191
+                        <phase>package</phase>
192
+                        <goals>
193
+                            <goal>single</goal>
194
+                        </goals>
195
+                    </execution>
196
+                </executions>
197
+            </plugin>
198
+            <plugin>
199
+                <groupId>org.apache.maven.plugins</groupId>
200
+                <artifactId>maven-war-plugin</artifactId>
201
+                <version>2.4</version>
202
+            </plugin>
203
+            <plugin>
204
+                <groupId>org.springframework.boot</groupId>
205
+                <artifactId>spring-boot-maven-plugin</artifactId>
206
+            </plugin>
207
+        </plugins>
208
+        <!--编辑打包resources-->
209
+        <resources>
210
+            <resource>
211
+                <directory>src/main/resources</directory>
212
+                <filtering>true</filtering>
213
+            </resource>
214
+        </resources>
215
+        <filters>
216
+            <filter>${basedir}/../conf/${environment}/conf.properties</filter>
217
+        </filters>
218
+    </build>
219
+</project>

+ 35
- 0
house-service/src/main/assembly/assembly.xml Прегледај датотеку

@@ -0,0 +1,35 @@
1
+<assembly>
2
+    <id>assembly</id>
3
+    <formats>
4
+        <format>tar.gz</format>
5
+    </formats>
6
+    <includeBaseDirectory>true</includeBaseDirectory>
7
+    <fileSets>
8
+        <fileSet>
9
+            <directory>src/main/bin</directory>
10
+            <outputDirectory>bin</outputDirectory>
11
+            <fileMode>0755</fileMode>
12
+        </fileSet>
13
+        <!-- <fileSet>
14
+            <directory>src/main/assembly/conf</directory>
15
+            <outputDirectory>conf</outputDirectory>
16
+            <fileMode>0755</fileMode>
17
+        </fileSet> -->
18
+        <fileSet>
19
+            <directory>target/classes</directory>
20
+            <outputDirectory>conf</outputDirectory>
21
+            <includes>
22
+                <include>META-INF/**</include>
23
+                <include>*.properties</include>
24
+                <include>conf/**</include>
25
+            </includes>
26
+            <fileMode>0755</fileMode>
27
+        </fileSet>
28
+    </fileSets>
29
+    <dependencySets>
30
+        <dependencySet>
31
+            <useProjectArtifact>true</useProjectArtifact>
32
+            <outputDirectory>lib</outputDirectory>
33
+        </dependencySet>
34
+    </dependencySets>
35
+</assembly>

+ 92
- 0
house-service/src/main/bin/dump.sh Прегледај датотеку

@@ -0,0 +1,92 @@
1
+#!/bin/bash
2
+cd `dirname $0`
3
+BIN_DIR=`pwd`
4
+cd ..
5
+DEPLOY_DIR=`pwd`
6
+CONF_DIR=$DEPLOY_DIR/conf
7
+
8
+SERVER_NAME=`sed '/dubbo.application.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
9
+LOGS_FILE=`sed '/dubbo.log4j.file/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
10
+
11
+if [ -z "$SERVER_NAME" ]; then
12
+	SERVER_NAME=`hostname`
13
+fi
14
+
15
+PIDS=`ps -f | grep java | grep "$CONF_DIR" |awk '{print $2}'`
16
+if [ -z "$PIDS" ]; then
17
+    echo "ERROR: The $SERVER_NAME does not started!"
18
+    exit 1
19
+fi
20
+
21
+LOGS_DIR=""
22
+if [ -n "$LOGS_FILE" ]; then
23
+	LOGS_DIR=`dirname $LOGS_FILE`
24
+else
25
+	LOGS_DIR=$DEPLOY_DIR/logs
26
+fi
27
+if [ ! -d $LOGS_DIR ]; then
28
+	mkdir $LOGS_DIR
29
+fi
30
+DUMP_DIR=$LOGS_DIR/dump
31
+if [ ! -d $DUMP_DIR ]; then
32
+	mkdir $DUMP_DIR
33
+fi
34
+DUMP_DATE=`date +%Y%m%d%H%M%S`
35
+DATE_DIR=$DUMP_DIR/$DUMP_DATE
36
+if [ ! -d $DATE_DIR ]; then
37
+	mkdir $DATE_DIR
38
+fi
39
+
40
+echo -e "Dumping the $SERVER_NAME ...\c"
41
+for PID in $PIDS ; do
42
+	jstack $PID > $DATE_DIR/jstack-$PID.dump 2>&1
43
+	echo -e ".\c"
44
+	jinfo $PID > $DATE_DIR/jinfo-$PID.dump 2>&1
45
+	echo -e ".\c"
46
+	jstat -gcutil $PID > $DATE_DIR/jstat-gcutil-$PID.dump 2>&1
47
+	echo -e ".\c"
48
+	jstat -gccapacity $PID > $DATE_DIR/jstat-gccapacity-$PID.dump 2>&1
49
+	echo -e ".\c"
50
+	jmap $PID > $DATE_DIR/jmap-$PID.dump 2>&1
51
+	echo -e ".\c"
52
+	jmap -heap $PID > $DATE_DIR/jmap-heap-$PID.dump 2>&1
53
+	echo -e ".\c"
54
+	jmap -histo $PID > $DATE_DIR/jmap-histo-$PID.dump 2>&1
55
+	echo -e ".\c"
56
+	if [ -r /usr/sbin/lsof ]; then
57
+	/usr/sbin/lsof -p $PID > $DATE_DIR/lsof-$PID.dump
58
+	echo -e ".\c"
59
+	fi
60
+done
61
+
62
+if [ -r /bin/netstat ]; then
63
+/bin/netstat -an > $DATE_DIR/netstat.dump 2>&1
64
+echo -e ".\c"
65
+fi
66
+if [ -r /usr/bin/iostat ]; then
67
+/usr/bin/iostat > $DATE_DIR/iostat.dump 2>&1
68
+echo -e ".\c"
69
+fi
70
+if [ -r /usr/bin/mpstat ]; then
71
+/usr/bin/mpstat > $DATE_DIR/mpstat.dump 2>&1
72
+echo -e ".\c"
73
+fi
74
+if [ -r /usr/bin/vmstat ]; then
75
+/usr/bin/vmstat > $DATE_DIR/vmstat.dump 2>&1
76
+echo -e ".\c"
77
+fi
78
+if [ -r /usr/bin/free ]; then
79
+/usr/bin/free -t > $DATE_DIR/free.dump 2>&1
80
+echo -e ".\c"
81
+fi
82
+if [ -r /usr/bin/sar ]; then
83
+/usr/bin/sar > $DATE_DIR/sar.dump 2>&1
84
+echo -e ".\c"
85
+fi
86
+if [ -r /usr/bin/uptime ]; then
87
+/usr/bin/uptime > $DATE_DIR/uptime.dump 2>&1
88
+echo -e ".\c"
89
+fi
90
+
91
+echo "OK!"
92
+echo "DUMP: $DATE_DIR"

+ 4
- 0
house-service/src/main/bin/restart.sh Прегледај датотеку

@@ -0,0 +1,4 @@
1
+#!/bin/bash
2
+cd `dirname $0`
3
+./stop.sh
4
+./start.sh

+ 24
- 0
house-service/src/main/bin/server.sh Прегледај датотеку

@@ -0,0 +1,24 @@
1
+#!/bin/bash
2
+cd `dirname $0`
3
+if [ "$1" = "start" ]; then
4
+	./start.sh
5
+else
6
+	if [ "$1" = "stop" ]; then
7
+		./stop.sh
8
+	else
9
+		if [ "$1" = "debug" ]; then
10
+			./start.sh debug
11
+		else
12
+			if [ "$1" = "restart" ]; then
13
+				./restart.sh
14
+			else
15
+				if [ "$1" = "dump" ]; then
16
+					./dump.sh
17
+				else
18
+					echo "ERROR: Please input argument: start or stop or debug or restart or dump"
19
+				    exit 1
20
+				fi
21
+			fi
22
+		fi
23
+	fi
24
+fi

+ 22
- 0
house-service/src/main/bin/start.bat Прегледај датотеку

@@ -0,0 +1,22 @@
1
+@echo off & setlocal enabledelayedexpansion
2
+
3
+set LIB_JARS=""
4
+cd ..\lib
5
+for %%i in (*) do set LIB_JARS=!LIB_JARS!;..\lib\%%i
6
+cd ..\bin
7
+
8
+if ""%1"" == ""debug"" goto debug
9
+if ""%1"" == ""jmx"" goto jmx
10
+
11
+java -Xms64m -Xmx1024m -XX:MaxPermSize=64M -classpath ..\conf;%LIB_JARS% com.yincheng.jcjy.huiju.ServerApplication
12
+goto end
13
+
14
+:debug
15
+java -Xms64m -Xmx1024m -XX:MaxPermSize=64M -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -classpath ..\conf;%LIB_JARS% com.yincheng.jcjy.huiju.ServerApplication
16
+goto end
17
+
18
+:jmx
19
+java -Xms64m -Xmx1024m -XX:MaxPermSize=64M -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -classpath ..\conf;%LIB_JARS% com.yincheng.jcjy.huiju.ServerApplication
20
+
21
+:end
22
+pause

+ 69
- 0
house-service/src/main/bin/start.sh Прегледај датотеку

@@ -0,0 +1,69 @@
1
+#!/bin/bash
2
+cd `dirname $0`
3
+BIN_DIR=`pwd`
4
+cd ..
5
+DEPLOY_DIR=`pwd`
6
+CONF_DIR=$DEPLOY_DIR/conf
7
+
8
+SERVER_NAME=`sed '/dubbo.application.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
9
+SERVER_PROTOCOL=`sed '/dubbo.protocol.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
10
+SERVER_PORT=`sed '/dubbo.protocol.port/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
11
+LOGS_FILE=`sed '/dubbo.log4j.file/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
12
+
13
+if [ -z "$SERVER_NAME" ]; then
14
+    SERVER_NAME=`hostname`
15
+fi
16
+
17
+PIDS=`ps -f | grep java | grep "$CONF_DIR" |awk '{print $2}'`
18
+if [ -n "$PIDS" ]; then
19
+    echo "ERROR: The $SERVER_NAME already started!"
20
+    echo "PID: $PIDS"
21
+    exit 1
22
+fi
23
+
24
+if [ -n "$SERVER_PORT" ]; then
25
+    SERVER_PORT_COUNT=`netstat -tln | grep $SERVER_PORT | wc -l`
26
+    if [ $SERVER_PORT_COUNT -gt 0 ]; then
27
+        echo "ERROR: The $SERVER_NAME port $SERVER_PORT already used!"
28
+        exit 1
29
+    fi
30
+fi
31
+
32
+LOGS_DIR=""
33
+if [ -n "$LOGS_FILE" ]; then
34
+    LOGS_DIR=`dirname $LOGS_FILE`
35
+else
36
+    LOGS_DIR=$DEPLOY_DIR/logs
37
+fi
38
+if [ ! -d $LOGS_DIR ]; then
39
+    mkdir $LOGS_DIR
40
+fi
41
+STDOUT_FILE=$LOGS_DIR/stdout.log
42
+
43
+LIB_DIR=$DEPLOY_DIR/lib
44
+LIB_JARS=`ls $LIB_DIR|grep .jar|awk '{print "'$LIB_DIR'/"$0}'|tr "\n" ":"`
45
+
46
+JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true "
47
+JAVA_DEBUG_OPTS=""
48
+if [ "$1" = "debug" ]; then
49
+    JAVA_DEBUG_OPTS=" -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n "
50
+fi
51
+JAVA_JMX_OPTS=""
52
+if [ "$1" = "jmx" ]; then
53
+    JAVA_JMX_OPTS=" -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false "
54
+fi
55
+JAVA_MEM_OPTS=""
56
+BITS=`java -version 2>&1 | grep -i 64-bit`
57
+if [ -n "$BITS" ]; then
58
+    JAVA_MEM_OPTS=" -server -Xmx512m -Xms512m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "
59
+else
60
+    JAVA_MEM_OPTS=" -server -Xms512m -Xmx512m -XX:PermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
61
+fi
62
+
63
+echo -e "Starting the $SERVER_NAME ...\c"
64
+nohup java $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPTS $JAVA_JMX_OPTS -classpath $CONF_DIR:$LIB_JARS com.yincheng.jcjy.huiju.ServerApplication > $STDOUT_FILE 2>&1 &
65
+
66
+echo "OK!"
67
+PIDS=`ps -f | grep java | grep "$DEPLOY_DIR" | awk '{print $2}'`
68
+echo "PID: $PIDS"
69
+echo "STDOUT: $STDOUT_FILE"

+ 44
- 0
house-service/src/main/bin/stop.sh Прегледај датотеку

@@ -0,0 +1,44 @@
1
+#!/bin/bash
2
+cd `dirname $0`
3
+BIN_DIR=`pwd`
4
+cd ..
5
+DEPLOY_DIR=`pwd`
6
+CONF_DIR=$DEPLOY_DIR/conf
7
+
8
+SERVER_NAME=`sed '/dubbo.application.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
9
+
10
+if [ -z "$SERVER_NAME" ]; then
11
+    SERVER_NAME=`hostname`
12
+fi
13
+
14
+PIDS=`ps -f | grep java | grep "$CONF_DIR" |awk '{print $2}'`
15
+if [ -z "$PIDS" ]; then
16
+    echo "ERROR: The $SERVER_NAME does not started!"
17
+    exit 1
18
+fi
19
+
20
+if [ "$1" != "skip" ]; then
21
+    $BIN_DIR/dump.sh
22
+fi
23
+
24
+echo -e "Stopping the $SERVER_NAME ...\c"
25
+for PID in $PIDS ; do
26
+    kill $PID > /dev/null 2>&1
27
+done
28
+
29
+COUNT=0
30
+while [ $COUNT -lt 1 ]; do    
31
+    echo -e ".\c"
32
+    sleep 1
33
+    COUNT=1
34
+    for PID in $PIDS ; do
35
+        PID_EXIST=`ps -f -p $PID | grep java`
36
+        if [ -n "$PID_EXIST" ]; then
37
+            COUNT=0
38
+            break
39
+        fi
40
+    done
41
+done
42
+
43
+echo "OK!"
44
+echo "PID: $PIDS"

+ 34
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/ServerApplication.java Прегледај датотеку

@@ -0,0 +1,34 @@
1
+package com.yincheng.jcjy.huiju;
2
+
3
+import org.mybatis.spring.annotation.MapperScan;
4
+import org.springframework.boot.SpringApplication;
5
+import org.springframework.boot.autoconfigure.SpringBootApplication;
6
+import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
7
+import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
8
+import org.springframework.context.annotation.ImportResource;
9
+
10
+
11
+/**
12
+ * 类名称:com.yincheng.jcjy.huiju.service
13
+ * 类描述:服务工程启动类
14
+ * 创建人:Geng Xiang
15
+ * 创建时间:2017/9/3 19:09
16
+ *
17
+ * @version 1.0.0
18
+ */
19
+@MapperScan("com.yincheng.jcjy.huiju.dao")
20
+@SpringBootApplication
21
+@ImportResource({"classpath:dubbo-provider.xml"})
22
+public class ServerApplication implements EmbeddedServletContainerCustomizer {
23
+
24
+    public static void main(String[] args) {
25
+        // 程序启动入口
26
+        // 启动嵌入式的 Tomcat 并初始化 Spring 环境及其各 Spring 组件
27
+        SpringApplication.run(ServerApplication.class, args);
28
+    }
29
+
30
+    @Override
31
+    public void customize(ConfigurableEmbeddedServletContainer container) {
32
+        container.setPort(8689);
33
+    }
34
+}

+ 34
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/dao/building/BuildingMapper.java Прегледај датотеку

@@ -0,0 +1,34 @@
1
+package com.yincheng.jcjy.huiju.dao.building;
2
+
3
+import com.yincheng.jcjy.huiju.pc.entity.po.building.*;
4
+import org.apache.ibatis.annotations.Param;
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * 类名称:com.yincheng.jcjy.huiju.dao.building
10
+ * 类描述:楼盘 dao
11
+ * 创建人:wangf
12
+ * 创建时间:2017/11/20
13
+ *
14
+ * @version 1.0.0
15
+ */
16
+public interface BuildingMapper {
17
+    /**
18
+     * 根据条件查询房源
19
+     * @param buildingSearchVo
20
+     * @return
21
+     */
22
+    List<BuildingBaseVo> findBuildingByCondition(BuildingSearchVo buildingSearchVo);
23
+
24
+
25
+    List<BuildingMetroVo> findRelMetroByBuildingId(Integer buildingId);
26
+
27
+    BuildingVo findBuildingById(Integer id);
28
+
29
+    List<NearBuilding> findNeigBuilding(@Param("lng")Double lng, @Param("lan") Double lan, @Param("size") int size);
30
+
31
+    BuildingTrafficVo getBuildDescTraffic(String buildingId);
32
+
33
+    List<String> selectByDivideFlag();
34
+}

+ 24
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/dao/building/SchoolMapper.java Прегледај датотеку

@@ -0,0 +1,24 @@
1
+package com.yincheng.jcjy.huiju.dao.building;
2
+
3
+import com.yincheng.jcjy.huiju.pc.entity.po.building.SchoolInfo;
4
+import java.util.List;
5
+
6
+/**
7
+ * 类名称:com.yincheng.jcjy.huiju.dao.building
8
+ * 类描述:楼盘 dao
9
+ * 创建人:wangf
10
+ * 创建时间:2017/11/23
11
+ *
12
+ * @version 1.0.0
13
+ */
14
+public interface SchoolMapper {
15
+    /**
16
+     * 查询楼盘所关联学校
17
+     * @param buildingId
18
+     * @return
19
+     */
20
+     List<SchoolInfo> getByBuildingid(int buildingId);
21
+
22
+
23
+     List<SchoolInfo> findByIds(List<String> ids);
24
+}

+ 16
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/dao/cms/ArticleInfoMapper.java Прегледај датотеку

@@ -0,0 +1,16 @@
1
+package com.yincheng.jcjy.huiju.dao.cms;
2
+
3
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.ArticleInfo;
4
+
5
+import java.util.List;
6
+
7
+/**
8
+ * Created by 施子超 on 2017/11/2.
9
+ */
10
+public interface ArticleInfoMapper {
11
+    List<ArticleInfo> find(ArticleInfo articleInfo);
12
+
13
+    ArticleInfo getById(int id);
14
+
15
+    int updatePV(int id);
16
+}

+ 14
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/dao/cms/HotSearchMapper.java Прегледај датотеку

@@ -0,0 +1,14 @@
1
+package com.yincheng.jcjy.huiju.dao.cms;
2
+
3
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.HotSearch;
4
+
5
+import java.util.List;
6
+
7
+/**
8
+ * Created by 施子超 on 2017/11/2.
9
+ */
10
+public interface HotSearchMapper {
11
+    List<HotSearch> find(HotSearch hotSearch);
12
+
13
+    HotSearch getById(int id);
14
+}

+ 12
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/dao/cms/NewRoomRecommendMapper.java Прегледај датотеку

@@ -0,0 +1,12 @@
1
+package com.yincheng.jcjy.huiju.dao.cms;
2
+
3
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.NewRoomRecommend;
4
+
5
+import java.util.List;
6
+
7
+public interface NewRoomRecommendMapper {
8
+
9
+    List<NewRoomRecommend> findList(NewRoomRecommend roomRecommend);
10
+
11
+    NewRoomRecommend getById(int id);
12
+}

+ 15
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/dao/cms/PictureInfoMapper.java Прегледај датотеку

@@ -0,0 +1,15 @@
1
+package com.yincheng.jcjy.huiju.dao.cms;
2
+
3
+
4
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.PictureInfo;
5
+
6
+import java.util.List;
7
+
8
+
9
+/**
10
+ * Created by 施子超 on 2017/10/25.
11
+ */
12
+public interface PictureInfoMapper {
13
+
14
+    List<PictureInfo> find(PictureInfo p);
15
+}

+ 17
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/dao/cms/RoomRecommendMapper.java Прегледај датотеку

@@ -0,0 +1,17 @@
1
+package com.yincheng.jcjy.huiju.dao.cms;
2
+
3
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.RoomRecommend;
4
+
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * Created by DELL on 2017/11/6.
10
+ */
11
+
12
+public interface RoomRecommendMapper {
13
+
14
+    List<RoomRecommend> findList(RoomRecommend roomRecommend);
15
+
16
+    RoomRecommend getById(int id);
17
+}

+ 28
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/dao/loanratecfg/LoanRateCfgMapper.java Прегледај датотеку

@@ -0,0 +1,28 @@
1
+package com.yincheng.jcjy.huiju.dao.loanratecfg;
2
+
3
+import com.yincheng.jcjy.huiju.pc.entity.po.loanratecfg.LoanRateCfg;
4
+
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+/**
9
+ * 
10
+ * 房贷利率配置表dao接口.
11
+ * 
12
+ * <pre>
13
+ * 	历史记录:
14
+ * 	2017-11-09 0neBean
15
+ * 	新建文件
16
+ * </pre>
17
+ *
18
+ */
19
+public interface LoanRateCfgMapper {
20
+
21
+    /**
22
+     *
23
+     * 获取利率
24
+     */
25
+    public List<LoanRateCfg> getLoanRate();
26
+
27
+
28
+}

+ 41
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/dao/room/RoomInfoMapper.java Прегледај датотеку

@@ -0,0 +1,41 @@
1
+package com.yincheng.jcjy.huiju.dao.room;
2
+
3
+import com.yincheng.jcjy.huiju.pc.entity.po.building.Building;
4
+import com.yincheng.jcjy.huiju.pc.entity.po.room.*;
5
+import com.yincheng.jcjy.huiju.pc.entity.po.util.Pager;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+
10
+/**
11
+ * 类名称:com.yincheng.jcjy.huiju.dao.room
12
+ * 类描述:房源 dao
13
+ * 创建人:Geng Xiang
14
+ * 创建时间:2017/11/6 17:31
15
+ *
16
+ * @version 1.0.0
17
+ */
18
+public interface RoomInfoMapper {
19
+    List<RoomResultVo> findRoomByCondition(RoomSearchVo roomSearch);
20
+
21
+    RoomInfo findRoomById(Integer id);
22
+
23
+    List<RoomInfo> findRoomByBuildingId(@Param("buildingId") Integer buildingId,@Param("size") int size,@Param("roomCode")String roomCode);
24
+
25
+    List<RoomResc> findRoomDescByRoomId(Integer roomId);
26
+
27
+    RoomRole findRoomRole(Integer roomId);
28
+
29
+    List<RoomRoleVo> findUserAccountBylist(List<Integer> list);
30
+    Integer findRoomFollowChampion(Integer roomId);
31
+
32
+    Integer countBuildHouseNum(int buildingId);
33
+
34
+    Integer countBuildRentNum(int buildingId);
35
+
36
+    List<RoomResultVo> findNearRoom(@Param("lng") Double lng, @Param("lan") Double lan, @Param("size") int size, @Param("roomCode")String roomCode);
37
+
38
+    List<RoomInfo> findListByType(Building building);
39
+
40
+    List<RoomInfo> findGoodRecommend();
41
+}

+ 25
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/dao/sys/BusiCityMapper.java Прегледај датотеку

@@ -0,0 +1,25 @@
1
+package com.yincheng.jcjy.huiju.dao.sys;
2
+
3
+import com.yincheng.jcjy.huiju.pc.entity.po.sys.BusiCity;
4
+import org.apache.ibatis.annotations.Param;
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * 类名称:com.yincheng.jcjy.huiju.dao.sys
10
+ * 类描述: 区县商圈 dao
11
+ * 创建人:Geng Xiang
12
+ * 创建时间:2017/11/7 18:45
13
+ *
14
+ * @version 1.0.0
15
+ */
16
+public interface BusiCityMapper {
17
+
18
+    BusiCity findById(@Param("id") int id);
19
+
20
+    BusiCity findByCode(@Param("code") String code);
21
+
22
+    List<BusiCity> findListByParentCode(@Param("pCode")String pCode);
23
+
24
+    List<BusiCity> findListByParentId(@Param("pId") String pId);
25
+}

+ 24
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/dao/sys/MetroMapper.java Прегледај датотеку

@@ -0,0 +1,24 @@
1
+package com.yincheng.jcjy.huiju.dao.sys;
2
+
3
+
4
+import com.yincheng.jcjy.huiju.pc.entity.po.sys.SysMetro;
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * 类名称:com.yincheng.jcjy.huiju.dao.system
10
+ * 类描述:
11
+ * 创建人:Geng Xiang
12
+ * 创建时间:2017/11/18 14:43
13
+ *
14
+ * @version 1.0.0
15
+ */
16
+public interface MetroMapper {
17
+
18
+
19
+    List<SysMetro> findMetroLineList();
20
+
21
+    List<SysMetro> findMetroListByLine(String metroLineCode);
22
+
23
+    SysMetro getMetroById(Integer id);
24
+}

+ 45
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/dao/util/SysDictionaryMapper.java Прегледај датотеку

@@ -0,0 +1,45 @@
1
+package com.yincheng.jcjy.huiju.dao.util;
2
+
3
+
4
+import com.yincheng.jcjy.huiju.pc.entity.po.util.SysDictionary;
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * 
10
+ * 数据字典dao接口.
11
+ * 
12
+ * <pre>
13
+ * 	历史记录:
14
+ * 	2017-01-07 23:45 King
15
+ * 	新建文件
16
+ * </pre>
17
+ * 
18
+ * @author 
19
+ * <pre>
20
+ * SD
21
+ * 	King
22
+ * PG
23
+ *	King
24
+ * UT
25
+ *
26
+ * MA
27
+ * </pre>
28
+ * @version $Rev$
29
+ *
30
+ * <p/> $Id$
31
+ *
32
+ */
33
+public interface SysDictionaryMapper   {
34
+
35
+	/**
36
+	 * 根据分组code获取信息
37
+	 * 
38
+	 * @param code
39
+	 * @return
40
+	 */
41
+	public List<SysDictionary> getByGroupCode(String code);
42
+
43
+
44
+	public int validateCode(SysDictionary dictionary);
45
+}

+ 188
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/persistence/plugin/PageHelper.java Прегледај датотеку

@@ -0,0 +1,188 @@
1
+package com.yincheng.jcjy.huiju.persistence.plugin;
2
+
3
+import com.yincheng.jcjy.huiju.pc.entity.po.util.Pager;
4
+import org.apache.ibatis.executor.parameter.ParameterHandler;
5
+import org.apache.ibatis.executor.resultset.ResultSetHandler;
6
+import org.apache.ibatis.executor.statement.StatementHandler;
7
+import org.apache.ibatis.mapping.BoundSql;
8
+import org.apache.ibatis.mapping.MappedStatement;
9
+import org.apache.ibatis.plugin.*;
10
+import org.apache.ibatis.reflection.MetaObject;
11
+import org.apache.ibatis.reflection.SystemMetaObject;
12
+import org.apache.ibatis.scripting.defaults.DefaultParameterHandler;
13
+import org.apache.log4j.Logger;
14
+
15
+import java.sql.*;
16
+import java.util.List;
17
+import java.util.Properties;
18
+
19
+/**
20
+ * Mybatis - 通用分页拦截器
21
+ */
22
+@Intercepts({@Signature(type = StatementHandler.class, method = "prepare", args = {Connection.class,Integer.class}),
23
+        @Signature(type = ResultSetHandler.class, method = "handleResultSets", args = {Statement.class})})
24
+public class PageHelper implements Interceptor {
25
+    private static final Logger LOGGER = Logger.getLogger(PageHelper.class);
26
+
27
+    public static final ThreadLocal<Pager> localPage = new ThreadLocal<Pager>();
28
+
29
+    /**
30
+     * 开始分页
31
+     * @param pageNum   当前页号
32
+     */
33
+    public static void startPage(int pageNum) {
34
+        if (pageNum < 1){
35
+            pageNum = 1;
36
+        }
37
+        localPage.set(new Pager(pageNum));
38
+    }
39
+
40
+    /**
41
+     * 开始分页
42
+     * @param pageNum   当前页号
43
+     * @param pageSize  分页数
44
+     */
45
+    public static void startPage(int pageNum, int pageSize) {
46
+        localPage.set(new Pager(pageNum, pageSize));
47
+    }
48
+
49
+    /**
50
+     * 结束分页并返回结果,该方法必须被调用,否则localPage会一直保存下去,直到下一次startPage
51
+     * @return  Pager
52
+     */
53
+    public static Pager endPage() {
54
+        Pager page = localPage.get();
55
+        localPage.remove();
56
+        return page;
57
+    }
58
+
59
+    public Object intercept(Invocation invocation) throws Throwable {
60
+        if (localPage.get() == null) {
61
+            return invocation.proceed();
62
+        }
63
+        if (invocation.getTarget() instanceof StatementHandler) {
64
+            StatementHandler statementHandler = (StatementHandler) invocation.getTarget();
65
+            MetaObject metaStatementHandler = SystemMetaObject.forObject(statementHandler);
66
+            // 分离代理对象链(由于目标类可能被多个拦截器拦截,从而形成多次代理,通过下面的两次循环
67
+            // 可以分离出最原始的的目标类)
68
+            while (metaStatementHandler.hasGetter("h")) {
69
+                Object object = metaStatementHandler.getValue("h");
70
+                metaStatementHandler = SystemMetaObject.forObject(object);
71
+            }
72
+            // 分离最后一个代理对象的目标类
73
+            while (metaStatementHandler.hasGetter("target")) {
74
+                Object object = metaStatementHandler.getValue("target");
75
+                metaStatementHandler = SystemMetaObject.forObject(object);
76
+            }
77
+            MappedStatement mappedStatement = (MappedStatement) metaStatementHandler.getValue("delegate.mappedStatement");
78
+            //分页信息
79
+            Pager page = localPage.get();
80
+            BoundSql boundSql = (BoundSql) metaStatementHandler.getValue("delegate.boundSql");
81
+            // 分页参数作为参数对象parameterObject的一个属性
82
+            String sql = boundSql.getSql();
83
+            // 重写sql
84
+            String pageSql = buildPageSql(sql, page);
85
+            //重写分页sql
86
+            metaStatementHandler.setValue("delegate.boundSql.sql", pageSql);
87
+            Connection connection = (Connection) invocation.getArgs()[0];
88
+            // 重设分页参数里的总页数等
89
+            setPageParameter(sql, connection, mappedStatement, boundSql, page);
90
+            // 将执行权交给下一个拦截器
91
+            return invocation.proceed();
92
+        } else if (invocation.getTarget() instanceof ResultSetHandler) {
93
+            Object result = invocation.proceed();
94
+            Pager page = localPage.get();
95
+            page.setResult((List) result);
96
+            return result;
97
+        }
98
+        return null;
99
+    }
100
+
101
+    /**
102
+     * 只拦截这两种类型的
103
+     * <br>StatementHandler
104
+     * <br>ResultSetHandler
105
+     * @param target  Object
106
+     * @return         Object
107
+     */
108
+    public Object plugin(Object target) {
109
+        if (target instanceof StatementHandler || target instanceof ResultSetHandler) {
110
+            return Plugin.wrap(target, this);
111
+        } else {
112
+            return target;
113
+        }
114
+    }
115
+
116
+    public void setProperties(Properties properties) {
117
+
118
+    }
119
+
120
+    /**
121
+     * 修改原SQL为分页SQL
122
+     * @param sql    SQL
123
+     * @param page   分页对象
124
+     * @return  分页SQL
125
+     */
126
+    private String buildPageSql(String sql, Pager page) {
127
+        return  sql+" LIMIT "+page.getStartRow() +"," + (page.getPageSize());
128
+
129
+    }
130
+
131
+    /**
132
+     * 获取总记录数
133
+     * @param sql                String
134
+     * @param connection        Connection
135
+     * @param mappedStatement  MappedStatement
136
+     * @param boundSql          BoundSql
137
+     * @param page               Pager
138
+     */
139
+    private void setPageParameter(String sql, Connection connection, MappedStatement mappedStatement,
140
+                                  BoundSql boundSql, Pager page) {
141
+        // 记录总记录数
142
+        String countSql = String.format("select count(1) from (%s) as t", sql);
143
+        PreparedStatement countStmt = null;
144
+        ResultSet rs = null;
145
+        try {
146
+            countStmt = connection.prepareStatement(countSql);
147
+            BoundSql countBS = new BoundSql(mappedStatement.getConfiguration(), countSql,
148
+                    boundSql.getParameterMappings(), boundSql.getParameterObject());
149
+            setParameters(countStmt, mappedStatement, countBS, boundSql.getParameterObject());
150
+            rs = countStmt.executeQuery();
151
+            int totalCount = 0;
152
+            if (rs.next()) {
153
+                totalCount = rs.getInt(1);
154
+            }
155
+            page.setTotalRows(totalCount);
156
+            int totalPage = totalCount / page.getPageSize() + ((totalCount % page.getPageSize() == 0) ? 0 : 1);
157
+            page.setTotalPages(totalPage);
158
+        } catch (SQLException e) {
159
+            LOGGER.error("Ignore this exception", e);
160
+        } finally {
161
+            try {
162
+                assert rs != null;
163
+                rs.close();
164
+            } catch (SQLException e) {
165
+                LOGGER.error("Ignore this exception", e);
166
+            }
167
+            try {
168
+                countStmt.close();
169
+            } catch (SQLException e) {
170
+                LOGGER.error("Ignore this exception", e);
171
+            }
172
+        }
173
+    }
174
+
175
+    /**
176
+     * 代入参数值
177
+     * @param ps                 PreparedStatement
178
+     * @param mappedStatement  MappedStatement
179
+     * @param boundSql          BoundSql
180
+     * @param parameterObject  Object
181
+     * @throws SQLException
182
+     */
183
+    private void setParameters(PreparedStatement ps, MappedStatement mappedStatement, BoundSql boundSql,
184
+                               Object parameterObject) throws SQLException {
185
+        ParameterHandler parameterHandler = new DefaultParameterHandler(mappedStatement, parameterObject, boundSql);
186
+        parameterHandler.setParameters(ps);
187
+    }
188
+}

+ 136
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/service/Building/BuildingServiceImpl.java Прегледај датотеку

@@ -0,0 +1,136 @@
1
+package com.yincheng.jcjy.huiju.service.Building;
2
+
3
+import com.yincheng.jcjy.huiju.pc.api.building.BuildingService;
4
+import com.yincheng.jcjy.huiju.common.cont.Contant;
5
+import com.yincheng.jcjy.huiju.common.redis.RedisTemplate;
6
+import com.yincheng.jcjy.huiju.dao.building.BuildingMapper;
7
+import com.yincheng.jcjy.huiju.dao.building.SchoolMapper;
8
+import com.yincheng.jcjy.huiju.pc.entity.po.building.*;
9
+import com.yincheng.jcjy.huiju.pc.entity.po.util.Pager;
10
+import com.yincheng.jcjy.huiju.pc.api.room.RoomInfoSevice;
11
+import com.yincheng.jcjy.huiju.persistence.plugin.PageHelper;
12
+import org.apache.commons.lang3.StringUtils;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.stereotype.Service;
15
+
16
+import java.util.*;
17
+
18
+/**
19
+ * 类名称:com.yincheng.jcjy.huiju.service.building
20
+ * 类描述:楼盘 service 实现类
21
+ * 创建人:wangf
22
+ * 创建时间:2017/11/20
23
+ *
24
+ * @version 1.0.0
25
+ */
26
+@Service("buildingRestService")
27
+public class  BuildingServiceImpl implements BuildingService {
28
+
29
+    @Autowired
30
+    private BuildingMapper buildingMapper;
31
+    @Autowired
32
+    private SchoolMapper schoolMapper;
33
+    @Autowired
34
+    private RoomInfoSevice roomInfoSevice;
35
+    @Autowired
36
+    private RedisTemplate redisTemplate;
37
+
38
+    @Override
39
+    public Pager<BuildingBaseVo> findPageBuilding(BuildingSearchVo buildingSearchVo) {
40
+        PageHelper.startPage(buildingSearchVo.getPageNo());
41
+        buildingMapper.findBuildingByCondition(buildingSearchVo);
42
+        return PageHelper.endPage();
43
+    }
44
+
45
+    @Override
46
+    public BuildingVo getBuildingInfo(Integer id) {
47
+        BuildingVo buildingVo = buildingMapper.findBuildingById(id);
48
+            if(buildingVo != null) {
49
+                //塞入关联的学校
50
+                List<SchoolInfo> schoolInfos = schoolMapper.getByBuildingid(id);
51
+                String relSchoolIds = "";
52
+                if (schoolInfos != null) {
53
+                    for (SchoolInfo school : schoolInfos) {
54
+                        relSchoolIds += school.getId() + ",";
55
+                    }
56
+                }
57
+                buildingVo.setRelSchoolIds(relSchoolIds);
58
+
59
+                //塞入关联的地铁信息
60
+                List<BuildingMetroVo> buildingMetros = buildingMapper.findRelMetroByBuildingId(id);
61
+                buildingVo.setMetroList(buildingMetros);
62
+                String metroLines = "";
63
+                String metroStations = "";
64
+                for (BuildingMetroVo buildingMetroVo : buildingMetros) {
65
+                    metroLines += buildingMetroVo.getMetroCode() + ",";
66
+                    metroStations += buildingMetroVo.getMetroId() + ",";
67
+                }
68
+                if (StringUtils.isNotEmpty(metroStations))
69
+                    metroStations = metroStations.substring(0, metroStations.lastIndexOf(","));
70
+                if (StringUtils.isNotEmpty(metroLines))
71
+                    metroLines = metroLines.substring(0, metroLines.lastIndexOf(","));
72
+                buildingVo.setMetroLine(metroLines);
73
+                buildingVo.setMetroStation(metroStations);
74
+
75
+                buildingVo.setSchoolInfos(schoolMapper.getByBuildingid(id));
76
+        } else {
77
+            //塞入关联学校数据
78
+            String schoolIds = buildingVo.getRelSchoolIds();
79
+            if (StringUtils.isNotEmpty(schoolIds)) {
80
+                //添加进去
81
+                buildingVo.setSchoolInfos(this.findSchholByIds(Arrays.asList(schoolIds.split(","))));
82
+            }
83
+
84
+        }
85
+        if(buildingVo!=null){
86
+            buildingVo.setOnSoldNum(roomInfoSevice.getBuildingHouseCount(id));
87
+            buildingVo.setSaleRentNum(roomInfoSevice.getBuildingRentCount(id));
88
+        }
89
+        return buildingVo;
90
+    }
91
+
92
+
93
+    @Override
94
+    public List<SchoolInfo> findSchholByIds(List<String> params) {
95
+
96
+        List<String> idLeftArr = new ArrayList<>();
97
+        List<SchoolInfo> schoolInfos = new ArrayList<>();
98
+        //先从redis取出数据
99
+
100
+        Map<String, SchoolInfo> schoolMap = redisTemplate.hmget(Contant.SCHOOL_KEY, params, SchoolInfo.class);
101
+        Set<String> keyset = schoolMap.keySet();
102
+
103
+        //没有的再从数据库读取
104
+        for (String s : keyset) {
105
+            if (schoolMap.get(s) == null) {
106
+                idLeftArr.add(s);
107
+            } else {
108
+                schoolInfos.add(schoolMap.get(s));
109
+            }
110
+        }
111
+        if (idLeftArr.size() > 0) {
112
+            List<SchoolInfo> leftSchoolList = schoolMapper.findByIds(idLeftArr);
113
+            schoolInfos.addAll(leftSchoolList);
114
+            //变成map,存入redis缓存
115
+            Map<String, SchoolInfo> leftSchoolMap = new HashMap<>();
116
+            for (SchoolInfo s : leftSchoolList) {
117
+                leftSchoolMap.put(s.getId().toString(), s);
118
+            }
119
+            redisTemplate.hmset(Contant.SCHOOL_KEY, leftSchoolMap);
120
+        }
121
+        return schoolInfos;
122
+    }
123
+
124
+
125
+
126
+    @Override
127
+    public List<NearBuilding> findNeighborlyBuilding(Double lng, Double lan, int size) {
128
+        return buildingMapper.findNeigBuilding(lng, lan, size);
129
+    }
130
+
131
+    @Override
132
+    public BuildingTrafficVo getBuildDescTraffic(String id) {
133
+        return buildingMapper.getBuildDescTraffic(id);
134
+    }
135
+
136
+}

+ 54
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/service/cms/ArticleInfoServiceImpl.java Прегледај датотеку

@@ -0,0 +1,54 @@
1
+package com.yincheng.jcjy.huiju.service.cms;
2
+
3
+import com.yincheng.jcjy.huiju.pc.api.cms.ArticleInfoService;
4
+import com.yincheng.jcjy.huiju.dao.cms.ArticleInfoMapper;
5
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.ArticleInfo;
6
+import com.yincheng.jcjy.huiju.pc.entity.po.util.Pager;
7
+import com.yincheng.jcjy.huiju.persistence.plugin.PageHelper;
8
+import org.apache.commons.lang3.StringUtils;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.stereotype.Service;
11
+
12
+import java.util.ArrayList;
13
+import java.util.Arrays;
14
+import java.util.List;
15
+import java.util.Random;
16
+
17
+/**
18
+ * Created by 施子超 on 2017/11/2.
19
+ */
20
+@Service("articleInfoService")
21
+public class ArticleInfoServiceImpl implements ArticleInfoService {
22
+    @Autowired
23
+    ArticleInfoMapper dao;
24
+
25
+    @Override
26
+    public Pager<ArticleInfo> find(Integer pageNo, Integer pageSize, ArticleInfo articleInfo) {
27
+        if (pageNo==null||pageNo==0) {
28
+            pageNo = 1;
29
+        }
30
+        if (pageSize!=null&&pageSize>0) {
31
+            PageHelper.startPage(pageNo, pageSize);
32
+        } else {
33
+            PageHelper.startPage(pageNo);
34
+        }
35
+        dao.find(articleInfo);
36
+        return PageHelper.endPage();
37
+    }
38
+
39
+    @Override
40
+    public ArticleInfo getById(int id) {
41
+        ArticleInfo articleInfo= dao.getById(id);
42
+        if(StringUtils.isNotEmpty(articleInfo.getMark())){
43
+            List<String> markList = new ArrayList<>(Arrays.asList(articleInfo.getMark().split(",")));
44
+            articleInfo.setMarkList(markList);
45
+        }
46
+        articleInfo.setPv(articleInfo.getPv()+new Random().nextInt(100));
47
+        return articleInfo;
48
+    }
49
+
50
+    @Override
51
+    public int updatePV(int id) {
52
+        return dao.updatePV(id);
53
+    }
54
+}

+ 126
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/service/cms/CmsServiceImpl.java Прегледај датотеку

@@ -0,0 +1,126 @@
1
+package com.yincheng.jcjy.huiju.service.cms;
2
+
3
+import com.yincheng.jcjy.huiju.pc.api.cms.ArticleInfoService;
4
+import com.yincheng.jcjy.huiju.pc.api.cms.CmsService;
5
+import com.yincheng.jcjy.huiju.pc.api.cms.HotSearchService;
6
+import com.yincheng.jcjy.huiju.pc.api.cms.RoomRecommendService;
7
+import com.yincheng.jcjy.huiju.pc.api.util.SysDictionaryService;
8
+import com.yincheng.jcjy.huiju.pc.constant.Globals;
9
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.ArticleInfo;
10
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.HotSearch;
11
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.RoomRecommend;
12
+
13
+import com.yincheng.jcjy.huiju.pc.entity.po.util.Pager;
14
+import com.yincheng.jcjy.huiju.pc.entity.po.util.SysDictionary;
15
+import org.apache.commons.collections.map.HashedMap;
16
+import org.apache.commons.lang3.StringUtils;
17
+import org.springframework.beans.factory.annotation.Autowired;
18
+import org.springframework.stereotype.Service;
19
+
20
+import java.util.*;
21
+
22
+/**
23
+ * Created by 施子超 on 2017/11/6.
24
+ */
25
+@Service("cmsService")
26
+public class CmsServiceImpl implements CmsService {
27
+
28
+    @Autowired
29
+    private ArticleInfoService articleInfoService;
30
+    @Autowired
31
+    private SysDictionaryService sysDictionaryService;
32
+    @Autowired
33
+    private RoomRecommendService roomRecommendService;
34
+
35
+    @Override
36
+    public Map<String, Object> getList(Integer pageNo, Integer pageSize, String articleType,int sort,String mark) {
37
+        if(articleType==null){
38
+            articleType = "";
39
+        }
40
+        if(mark==null){
41
+            mark = "";
42
+        }
43
+        Map<String,Object> map = new HashedMap();
44
+        //热门资讯
45
+        Pager<ArticleInfo> recommendArticleInfoList = articleInfoService.find(pageNo,pageSize,new ArticleInfo(articleType,articleType==""&&mark==""?"1":"",sort,"",mark));
46
+
47
+        List<SysDictionary> articleInfoTagList = sysDictionaryService.getByGroupCode("articleInfo_tag");
48
+        List<SysDictionary> dictionaryList =  sysDictionaryService.getDictListbyCode("articleType");
49
+        for (ArticleInfo articleInfo:recommendArticleInfoList.getResult()){
50
+            if(StringUtils.isNotEmpty(articleInfo.getMark())){
51
+                List<String> markList = new ArrayList<>(Arrays.asList(articleInfo.getMark().split(",")));
52
+                articleInfo.setMarkList(markList);
53
+            }
54
+            articleInfo.setPv(articleInfo.getPv()+new Random().nextInt(100));
55
+        }
56
+
57
+        if(articleType == ""){
58
+            Pager<ArticleInfo> topArticleInfoList = articleInfoService.find(1,6,new ArticleInfo("","",sort,"1",""));
59
+            map.put("topArticleInfoList",topArticleInfoList.getResult());
60
+        }else{
61
+            String articleTypeName = "";
62
+            for (SysDictionary dic : dictionaryList){
63
+                if(dic.getCode().equals(articleType)){
64
+                    articleTypeName = dic.getName();
65
+                    break;
66
+                }
67
+            }
68
+            map.put("articleTypeName",articleTypeName);
69
+        }
70
+        //推荐房源
71
+        String place="0";
72
+        Pager<RoomRecommend>roomRecommendList=roomRecommendService.findList("1","5",place);
73
+        if(roomRecommendList!=null){
74
+            map.put("roomRecommendList",roomRecommendList.getResult());
75
+        }else{
76
+            map.put("roomRecommendList",new ArrayList<>());
77
+        }
78
+
79
+
80
+        map.put("page",recommendArticleInfoList);
81
+        map.put("articleInfoTagList",articleInfoTagList);
82
+        map.put("dictionaryList",dictionaryList);
83
+        map.put("articleType",articleType);
84
+        map.put("mark",mark);
85
+        map.put("aspectMap", sysDictionaryService.getDicChildMapByCode("aspect"));
86
+        return map;
87
+    }
88
+
89
+    @Override
90
+    public Map<String, Object> getOne(int id) {
91
+        Map<String,Object> map = new HashedMap();
92
+        ArticleInfo articleInfo = articleInfoService.getById(id);
93
+        List<SysDictionary> articleInfoTagList = sysDictionaryService.getByGroupCode("articleInfo_tag");
94
+        String articleType = sysDictionaryService.getDictLabel(articleInfo.getArticleType(),"articleType","");
95
+        //增加点击量
96
+        articleInfoService.updatePV(id);
97
+        List<SysDictionary> dictionaryList =  sysDictionaryService.getDictListbyCode("articleType");
98
+        Pager<RoomRecommend>roomRecommendPager=roomRecommendService.findList("1","5","0");
99
+        if(roomRecommendPager!=null){
100
+            map.put("roomRecommendList",roomRecommendPager.getResult());
101
+        }else{
102
+            map.put("roomRecommendList",new ArrayList<>());
103
+        }
104
+        map.put("dictionaryList",dictionaryList);
105
+        map.put("articleInfoTagList",articleInfoTagList);
106
+        map.put("articleInfo",articleInfo);
107
+        map.put("articleType",articleType);
108
+        map.put("aspectMap", sysDictionaryService.getDicChildMapByCode("aspect"));
109
+        return map;
110
+    }
111
+
112
+    public Map<String,Object> getHouseDetails(int id){
113
+        Map<String,Object>map=new HashMap<>();
114
+        RoomRecommend roomRecommend=roomRecommendService.getById(id);
115
+        Pager<RoomRecommend>roomRecommendPager=roomRecommendService.findList("1","5","0");
116
+
117
+        map.put("roomRecommend",roomRecommend);
118
+        if(roomRecommendPager!=null){
119
+            map.put("roomRecommendList",roomRecommendPager.getResult());
120
+        }else{
121
+            map.put("roomRecommendList",new ArrayList<>());
122
+        }
123
+
124
+        return map;
125
+    }
126
+}

+ 35
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/service/cms/HotSearchServiceImpl.java Прегледај датотеку

@@ -0,0 +1,35 @@
1
+package com.yincheng.jcjy.huiju.service.cms;
2
+
3
+import com.yincheng.jcjy.huiju.pc.api.cms.HotSearchService;
4
+import com.yincheng.jcjy.huiju.pc.entity.po.util.Pager;
5
+import com.yincheng.jcjy.huiju.dao.cms.HotSearchMapper;
6
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.HotSearch;
7
+import com.yincheng.jcjy.huiju.persistence.plugin.PageHelper;
8
+import org.springframework.beans.factory.annotation.Autowired;
9
+import org.springframework.stereotype.Service;
10
+
11
+/**
12
+ * Created by 施子超 on 2017/11/2.
13
+ */
14
+@Service("hotSearchService")
15
+public class HotSearchServiceImpl implements HotSearchService{
16
+    @Autowired
17
+    HotSearchMapper dao;
18
+
19
+    @Override
20
+    public Pager<HotSearch> find(int pageNo,int pageSize, HotSearch hotSearch) {
21
+
22
+        if (pageSize==0) {
23
+            PageHelper.startPage(pageNo, pageSize);
24
+        } else {
25
+            PageHelper.startPage(pageNo);
26
+        }
27
+        dao.find(hotSearch);
28
+        return PageHelper.endPage();
29
+    }
30
+
31
+    @Override
32
+    public HotSearch getById(int id) {
33
+        return dao.getById(id);
34
+    }
35
+}

+ 242
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/service/cms/NewRoomRecommendServiceImpl.java Прегледај датотеку

@@ -0,0 +1,242 @@
1
+package com.yincheng.jcjy.huiju.service.cms;
2
+
3
+import com.yincheng.jcjy.huiju.common.constant.CommonGlobals;
4
+import com.yincheng.jcjy.huiju.common.redis.RedisTemplate;
5
+import com.yincheng.jcjy.huiju.dao.cms.NewRoomRecommendMapper;
6
+import com.yincheng.jcjy.huiju.dao.room.RoomInfoMapper;
7
+import com.yincheng.jcjy.huiju.pc.api.cms.HotSearchService;
8
+import com.yincheng.jcjy.huiju.pc.api.cms.NewRoomRecommendService;
9
+import com.yincheng.jcjy.huiju.pc.api.cms.PictureInfoService;
10
+import com.yincheng.jcjy.huiju.pc.api.cms.RoomRecommendService;
11
+import com.yincheng.jcjy.huiju.pc.constant.Globals;
12
+import com.yincheng.jcjy.huiju.pc.entity.po.building.Building;
13
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.HotSearch;
14
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.NewRoomRecommend;
15
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.PictureInfo;
16
+import com.yincheng.jcjy.huiju.pc.entity.po.room.RoomInfo;
17
+import com.yincheng.jcjy.huiju.pc.entity.po.util.Pager;
18
+import com.yincheng.jcjy.huiju.persistence.plugin.PageHelper;
19
+import org.springframework.beans.factory.annotation.Autowired;
20
+import org.springframework.stereotype.Service;
21
+import org.springframework.util.StringUtils;
22
+
23
+import java.util.ArrayList;
24
+import java.util.HashMap;
25
+import java.util.List;
26
+import java.util.Map;
27
+
28
+/**
29
+ * Created by DELL on 2017/11/6.
30
+ */
31
+@Service("NewRoomRecommendService")
32
+public class NewRoomRecommendServiceImpl implements NewRoomRecommendService {
33
+
34
+    @Autowired
35
+    private NewRoomRecommendMapper dao;
36
+    @Autowired
37
+    private RedisTemplate redisTemplate;
38
+    @Autowired
39
+    private RoomRecommendService roomRecommendService;
40
+    @Autowired
41
+    private PictureInfoService pictureInfoService;
42
+    @Autowired
43
+    private HotSearchService hotSearchService;
44
+    @Autowired
45
+    private RoomInfoMapper roomInfoMapper;
46
+
47
+
48
+
49
+    private static String INDEX_PC_DATA_NEW_GX = "0";
50
+    private static String INDEX_PC_DATA_NEW_GS = "1";
51
+    private static String INDEX_PC_DATA_NEW_DT = "2";
52
+    private static String INDEX_PC_DATA_OLD_XQ = "1";
53
+    private static String INDEX_PC_DATA_OLD_DT = "2";
54
+    private static String BUILDING_LIST_DATA = "3";
55
+
56
+    @Override
57
+    public Pager<NewRoomRecommend> findList(String pageNo, String pageSize, String place) {
58
+
59
+        int no = StringUtils.hasText(pageNo) ? Integer.valueOf(pageNo) : 1;
60
+        if (StringUtils.hasText(pageSize)) {
61
+            PageHelper.startPage(no, Integer.valueOf(pageSize));
62
+        } else {
63
+            PageHelper.startPage(no);
64
+        }
65
+        NewRoomRecommend newroomRecommend = new NewRoomRecommend();
66
+        newroomRecommend.setPlace(place);
67
+        dao.findList(newroomRecommend);
68
+        return PageHelper.endPage();
69
+    }
70
+
71
+
72
+
73
+
74
+
75
+    @Override
76
+    public NewRoomRecommend getById(int id) {
77
+        NewRoomRecommend newroomRecommend = dao.getById(id);
78
+        return newroomRecommend;
79
+    }
80
+
81
+    @Override
82
+    public Map<String, Object> getIndexData() {
83
+        Map<String, Object> r = new HashMap<>();
84
+
85
+        //新房
86
+//        Pager<NewRoomRecommend> newGx;
87
+//        if (null == redisTemplate.get("INDEX_PC_DATA_NEW_GX")) {
88
+//            newGx = this.findList("0", "8", INDEX_PC_DATA_NEW_GX);
89
+//            redisTemplate.set("INDEX_PC_DATA_NEW_GX", newGx.getResult());
90
+//        } else {
91
+//            newGx = new Pager<NewRoomRecommend>(0);
92
+//            List<NewRoomRecommend> result = new ArrayList<>();
93
+//            result = redisTemplate.get("INDEX_PC_DATA_NEW_GX", result.getClass());
94
+//            newGx.setResult(result);
95
+//        }
96
+//
97
+//        Pager<NewRoomRecommend> newGs;
98
+//        if (null == redisTemplate.get("INDEX_PC_DATA_NEW_GS")) {
99
+//            newGs = this.findList("0", "8", INDEX_PC_DATA_NEW_GS);
100
+//            redisTemplate.set("INDEX_PC_DATA_NEW_GS", newGs.getResult());
101
+//        } else {
102
+//            newGs = new Pager<NewRoomRecommend>(0);
103
+//            List<NewRoomRecommend> result = new ArrayList<>();
104
+//            result = redisTemplate.get("INDEX_PC_DATA_NEW_GS", result.getClass());
105
+//            newGs.setResult(result);
106
+//        }
107
+//
108
+//        Pager<NewRoomRecommend> newDt;
109
+//        if (null == redisTemplate.get("INDEX_PC_DATA_NEW_DT")) {
110
+//            newDt = this.findList("0", "8", INDEX_PC_DATA_NEW_DT);
111
+//            redisTemplate.set("INDEX_PC_DATA_NEW_DT", newDt.getResult());
112
+//        } else {
113
+//            newDt = new Pager<NewRoomRecommend>(0);
114
+//            List<NewRoomRecommend> result = new ArrayList<>();
115
+//            result = redisTemplate.get("INDEX_PC_DATA_NEW_DT", result.getClass());
116
+//            newDt.setResult(result);
117
+//        }
118
+
119
+        Pager<RoomInfo> oldXq;
120
+//        if (null == redisTemplate.get("INDEX_PC_DATA_OLD_XQ")) {
121
+            //oldXq = roomRecommendService.findList("0", "8", INDEX_PC_DATA_OLD_XQ);
122
+            oldXq = this.findListByType("0","4","1","0", Globals.ROOM_TYPE_CS);
123
+//            redisTemplate.set("INDEX_PC_DATA_OLD_XQ", oldXq.getResult());
124
+//        } else {
125
+//            oldXq = new Pager<RoomInfo>(0);
126
+//            List<RoomInfo> result = new ArrayList<>();
127
+//            result = redisTemplate.get("INDEX_PC_DATA_OLD_XQ", result.getClass());
128
+//            oldXq.setResult(result);
129
+//        }
130
+
131
+        Pager<RoomInfo> oldDt;
132
+//        if (null == redisTemplate.get("INDEX_PC_DATA_OLD_DT")) {
133
+            //oldDt = roomRecommendService.findList("0", "8", INDEX_PC_DATA_OLD_DT);
134
+            oldDt = this.findListByType("0","4","0","1", Globals.ROOM_TYPE_CS);
135
+//            redisTemplate.set("INDEX_PC_DATA_OLD_DT", oldDt.getResult());
136
+//        } else {
137
+//            oldDt = new Pager<RoomInfo>(0);
138
+//            List<RoomInfo> result = new ArrayList<>();
139
+//            result = redisTemplate.get("INDEX_PC_DATA_OLD_DT", result.getClass());
140
+//            oldDt.setResult(result);
141
+//        }
142
+
143
+        Pager<RoomInfo> oldRentXq = this.findListByType("0","4","1","0", Globals.ROOM_TYPE_CZ);
144
+
145
+        Pager<RoomInfo> oldRentDt = this.findListByType("0","4","0","1", Globals.ROOM_TYPE_CZ);
146
+
147
+        List<RoomInfo> goodRecommend = this.findGoodRecommend();
148
+
149
+//        if (null == redisTemplate.get("INDEX_PC_DATA_GOOD_RECOMMEND")) {
150
+//            goodRecommend = this.findGoodRecommend();
151
+//            redisTemplate.set("INDEX_PC_DATA_GOOD_RECOMMEND", goodRecommend);
152
+//        } else {
153
+//            goodRecommend = Lists.newArrayList();
154
+//            goodRecommend = redisTemplate.get("INDEX_PC_DATA_GOOD_RECOMMEND", goodRecommend.getClass());
155
+//        }
156
+
157
+
158
+
159
+        PictureInfo pic = new PictureInfo();
160
+        pic.setPictureType(CommonGlobals.SYS_TERMINAL_PC);
161
+        pic.setPlace("0");
162
+        Pager<HotSearch> hotSearchList = hotSearchService.find(1,20,new HotSearch(com.yincheng.jcjy.huiju.pc.constant.Globals.SYS_TERMINAL_PC));
163
+//        r.put("newGx", newGx);
164
+//        r.put("newGs", newGs);
165
+//        r.put("newDt", newDt);
166
+        r.put("oldXq", oldXq);
167
+        r.put("oldDt", oldDt);
168
+        r.put("oldRentXq", oldRentXq);
169
+        r.put("oldRentDt", oldRentDt);
170
+        r.put("goodRecommend", goodRecommend);
171
+        r.put("pic", pictureInfoService.find("1","1",pic).getResult());
172
+        r.put("hotSearchList", hotSearchList.getResult());
173
+
174
+        return r;
175
+    }
176
+
177
+    /**
178
+     * 查询优势推荐
179
+     * @return
180
+     */
181
+    private List<RoomInfo> findGoodRecommend() {
182
+      return  roomInfoMapper.findGoodRecommend();
183
+
184
+    }
185
+
186
+    /**
187
+     * 查询热门推荐
188
+     * @param pageNo
189
+     * @param pageSize
190
+     * @param isSchool
191
+     * @param isMetro
192
+     * @return
193
+     */
194
+    private Pager<RoomInfo> findListByType(String pageNo, String pageSize, String isSchool,String isMetro, String roomCode) {
195
+        int no = StringUtils.hasText(pageNo) ? Integer.valueOf(pageNo) : 1;
196
+        if (StringUtils.hasText(pageSize)) {
197
+            PageHelper.startPage(no, Integer.valueOf(pageSize));
198
+        } else {
199
+            PageHelper.startPage(no);
200
+        }
201
+        Building building = new Building();
202
+//        if("1".equals(isSchool)){
203
+//            building.setIsSchool(isSchool);
204
+//        }
205
+        if("1".equals(isMetro)){
206
+            building.setIsMetro(isMetro);
207
+        }
208
+        building.setRoomCode(roomCode);
209
+        List<RoomInfo> roomInfoList = roomInfoMapper.findListByType(building);
210
+        for (RoomInfo roomInfo : roomInfoList){
211
+            String avePrice = Integer.valueOf((int) ((roomInfo.getTotalPrice() * 10000) / roomInfo.getAcreage())).toString();
212
+            roomInfo.setAvePrice(avePrice);
213
+            if (!StringUtils.isEmpty(roomInfo.getLeaseWay()) && "0".equals(roomInfo.getLeaseWay())){
214
+                roomInfo.setLeaseWay("整租");
215
+            }else{
216
+                roomInfo.setLeaseWay("合租");
217
+            }
218
+
219
+        }
220
+        return PageHelper.endPage();
221
+
222
+    }
223
+
224
+
225
+    @Override
226
+    public Pager<NewRoomRecommend> getNewHouseForBuiling() {
227
+         Pager<NewRoomRecommend> newHouses;
228
+        if (null == redisTemplate.get("BUILDING_LIST_DATA")) {
229
+            newHouses = this.findList("0", "5", BUILDING_LIST_DATA);
230
+            redisTemplate.set("BUILDING_LIST_DATA", newHouses.getResult());
231
+        } else {
232
+            newHouses = new Pager<NewRoomRecommend>(0);
233
+            List<NewRoomRecommend> result = new ArrayList<>();
234
+            result = redisTemplate.get("BUILDING_LIST_DATA", result.getClass());
235
+            newHouses.setResult(result);
236
+        }
237
+        return newHouses;
238
+    }
239
+
240
+
241
+
242
+}

+ 52
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/service/cms/PictureInfoServiceImpl.java Прегледај датотеку

@@ -0,0 +1,52 @@
1
+package com.yincheng.jcjy.huiju.service.cms;
2
+
3
+
4
+
5
+
6
+
7
+import com.yincheng.jcjy.huiju.pc.api.cms.PictureInfoService;
8
+import com.yincheng.jcjy.huiju.dao.cms.PictureInfoMapper;
9
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.PictureInfo;
10
+import com.yincheng.jcjy.huiju.pc.entity.po.util.Pager;
11
+import com.yincheng.jcjy.huiju.persistence.plugin.PageHelper;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.stereotype.Service;
14
+import org.springframework.util.StringUtils;
15
+
16
+/**
17
+ * Created by 施子超 on 2017/10/25.
18
+ */
19
+@Service("pictureInfoService")
20
+public class PictureInfoServiceImpl implements PictureInfoService {
21
+
22
+    @Autowired
23
+    private PictureInfoMapper pictureInfoMapper;
24
+
25
+    @Override
26
+    public Pager<PictureInfo> find(String pageNo, String pageSize,PictureInfo param) {
27
+        int no = StringUtils.hasText(pageNo) ? Integer.valueOf(pageNo) : 1;
28
+        if (StringUtils.hasText(pageSize)) {
29
+            PageHelper.startPage(no, Integer.valueOf(pageSize));
30
+        } else {
31
+            PageHelper.startPage(no);
32
+        }
33
+
34
+        pictureInfoMapper.find(param);
35
+        return PageHelper.endPage();
36
+    }
37
+
38
+    @Override
39
+    public Pager<PictureInfo> find(String pageNo, String pageSize) {
40
+        int no = StringUtils.hasText(pageNo) ? Integer.valueOf(pageNo) : 1;
41
+        if (StringUtils.hasText(pageSize)) {
42
+            PageHelper.startPage(no, Integer.valueOf(pageSize));
43
+        } else {
44
+            PageHelper.startPage(no);
45
+        }
46
+        pictureInfoMapper.find(new PictureInfo());
47
+        return PageHelper.endPage();
48
+
49
+    }
50
+
51
+
52
+}

+ 71
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/service/cms/RoomRecommendServiceImpl.java Прегледај датотеку

@@ -0,0 +1,71 @@
1
+package com.yincheng.jcjy.huiju.service.cms;
2
+
3
+import com.yincheng.jcjy.huiju.pc.api.cms.RoomRecommendService;
4
+import com.yincheng.jcjy.huiju.dao.cms.RoomRecommendMapper;
5
+import com.yincheng.jcjy.huiju.pc.entity.po.cms.RoomRecommend;
6
+import com.yincheng.jcjy.huiju.pc.entity.po.util.Pager;
7
+import com.yincheng.jcjy.huiju.persistence.plugin.PageHelper;
8
+import org.springframework.beans.factory.annotation.Autowired;
9
+import org.springframework.stereotype.Service;
10
+import org.springframework.util.StringUtils;
11
+
12
+import java.util.ArrayList;
13
+import java.util.List;
14
+
15
+/**
16
+ * Created by DELL on 2017/11/6.
17
+ */
18
+@Service("RoomRecommendService")
19
+public class RoomRecommendServiceImpl implements RoomRecommendService {
20
+
21
+    @Autowired
22
+    private RoomRecommendMapper dao;
23
+
24
+    @Override
25
+    public Pager<RoomRecommend> findList(String pageNo, String pageSize, String place) {
26
+
27
+        int no = StringUtils.hasText(pageNo) ? Integer.valueOf(pageNo) : 1;
28
+        if (StringUtils.hasText(pageSize)) {
29
+            PageHelper.startPage(no, Integer.valueOf(pageSize));
30
+        } else {
31
+            PageHelper.startPage(no);
32
+        }
33
+        RoomRecommend roomRecommend=new RoomRecommend();
34
+        roomRecommend.setPlace(place);
35
+        dao.findList(roomRecommend);
36
+        return PageHelper.endPage();
37
+    }
38
+
39
+    @Override
40
+    public RoomRecommend getById(int id) {
41
+        RoomRecommend roomRecommend=dao.getById(id);
42
+
43
+        String roomType=roomRecommend.getRoomInfo().getRoomType();
44
+        String[]roomTypes=roomType.split(",");
45
+        List roomTypeList=new ArrayList();
46
+        for(int i=0;i<roomTypes.length;i++){
47
+            roomTypeList.add(roomTypes[i]);
48
+        }
49
+        roomRecommend.setRoomTypeList(roomTypeList);
50
+
51
+        String roomFloor=roomRecommend.getRoomInfo().getRoomFloor();
52
+        String[]roomFloors=roomFloor.split(",");
53
+        List roomFloorList=new ArrayList();
54
+        for(int j=0;j<roomFloors.length;j++){
55
+            roomFloorList.add(roomFloors[j]);
56
+        }
57
+        roomRecommend.setRoomFloorList(roomFloorList);
58
+
59
+        String tags=roomRecommend.getRoomInfo().getTags();
60
+        String []tages=tags.split(",");
61
+        List tagsList=new ArrayList();
62
+        for(int k=0;k<tages.length;k++){
63
+            tagsList.add(tages[k]);
64
+        }
65
+        roomRecommend.setTagsList(tagsList);
66
+
67
+        roomRecommend.setLocation("南京新街口");
68
+
69
+        return roomRecommend;
70
+    }
71
+}

+ 22
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/service/loanratecfg/LoanRateCfgServiceimpl.java Прегледај датотеку

@@ -0,0 +1,22 @@
1
+package com.yincheng.jcjy.huiju.service.loanratecfg;
2
+
3
+import com.yincheng.jcjy.huiju.dao.loanratecfg.LoanRateCfgMapper;
4
+import com.yincheng.jcjy.huiju.pc.api.loanratecfg.LoanRateCfgService;
5
+import com.yincheng.jcjy.huiju.pc.entity.po.loanratecfg.LoanRateCfg;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.stereotype.Service;
8
+
9
+import java.util.List;
10
+
11
+
12
+@Service("LoanRateCfgService")
13
+public class LoanRateCfgServiceimpl implements LoanRateCfgService {
14
+
15
+    @Autowired
16
+    private LoanRateCfgMapper loanRateCfgMapper;
17
+
18
+    @Override
19
+    public List<LoanRateCfg> getLoanRate() {
20
+        return loanRateCfgMapper.getLoanRate();
21
+    }
22
+}

+ 160
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/service/room/RoomInfoServiceImpl.java Прегледај датотеку

@@ -0,0 +1,160 @@
1
+package com.yincheng.jcjy.huiju.service.room;
2
+
3
+import com.yincheng.jcjy.huiju.common.cont.Contant;
4
+import com.yincheng.jcjy.huiju.common.redis.RedisTemplate;
5
+import com.yincheng.jcjy.huiju.dao.room.RoomInfoMapper;
6
+import com.yincheng.jcjy.huiju.pc.api.room.RoomInfoSevice;
7
+import com.yincheng.jcjy.huiju.pc.constant.Globals;
8
+import com.yincheng.jcjy.huiju.pc.entity.po.room.*;
9
+import com.yincheng.jcjy.huiju.pc.entity.po.util.Pager;
10
+import com.yincheng.jcjy.huiju.persistence.plugin.PageHelper;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.stereotype.Service;
13
+
14
+import java.util.*;
15
+
16
+/**
17
+ * 类名称:com.yincheng.jcjy.huiju.service.room
18
+ * 类描述:房源 service 实现类
19
+ * 创建人:Geng Xiang
20
+ * 创建时间:2017/11/6 17:32
21
+ *
22
+ * @version 1.0.0
23
+ */
24
+@Service("roomInfoService")
25
+public class RoomInfoServiceImpl implements RoomInfoSevice {
26
+
27
+    @Autowired
28
+    private RoomInfoMapper roomInfoMapper;
29
+    @Autowired
30
+    private RedisTemplate redisTemplate;
31
+
32
+    @Override
33
+    public Pager<RoomResultVo> findRoomByCondition(RoomSearchVo roomSearch) {
34
+        if (Globals.ROOM_TYPE_CS.equals(roomSearch.getRoomCode())){
35
+            PageHelper.startPage(roomSearch.getPageNo(),20);
36
+        }else{
37
+            PageHelper.startPage(roomSearch.getRentPageNo(),20);
38
+        }
39
+
40
+        roomInfoMapper.findRoomByCondition(roomSearch);
41
+        return PageHelper.endPage();
42
+    }
43
+
44
+    @Override
45
+    public RoomInfo findRoomById(Integer id) {
46
+        RoomInfo roomInfo  = roomInfoMapper.findRoomById(id);
47
+        return roomInfo;
48
+    }
49
+
50
+    @Override
51
+    public List<RoomInfo> findRoomListByBuildingId(Integer buildingId, int size, String roomCode) {
52
+        List<RoomInfo> result = new ArrayList<>();
53
+        if (buildingId != null) {
54
+            size = size < 3 ? 3 : size;
55
+            result = roomInfoMapper.findRoomByBuildingId(buildingId, size, roomCode);
56
+        }
57
+        return result;
58
+    }
59
+
60
+    @Override
61
+    public List<RoomResc> findRoomDescByRoomId(Integer roomId) {
62
+
63
+        List<RoomResc> list = roomInfoMapper.findRoomDescByRoomId(roomId);
64
+        if (list == null)
65
+            list = new ArrayList<>();
66
+        return list;
67
+    }
68
+
69
+    @Override
70
+    public Date findRoomRoleInfoByRoomId(Integer roomId) {
71
+        RoomRole role = roomInfoMapper.findRoomRole(roomId);
72
+        return role.getRecordTime();
73
+    }
74
+
75
+    @Override
76
+    public Map<String, RoomRoleVo> findRoomRoleByRoomId(Integer roomId) {
77
+        Map<String, RoomRoleVo> result = new HashMap();
78
+        RoomRole role = roomInfoMapper.findRoomRole(roomId);
79
+        Integer followUserId = roomInfoMapper.findRoomFollowChampion(roomId);
80
+        if (role != null) {
81
+            List<Integer> userIds = new ArrayList<>();
82
+            userIds.add(role.getAuthId());
83
+            userIds.add(role.getKeyId());
84
+            userIds.add(role.getRescId());
85
+            userIds.add(role.getRecordId());
86
+            userIds.add(role.getBelongId());
87
+            if (followUserId != null) userIds.add(followUserId);
88
+
89
+            for (RoomRoleVo roomRoleVo : roomInfoMapper.findUserAccountBylist(userIds)) {
90
+                if ( roomRoleVo.getId().equals(role.getBelongId())) {
91
+                    roomRoleVo.setRole("belong");
92
+                    result.put("belong", roomRoleVo);
93
+                    continue;
94
+                }
95
+                if (roomRoleVo.getId().equals(role.getAuthId())) {
96
+                    roomRoleVo.setRole("auth");
97
+                    result.put("auth", roomRoleVo);
98
+                    continue;
99
+                }
100
+                if (roomRoleVo.getId().equals(role.getKeyId()) ) {
101
+                    roomRoleVo.setRole("key");
102
+                    result.put("key", roomRoleVo);
103
+                    continue;
104
+                }
105
+                if (roomRoleVo.getId().equals(role.getRecordId()) ) {
106
+                    roomRoleVo.setRole("record");
107
+                    roomRoleVo.setRoleTime(role.getRecordTime());
108
+                    result.put("record", roomRoleVo);
109
+                    continue;
110
+                }
111
+                if (roomRoleVo.getId().equals(role.getRescId()) ) {
112
+                    roomRoleVo.setRole("resc");
113
+                    result.put("resc", roomRoleVo);
114
+                    continue;
115
+                }
116
+
117
+                if (roomRoleVo.getId().equals(followUserId) ) {
118
+                    roomRoleVo.setRole("follow");
119
+                    result.put("follow", roomRoleVo);
120
+                    continue;
121
+                }
122
+            }
123
+        }
124
+//        System.out.println("------" +result.size());
125
+        return result;
126
+    }
127
+
128
+    /**
129
+     * 获取楼盘在售房源数量
130
+     *
131
+     * @param buildingId
132
+     * @return
133
+     */
134
+    @Override
135
+    public Integer getBuildingHouseCount(int buildingId) {
136
+        Integer result = roomInfoMapper.countBuildHouseNum(buildingId);
137
+        return result;
138
+    }
139
+
140
+    /**
141
+     * 获取楼盘在租房源数量
142
+     *
143
+     * @param buildingId
144
+     * @return
145
+     */
146
+    @Override
147
+    public Integer getBuildingRentCount(int buildingId) {
148
+        Integer result = roomInfoMapper.countBuildRentNum(buildingId);
149
+        return result;
150
+    }
151
+
152
+    @Override
153
+    public List<RoomResultVo> findNearRoomList(Double lng, Double lan, int size, String roomCode) {
154
+        List<com.yincheng.jcjy.huiju.wap.entity.po.room.RoomResultVo> result = new ArrayList<>();
155
+        size = size < 3 ? 3 : size;
156
+        return roomInfoMapper.findNearRoom(lng, lan, size, roomCode);
157
+    }
158
+
159
+
160
+}

+ 64
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/service/sys/BusiCityServiceImpl.java Прегледај датотеку

@@ -0,0 +1,64 @@
1
+package com.yincheng.jcjy.huiju.service.sys;
2
+
3
+import com.yincheng.jcjy.huiju.common.cont.Contant;
4
+import com.yincheng.jcjy.huiju.common.redis.RedisTemplate;
5
+import com.yincheng.jcjy.huiju.dao.sys.BusiCityMapper;
6
+import com.yincheng.jcjy.huiju.pc.api.sys.BusiCityService;
7
+import com.yincheng.jcjy.huiju.pc.entity.po.sys.BusiCity;
8
+import org.springframework.beans.factory.annotation.Autowired;
9
+import org.springframework.stereotype.Service;
10
+
11
+import java.util.List;
12
+
13
+/**
14
+ * 类名称:com.yincheng.jcjy.huiju.service.sys
15
+ * 类描述: 区县商圈service 实现
16
+ * 创建人:Geng Xiang
17
+ * 创建时间:2017/11/7 18:44
18
+ *
19
+ * @version 1.0.0
20
+ */
21
+@Service("busiCityService")
22
+public class BusiCityServiceImpl implements BusiCityService {
23
+    @Autowired
24
+    public BusiCityMapper busiCityMapper;
25
+    @Autowired
26
+    public RedisTemplate redisTemplate;
27
+
28
+    @Override
29
+    public BusiCity queryBusiCityByCode(String code) {
30
+        BusiCity busiCity = redisTemplate.get(Contant.SYS_BUSI_CITY + code, BusiCity.class);
31
+        if (busiCity == null) {
32
+            busiCity = busiCityMapper.findByCode(code);
33
+        }
34
+        return busiCity;
35
+    }
36
+
37
+    @Override
38
+    public BusiCity queryBusiCityById(Integer id) {
39
+        BusiCity busiCity = redisTemplate.get(Contant.SYS_BUSI_CITY + id, BusiCity.class);
40
+        if (busiCity == null) {
41
+            busiCity = busiCityMapper.findById(id);
42
+        }
43
+        return busiCity;
44
+    }
45
+
46
+    @Override
47
+    public List<BusiCity> queryListByParentId(String parentId) {
48
+        List<BusiCity> list = redisTemplate.lrange(Contant.SYS_BUSI_CITY_CHILDLIST + parentId, BusiCity.class);
49
+        if (list == null || list.size() == 0) {
50
+            list = busiCityMapper.findListByParentId(parentId);
51
+        }
52
+        return list;
53
+    }
54
+
55
+    @Override
56
+    public List<BusiCity> queryListByParentCode(String parentCode) {
57
+        List<BusiCity> list = redisTemplate.lrange(Contant.SYS_BUSI_CITY_CHILDLIST + parentCode, BusiCity.class);
58
+        if (list == null || list.size() == 0) {
59
+            list = busiCityMapper.findListByParentCode(parentCode);
60
+        }
61
+        return list;
62
+
63
+    }
64
+}

+ 46
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/service/sys/MetroServiceImpl.java Прегледај датотеку

@@ -0,0 +1,46 @@
1
+package com.yincheng.jcjy.huiju.service.sys;
2
+
3
+import com.yincheng.jcjy.huiju.pc.api.sys.MetroService;
4
+import com.yincheng.jcjy.huiju.common.redis.RedisTemplate;
5
+import com.yincheng.jcjy.huiju.dao.sys.MetroMapper;
6
+import com.yincheng.jcjy.huiju.pc.entity.po.sys.SysMetro;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Service;
9
+
10
+import java.util.List;
11
+
12
+/**
13
+ * 类名称:com.yincheng.jcjy.huiju.service.system
14
+ * 类描述:
15
+ * 创建人:Geng Xiang
16
+ * 创建时间:2017/11/18 14:42
17
+ *
18
+ * @version 1.0.0
19
+ */
20
+@Service("metroService")
21
+public class MetroServiceImpl implements MetroService {
22
+
23
+    @Autowired
24
+    private RedisTemplate redisTemplate;
25
+
26
+    @Autowired
27
+    private MetroMapper metroMapper;
28
+
29
+
30
+    @Override
31
+    public List<SysMetro> getMetroLine() {
32
+        return metroMapper.findMetroLineList();
33
+    }
34
+
35
+    @Override
36
+    public List<SysMetro> findStationsByLine(String lineCode) {
37
+        return metroMapper.findMetroListByLine(lineCode);
38
+    }
39
+
40
+    @Override
41
+    public SysMetro findMetroById(Integer id) {
42
+        return metroMapper.getMetroById(id);
43
+    }
44
+
45
+
46
+}

+ 82
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/service/util/SysDictionaryServiceImpl.java Прегледај датотеку

@@ -0,0 +1,82 @@
1
+package com.yincheng.jcjy.huiju.service.util;
2
+
3
+import com.yincheng.jcjy.huiju.pc.api.util.SysDictionaryService;
4
+import com.yincheng.jcjy.huiju.common.cont.Contant;
5
+import com.yincheng.jcjy.huiju.common.redis.RedisTemplate;
6
+import com.yincheng.jcjy.huiju.dao.util.SysDictionaryMapper;
7
+import com.yincheng.jcjy.huiju.pc.entity.po.util.SysDictionary;
8
+import org.springframework.beans.factory.annotation.Autowired;
9
+import org.springframework.stereotype.Service;
10
+import org.springframework.util.StringUtils;
11
+
12
+import java.util.ArrayList;
13
+import java.util.HashMap;
14
+import java.util.List;
15
+import java.util.Map;
16
+
17
+/**
18
+ * 数据字典service实现类
19
+ * <p>
20
+ * <pre>
21
+ * 	历史记录:
22
+ * 	2017-01-07 23:45 King
23
+ * 	新建文件
24
+ * </pre>
25
+ */
26
+@Service("sysDictionaryService")
27
+public class SysDictionaryServiceImpl implements SysDictionaryService {
28
+
29
+    @Autowired
30
+    private SysDictionaryMapper sysDictionaryDao;
31
+
32
+    @Autowired
33
+    private RedisTemplate redisTemplate;
34
+
35
+
36
+    public List<SysDictionary> getByGroupCode(String code) {
37
+
38
+        List<SysDictionary> sysDictionary = sysDictionaryDao.getByGroupCode(code);
39
+
40
+        return sysDictionary;
41
+    }
42
+
43
+
44
+    public String getDictLabel(String value, String code, String defaultValue) {
45
+        if (StringUtils.hasText(code) && StringUtils.hasText(value)) {
46
+
47
+            for (SysDictionary dict : getDictListbyCode(code)) {
48
+                if (value.equals(dict.getCode())) {
49
+                    return dict.getName();
50
+                }
51
+            }
52
+        }
53
+        return defaultValue;
54
+    }
55
+
56
+    public List<SysDictionary> getDictListbyCode(String code) {
57
+
58
+        List<SysDictionary> dictionarys = redisTemplate.lrange(Contant.SYS_DICT_LIST + code, SysDictionary.class);
59
+        if (dictionarys == null || dictionarys.size() == 0) {
60
+            dictionarys = getByGroupCode(code);
61
+            if (dictionarys != null) {
62
+                redisTemplate.del(Contant.SYS_DICT_LIST + code);
63
+                //重新插入缓存
64
+                redisTemplate.lpush(Contant.SYS_DICT_LIST + code, dictionarys);
65
+            } else {
66
+                dictionarys = new ArrayList<SysDictionary>();
67
+            }
68
+        }
69
+
70
+        return dictionarys;
71
+    }
72
+
73
+    @Override
74
+    public Map<String, SysDictionary> getDicChildMapByCode(String code) {
75
+        Map<String, SysDictionary> result = new HashMap<>();
76
+        List<SysDictionary> list = getDictListbyCode(code);
77
+        for (SysDictionary dictionary : list) {
78
+            result.put(dictionary.getCode(), dictionary);
79
+        }
80
+        return result;
81
+    }
82
+}

+ 43
- 0
house-service/src/main/java/com/yincheng/jcjy/huiju/util/ApplicationContextUtil.java Прегледај датотеку

@@ -0,0 +1,43 @@
1
+package com.yincheng.jcjy.huiju.util;
2
+
3
+import org.springframework.beans.BeansException;
4
+import org.springframework.context.ApplicationContext;
5
+import org.springframework.context.ApplicationContextAware;
6
+
7
+/**
8
+ * 
9
+ * @author King
10
+ *
11
+ */
12
+public class ApplicationContextUtil implements ApplicationContextAware {
13
+	
14
+	private static ApplicationContext applicationContext;
15
+
16
+	@Override
17
+	public void setApplicationContext(ApplicationContext arg0) throws BeansException {
18
+		
19
+		applicationContext = arg0;
20
+	}
21
+
22
+	/**
23
+	 * 获取ApplicationContext
24
+	 * 
25
+	 * @return
26
+	 */
27
+	public static ApplicationContext getContext() {
28
+		
29
+		return applicationContext;
30
+	}
31
+	
32
+	/**
33
+	 * 根据类名获取spring注入的类
34
+	 * 
35
+	 * @param beanName
36
+	 * @return
37
+	 */
38
+	public static Object getBean(String beanName) {
39
+		
40
+		return applicationContext.getBean(beanName);
41
+	}
42
+
43
+}

+ 27
- 0
house-service/src/main/resources/application.properties Прегледај датотеку

@@ -0,0 +1,27 @@
1
+
2
+
3
+
4
+## 数据源参数
5
+spring.datasource.url=@jdbc_url@
6
+spring.datasource.username=@jdbc_username@
7
+spring.datasource.password=@jdbc_password@
8
+spring.datasource.driver-class-name=@jdbc_driverClassName@
9
+
10
+## Mybatis 参数设置
11
+mybatis.typeAliasesPackage=com.yincheng.jcjy.huiju.entity
12
+mybatis.mapperLocations=classpath:mapper/*.xml
13
+mybatis.configLocation=classpath:mybatis-config.xml
14
+
15
+
16
+# Redis 参数设置
17
+jedis.pool.host=@redis_ip@
18
+jedis.pool.port=@redis_port@ 
19
+jedis.pool.config.maxIdle=300
20
+jedis.pool.config.maxTotal=5000
21
+
22
+#配置日志
23
+logging.config=classpath:logback-boot.xml
24
+logging.level.org.springframework.web=INFO
25
+#输出sql
26
+logging.level.com.yincheng.jcjy.huiju=WARN
27
+logging.level.org.spring.springboot.dao=DEBUG

+ 7
- 0
house-service/src/main/resources/banner.txt Прегледај датотеку

@@ -0,0 +1,7 @@
1
+  _   _   _           ____    _
2
+ | \ | | (_)         |  _ \  (_)
3
+ |  \| |  _   _   _  | |_) |  _
4
+ | . ` | | | | | | | |  _ <  | |
5
+ | |\  | | | | |_| | | |_) | | |
6
+ |_| \_| |_|  \__,_| |____/  |_|
7
+

+ 37
- 0
house-service/src/main/resources/dubbo-provider.xml Прегледај датотеку

@@ -0,0 +1,37 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
4
+       xmlns:context="http://www.springframework.org/schema/context"
5
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
6
+    http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
7
+       default-lazy-init="false">
8
+
9
+    <context:component-scan base-package="com.yincheng.jcjy.huiju.*">
10
+        <context:exclude-filter type="annotation"
11
+                                expression="org.springframework.stereotype.Controller" />
12
+    </context:component-scan>
13
+
14
+    <!-- 提供方应用信息,用于计算依赖关系 -->
15
+    <dubbo:application name="provider" owner="jcjy" />
16
+    <!-- 使用zookeeper注册中心暴露服务地址 -->
17
+     <dubbo:registry address="@zookeeper@"/>
18
+    <!-- 用dubbo协议在22008端口暴露服务 -->
19
+    <dubbo:protocol name="dubbo" port="@dubbo_pc_port@"/>
20
+    <dubbo:consumer timeout="5000" retries="0" />
21
+
22
+    <dubbo:service interface="com.yincheng.jcjy.huiju.pc.api.sys.BusiCityService" ref="busiCityService" />
23
+    <dubbo:service interface="com.yincheng.jcjy.huiju.pc.api.room.RoomInfoSevice" ref="roomInfoService" />
24
+    <dubbo:service interface="com.yincheng.jcjy.huiju.pc.api.sys.MetroService" ref="metroService" />
25
+
26
+    <dubbo:service interface="com.yincheng.jcjy.huiju.pc.api.cms.CmsService" ref="cmsService" />
27
+    <dubbo:service interface="com.yincheng.jcjy.huiju.pc.api.cms.PictureInfoService" ref="pictureInfoService" />
28
+    <dubbo:service interface="com.yincheng.jcjy.huiju.pc.api.cms.HotSearchService" ref="hotSearchService" />
29
+    <dubbo:service interface="com.yincheng.jcjy.huiju.pc.api.cms.ArticleInfoService" ref="articleInfoService" />
30
+    <dubbo:service interface="com.yincheng.jcjy.huiju.pc.api.util.SysDictionaryService" ref="sysDictionaryService" />
31
+    <dubbo:service interface="com.yincheng.jcjy.huiju.pc.api.cms.RoomRecommendService" ref="RoomRecommendService"/>
32
+    <dubbo:service interface="com.yincheng.jcjy.huiju.pc.api.cms.NewRoomRecommendService" ref="NewRoomRecommendService"/>
33
+    <dubbo:service interface="com.yincheng.jcjy.huiju.pc.api.loanratecfg.LoanRateCfgService" ref="LoanRateCfgService"/>
34
+    <!--楼盘api -->
35
+    <dubbo:service interface="com.yincheng.jcjy.huiju.pc.api.building.BuildingService" ref="buildingRestService"/>
36
+
37
+</beans>

+ 3
- 0
house-service/src/main/resources/dubbo.properties Прегледај датотеку

@@ -0,0 +1,3 @@
1
+dubbo.application.name=house-service
2
+dubbo.protocol.name=dubbo
3
+dubbo.protocol.port=22008

+ 47
- 0
house-service/src/main/resources/logback-boot.xml Прегледај датотеку

@@ -0,0 +1,47 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<configuration scan="true" scanPeriod="60 seconds" debug="false" >
3
+    <include resource="org/springframework/boot/logging/logback/base.xml" />
4
+    <logger name="org.springframework.web" level="INFO"/>
5
+    <!-- 文件输出格式 -->
6
+    <property name="PATTERN" value="%-12(%d{yyyy-MM-dd HH:mm:ss.SSS}) |-%-5level [%thread] %c [%L] -| %msg%n" />
7
+    <!-- show sql -->
8
+    <logger name="com.yincheng.jcjy.huiju.dao" level="ERROR"/>
9
+    <appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender">
10
+        <layout class="ch.qos.logback.classic.PatternLayout">
11
+            <pattern>%d - %msg%n</pattern>
12
+        </layout>
13
+    </appender>
14
+    <appender name="fileErrorLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
15
+
16
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
17
+            <!-- 文件名称 -->
18
+            <fileNamePattern>../logs/error/house-service.%d{yyyy-MM-dd}.log</fileNamePattern>
19
+            <!-- 文件最大保存历史数量 -->
20
+            <MaxHistory>100</MaxHistory>
21
+        </rollingPolicy>
22
+
23
+        <layout class="ch.qos.logback.classic.PatternLayout">
24
+            <pattern>${PATTERN}</pattern>
25
+        </layout>
26
+    </appender>
27
+    <appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
28
+
29
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
30
+            <!-- 文件名称 -->
31
+            <fileNamePattern>../logs/house-service.%d{yyyy-MM-dd}.log</fileNamePattern>
32
+            <!-- 文件最大保存历史数量 -->
33
+            <MaxHistory>100</MaxHistory>
34
+        </rollingPolicy>
35
+
36
+        <layout class="ch.qos.logback.classic.PatternLayout">
37
+            <pattern>${PATTERN}</pattern>
38
+        </layout>
39
+    </appender>
40
+
41
+    <root level="info">
42
+        <appender-ref ref="consoleLog" />
43
+        <appender-ref ref="fileInfoLog" />
44
+        <appender-ref ref="fileErrorLog" />
45
+    </root>
46
+
47
+</configuration>

+ 229
- 0
house-service/src/main/resources/mapper/BuildingMapper.xml Прегледај датотеку

@@ -0,0 +1,229 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.yincheng.jcjy.huiju.dao.building.BuildingMapper">
4
+
5
+    <parameterMap id="paramMap" type="com.yincheng.jcjy.huiju.pc.entity.po.building.BuildingSearchVo"></parameterMap>
6
+    <resultMap id="baseResultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.building.BuildingBaseVo">
7
+        <result property="id" column="id"/>
8
+        <result property="buildingName" column="building_name"/>
9
+        <result property="mainImg" column="main_img"/>
10
+        <result property="address" column="address"/>
11
+        <result property="averagePrice" column="average_price"/>
12
+        <result property="buildYear" column="build_year"/>
13
+        <result property="saleHouseNum" column="sale_house_num"/>
14
+        <result property="rentHouseNum" column="rent_house_num"/>
15
+        <result property="tagNames" column="tag_names"/>
16
+    </resultMap>
17
+
18
+    <resultMap id="resultRelationMap" type="com.yincheng.jcjy.huiju.pc.entity.po.building.BuildingVo">
19
+        <result property="id" column="id"/>
20
+        <result property="buildingName" column="building_name"/>
21
+        <result property="aliasName" column="alias_name"/>
22
+        <result property="cityCode" column="city_code"/>
23
+        <result property="districtCode" column="district_code"/>
24
+        <result property="districtName" column="district_name"/>
25
+        <result property="businessId" column="business_id"/>
26
+        <result property="businessName" column="business_name"/>
27
+        <result property="address" column="address"/>
28
+        <result property="buildYear" column="build_year"/>
29
+        <result property="developer" column="developer"/>
30
+        <result property="propertyCompany" column="property_company"/>
31
+        <result property="averagePrice" column="average_price"/>
32
+        <result property="propertyPrice" column="property_price"/>
33
+        <result property="buildType" column="build_type"/>
34
+        <result property="buildNum" column="build_num"/>
35
+        <result property="houseNum" column="house_num"/>
36
+        <result property="isMetro" column="is_metro"/>
37
+        <result property="isSchool" column="is_school"/>
38
+        <result property="status" column="status"/>
39
+        <result property="tags" column="tags"/>
40
+        <result property="isLock" column="is_lock"/>
41
+        <result property="longitude" column="longitude"/>
42
+        <result property="latitude" column="latitude"/>
43
+        <result property="updateTime" column="update_time"/>
44
+        <result property="updateUserName" column="update_user_name"/>
45
+        <result property="tagNames" column="tag_names"/>
46
+        <result property="perfectionDegree" column="perfection_degree"/>
47
+        <collection property="buildingImagesList" resultMap="imagesResult"></collection>
48
+    </resultMap>
49
+
50
+    <!--资源图片-->
51
+    <resultMap id="imagesResult" type="com.yincheng.jcjy.huiju.pc.entity.po.building.BuildingImages">
52
+        <id property="id" column="image_id"/>
53
+        <id property="url" column="url"/>
54
+        <id property="isMain" column="is_main"/>
55
+        <id property="buildingId" column="building_id"/>
56
+        <id property="sort" column="i_sort"/>
57
+    </resultMap>
58
+
59
+    <!-- 地铁信息 -->
60
+    <resultMap id="metroResult" type="com.yincheng.jcjy.huiju.pc.entity.po.building.BuildingMetroVo">
61
+        <result property="metroCode" column="metro_code"/>
62
+        <result property="metroId" column="metro_id"/>
63
+        <result property="address" column="address"/>
64
+        <result property="name" column="name"/>
65
+        <result property="distance" column="distance"/>
66
+    </resultMap>
67
+
68
+    <resultMap id="nearBuildingMap" type="com.yincheng.jcjy.huiju.pc.entity.po.building.NearBuilding">
69
+        <id property="id" column="id"/>
70
+        <result property="buildingName" column="building_name"/>
71
+        <result property="aliasName" column="alias_name"/>
72
+        <result property="address" column="address"/>
73
+        <result property="mainImg" column="main_img"/>
74
+        <result property="status" column="status"/>
75
+        <result property="longitude" column="longitude"/>
76
+        <result property="latitude" column="latitude"/>
77
+        <result property="tagNames" column="tag_names"/>
78
+        <result property="distance" column="distance"/>
79
+        <result property="averagePrice" column="average_price"/>
80
+        <result property="saleHouseNum" column="sale_house_num"/>
81
+        <result property="rentHouseNum" column="rent_house_num"/>
82
+    </resultMap>
83
+
84
+    <sql id="baseColumnSql">
85
+        <trim suffixOverrides=",">
86
+            t.id,
87
+            t.building_name,
88
+            t.main_img,
89
+            t.address,
90
+            t.average_price,
91
+            t.build_year,
92
+            t.tag_names,
93
+            IFNULL(r.sale_house_num, 0) as sale_house_num,
94
+            IFNULL(z.rent_house_num, 0) as rent_house_num,
95
+        </trim>
96
+    </sql>
97
+
98
+
99
+    <sql id="columnRealationSql">
100
+        <trim suffixOverrides=",">
101
+            t.id,
102
+            t.building_name,
103
+            t.alias_name,
104
+            t.city_code,
105
+            t.district_code,
106
+            t.business_id,
107
+            t.address,
108
+            t.build_year,
109
+            t.developer,
110
+            t.property_company,
111
+            t.average_price,
112
+            t.property_price,
113
+            t.build_type,
114
+            t.build_num,
115
+            t.house_num,
116
+            t.status,
117
+            t.tags,
118
+            t.is_lock,
119
+            t.is_metro,
120
+            t.is_school,
121
+            t.update_time,
122
+            t.longitude,
123
+            t.latitude,
124
+            t.tag_names,
125
+            t.perfection_degree,
126
+            i.id AS image_id,
127
+            i.sort AS i_sort,
128
+            i.building_id,
129
+            i.is_main,
130
+            i.url,
131
+            c.area_name as district_name,
132
+            b.area_name as business_name,
133
+        </trim>
134
+    </sql>
135
+
136
+
137
+    <select id="findBuildingById" parameterType="java.lang.Integer" resultMap="resultRelationMap">
138
+        select
139
+        <include refid="columnRealationSql"></include>
140
+        from tf_building t
141
+        LEFT JOIN (SELECT id,building_id,sort,url,is_main from tf_building_images where building_id = #{value} and (`type` is null or `type` = 1)) i
142
+        on i.building_id = t.id
143
+        left join td_business_city c on c.`code` = t.district_code
144
+        left join td_business_city b on b.id = t.business_id
145
+        where t.id = #{value}
146
+    </select>
147
+
148
+    <select id="findBuildingImg" resultMap="imagesResult" parameterType="java.lang.Integer">
149
+        SELECT * from tf_building_images  WHERE building_id = #{value}
150
+    </select>
151
+
152
+
153
+     <select id="findBuildingByCondition"  parameterMap="paramMap" resultMap="baseResultMap">
154
+        select
155
+        <include refid="baseColumnSql"/>
156
+        from tf_building t
157
+        LEFT JOIN (select COUNT(1) as sale_house_num,i.estate_id from tf_room_info i where i.`status` = '0' and i.room_code = 'cs' GROUP BY i.estate_id) as r
158
+        ON r.estate_id = t.id
159
+        LEFT JOIN (select COUNT(1) as rent_house_num,i.estate_id from tf_room_info i where i.`status` = '0' and i.room_code = 'cz' GROUP BY i.estate_id) as z
160
+        ON z.estate_id = t.id
161
+        LEFT JOIN (select COUNT(1) as deal_num,i.estate_id from tf_room_info i where i.`status` = '8' GROUP BY i.estate_id) as b
162
+        ON b.estate_id = t.id
163
+        where t.del_flag = '0' and t.status = '1'
164
+        <if test="keyword != null and keyword != ''">
165
+           AND t.building_name like concat('%',#{keyword},'%')
166
+        </if>
167
+        <if test="district != null and district != ''">
168
+            and t.district_code = #{district}
169
+        </if>
170
+        <if test="business != null and business != ''">
171
+            and t.business_id = #{business}
172
+        </if>
173
+        <if test="metroLine != null and metroLine != ''">
174
+            and FIND_IN_SET(#{metroLine},t.metro_line)
175
+        </if>
176
+        <if test="metroPoint != null and metroPoint != ''">
177
+            and FIND_IN_SET(#{metroPoint},t.metro_station)
178
+        </if>
179
+        <if test="keyword != null and keyword != ''">
180
+
181
+        </if>
182
+         <if test="priceStart != null and priceStart != ''">
183
+            and t.average_price &gt;= #{priceStart}
184
+        </if>
185
+        <if test="priceEnd != null and priceEnd != ''">
186
+            and t.average_price &lt;= #{priceEnd}
187
+        </if>
188
+        <if test="buildAgeStart != null and buildAgeStart != ''">
189
+            and YEAR(NOW())-t.build_year &gt;= #{buildAgeStart}
190
+        </if>
191
+        <if test="buildAgeEnd != null and buildAgeEnd != ''">
192
+            and YEAR(NOW())-t.build_year &lt;= #{buildAgeEnd}
193
+        </if>
194
+
195
+        ORDER BY  t.main_img desc, ${orderKey} ${orderVal}
196
+    </select>
197
+
198
+    <select id="findNeigBuilding" resultMap="nearBuildingMap">
199
+        select
200
+        t.id,t.building_name,t.alias_name,t.address,t.main_img,t.status,t.average_price,
201
+        t.longitude,t.latitude,t.tag_names,IFNULL(r.sale_house_num,0) AS sale_house_num,IFNULL(z.sale_house_num,0) AS rent_house_num,
202
+        (ACOS(SIN(( #{lan} * 3.1415) / 180 ) *SIN((t.latitude  * 3.1415) / 180 ) +
203
+        COS((#{lan} * 3.1415) / 180 ) * COS((t.latitude  * 3.1415) / 180 ) *COS((#{lng} * 3.1415) / 180
204
+        - (t.longitude * 3.1415) / 180 ) ) * 6371) as distance
205
+        from tf_building t
206
+        LEFT JOIN (select COUNT(1) as sale_house_num,i.estate_id from tf_room_info i where i.`status` = '0' and i.room_code = 'cs' GROUP BY i.estate_id) as r
207
+        ON r.estate_id = t.id
208
+        LEFT JOIN (select COUNT(1) as sale_house_num,i.estate_id from tf_room_info i where i.`status` = '0' and i.room_code = 'cz' GROUP BY i.estate_id) as z
209
+        ON z.estate_id = t.id
210
+        where  t.latitude &gt; #{lan} - 1 and
211
+        t.latitude &lt; #{lan} + 1 and
212
+        t.longitude &gt; #{lng} - 1 and
213
+        t.longitude &lt; #{lng} + 1
214
+        order by  t.main_img desc, distance  asc limit 1, ${size};
215
+    </select>
216
+
217
+    <select id="findRelMetroByBuildingId" resultMap="metroResult" parameterType="int">
218
+        SELECT m.*,s.name,(SELECT sm.name FROM sys_metro sm WHERE m.metro_code = sm.code) as address
219
+        from
220
+        tf_building_metro  m left JOIN  sys_metro s ON m.metro_id = s.id
221
+        WHERE m.building_id = #{buildingId}
222
+    </select>
223
+
224
+    <select id="getBuildDescTraffic" parameterType="java.lang.String" resultType="com.yincheng.jcjy.huiju.pc.entity.po.building.BuildingTrafficVo">
225
+		select building_id as buildingId, building_desc as buildingDesc
226
+		from tf_building_traffic
227
+		where building_id = #{buildingId}
228
+	</select>
229
+</mapper>

+ 87
- 0
house-service/src/main/resources/mapper/articleInfoMapper.xml Прегледај датотеку

@@ -0,0 +1,87 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.yincheng.jcjy.huiju.dao.cms.ArticleInfoMapper">
4
+
5
+	<parameterMap id="parameterMap" type="com.yincheng.jcjy.huiju.pc.entity.po.cms.ArticleInfo"></parameterMap>
6
+	<resultMap id="resultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.cms.ArticleInfo">
7
+		<result property="id" column="id"/>
8
+		<result property="title" column="title"/>
9
+		<result property="img" column="img"/>
10
+		<result property="content" column="content"/>
11
+		<result property="status" column="status"/>
12
+		<result property="pv" column="pv"/>
13
+		<result property="articleType" column="article_type"/>
14
+		<result property="sort" column="sort"/>
15
+		<result property="isTop" column="is_top"/>
16
+		<result property="createId" column="create_id"/>
17
+		<result property="createTime" column="create_time"/>
18
+		<result property="updateId" column="update_id"/>
19
+		<result property="updateTime" column="update_time"/>
20
+		<result property="author" column="author"/>
21
+		<result property="mark" column="mark"/>
22
+		<result property="remark" column="remark"/>
23
+	</resultMap>
24
+	<sql id="columnSql">
25
+		<trim suffixOverrides=",">
26
+			t.id,
27
+			t.title,
28
+			t.img,
29
+			t.content,
30
+			t.status,
31
+			t.pv,
32
+			t.article_type,
33
+			t.sort,
34
+			t.is_top,
35
+			t.create_id,
36
+			t.create_time,
37
+			t.update_id,
38
+			t.update_time,
39
+			t.author,
40
+			t.mark,
41
+			t.remark,
42
+			t.is_top_line
43
+		</trim>
44
+	</sql>
45
+
46
+	<select id="find" parameterMap="parameterMap" resultMap="resultMap">
47
+		select
48
+		<include refid="columnSql"></include>
49
+		from tf_article_info t
50
+		<where>
51
+				t.status = 1
52
+			<if test="articleType != null and articleType != ''">
53
+				and t.article_type = #{articleType}
54
+			</if>
55
+			<if test="isTop != null and isTop != ''">
56
+				and t.is_top = #{isTop}
57
+			</if>
58
+			<if test="isTopLine != null and isTopLine != ''">
59
+				and t.is_top_line = #{isTopLine}
60
+			</if>
61
+			<if test="mark != null and mark != ''">
62
+				and CONCAT(",",t.mark, ",%") like   CONCAT("%,",#{mark},",%")
63
+			</if>
64
+		</where>
65
+		order by
66
+
67
+		<if test="sortType==0">
68
+			t.create_time DESC
69
+		</if>
70
+		<if test="sortType==1">
71
+			t.sort
72
+		</if>
73
+	</select>
74
+	<select id="getById" parameterType="java.lang.Integer" resultMap="resultMap">
75
+		select
76
+		<include refid="columnSql"></include>
77
+		from tf_article_info t
78
+		where t.id = #{id} and status = 1
79
+	</select>
80
+
81
+	<update id="updatePV" parameterType="java.lang.Integer">
82
+		UPDATE tf_article_info t
83
+		SET pv = pv+1
84
+		WHERE t.id=#{id}
85
+	</update>
86
+
87
+</mapper>

+ 62
- 0
house-service/src/main/resources/mapper/busiCityMapper.xml Прегледај датотеку

@@ -0,0 +1,62 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.yincheng.jcjy.huiju.dao.sys.BusiCityMapper">
4
+    <resultMap id="resultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.sys.BusiCity">
5
+        <result property="id" column="id"/>
6
+        <result property="parentCode" column="parent_code"/>
7
+        <result property="areaName" column="area_name"/>
8
+        <result property="firstCode" column="first_code"/>
9
+        <result property="areaType" column="area_type"/>
10
+        <result property="sort" column="sort"/>
11
+        <result property="createId" column="create_id"/>
12
+        <result property="createTime" column="create_time"/>
13
+        <result property="code" column="code"/>
14
+    </resultMap>
15
+
16
+    <sql id="columnSql">
17
+        <trim suffixOverrides=",">
18
+            t.id,
19
+            t.parent_code,
20
+            t.area_name,
21
+            t.first_code,
22
+            t.area_type,
23
+            t.sort,
24
+            t.create_id,
25
+            t.create_time,
26
+            t.code
27
+        </trim>
28
+    </sql>
29
+
30
+    <select id="findById" resultMap="resultMap">
31
+        select
32
+        <include refid="columnSql"></include>
33
+        from td_business_city t
34
+        where t.id = #{id}
35
+    </select>
36
+
37
+    <select id="findByCode" resultMap="resultMap">
38
+        select
39
+        <include refid="columnSql"></include>
40
+        from td_business_city t
41
+        where t.code = #{code}
42
+    </select>
43
+
44
+    <select id="findListByParentCode" resultMap="resultMap">
45
+        select
46
+        <include refid="columnSql"></include>
47
+        from td_business_city t
48
+        where t.parent_code = #{pCode}
49
+        order by sort
50
+    </select>
51
+
52
+    <select id="findListByParentId" resultMap="resultMap">
53
+        select
54
+        <include refid="columnSql"></include>
55
+        from td_business_city t, td_business_city c
56
+        where t.parent_code = c.code
57
+        and c.id = #{pId}
58
+        order by sort
59
+    </select>
60
+
61
+
62
+</mapper>

+ 54
- 0
house-service/src/main/resources/mapper/hotSearchMapper.xml Прегледај датотеку

@@ -0,0 +1,54 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.yincheng.jcjy.huiju.dao.cms.HotSearchMapper">
4
+
5
+	<parameterMap id="parameterMap" type="com.yincheng.jcjy.huiju.pc.entity.po.cms.HotSearch"></parameterMap>
6
+	<resultMap id="resultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.cms.HotSearch">
7
+		<result property="id" column="id"/>
8
+		<result property="keyword" column="keyword"/>
9
+		<result property="url" column="url"/>
10
+		<result property="status" column="status"/>
11
+		<result property="sort" column="sort"/>
12
+		<result property="keywordType" column="keyword_type"/>
13
+		<result property="createId" column="create_id"/>
14
+		<result property="createName" column="createName"/>
15
+		<result property="updateName" column="updateName"/>
16
+		<result property="createTime" column="create_time"/>
17
+		<result property="updateId" column="update_id"/>
18
+		<result property="updateTime" column="update_time"/>
19
+	</resultMap>
20
+
21
+	<sql id="columnSql">
22
+		<trim suffixOverrides=",">
23
+			t.id,
24
+			t.keyword,
25
+			t.url,
26
+			t.create_id,
27
+			t.create_time,
28
+			t.status,
29
+			t.sort,
30
+			t.keyword_type,
31
+			t.update_id,
32
+			t.update_time,
33
+			(SELECT u.user_name FROM tf_user_account u WHERE  u.id = t.create_id) as createName,
34
+			(SELECT u.user_name FROM tf_user_account u WHERE  u.id = t.update_id) as updateName,
35
+		</trim>
36
+	</sql>
37
+
38
+	<select id="find" parameterMap="parameterMap" resultMap="resultMap">
39
+		select
40
+		<include refid="columnSql"></include>
41
+		from tf_hot_search t
42
+		<where>
43
+			status = 1
44
+		</where>
45
+		ORDER BY t.sort
46
+	</select>
47
+	<select id="getById" parameterType="java.lang.Integer" resultMap="resultMap">
48
+		select
49
+		<include refid="columnSql"></include>
50
+		from tf_hot_search t
51
+		where t.id = #{id} and status = 1
52
+	</select>
53
+
54
+</mapper>

+ 33
- 0
house-service/src/main/resources/mapper/loanRateCfgMapper.xml Прегледај датотеку

@@ -0,0 +1,33 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.yincheng.jcjy.huiju.dao.loanratecfg.LoanRateCfgMapper">
4
+
5
+	<parameterMap id="parameterMap" type="com.yincheng.jcjy.huiju.pc.entity.po.loanratecfg.LoanRateCfg"></parameterMap>
6
+	<resultMap id="resultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.loanratecfg.LoanRateCfg">
7
+		<result property="ratename" column="ratename"/>
8
+		<result property="shangdai" column="shangdai"/>
9
+		<result property="gongjijin" column="gongjijin"/>
10
+		<result property="rank" column="rank"/>
11
+	</resultMap>
12
+	
13
+	<sql id="columnSql">
14
+		<trim suffixOverrides=",">
15
+			        t.id,
16
+			t.ratename,
17
+			t.shangdai,
18
+			t.gongjijin,
19
+			t.rank,
20
+	 	</trim>
21
+	</sql>
22
+	
23
+	<select id="getLoanRate" parameterMap="parameterMap" resultMap="resultMap">
24
+		select
25
+			<include refid="columnSql"></include>
26
+		from tf_loan_rate_cfg t
27
+		<where>
28
+		</where>
29
+	</select>
30
+	
31
+
32
+	
33
+</mapper>

+ 183
- 0
house-service/src/main/resources/mapper/newRoomRecommendMapper.xml Прегледај датотеку

@@ -0,0 +1,183 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.yincheng.jcjy.huiju.dao.cms.NewRoomRecommendMapper">
4
+
5
+	<parameterMap id="parameterMap" type="com.yincheng.jcjy.huiju.pc.entity.po.cms.NewRoomRecommend"></parameterMap>
6
+	<resultMap id="resultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.cms.NewRoomRecommend">
7
+		<result property="url" column="url"/>
8
+		<result property="createTime" column="create_time"/>
9
+		<result property="sort" column="sort"/>
10
+		<result property="minAcreage" column="min_acreage"/>
11
+		<result property="maxAcreage" column="max_acreage"/>
12
+		<result property="totalPrice" column="total_price"/>
13
+		<result property="address" column="address"/>
14
+		<result property="buildingName" column="building_name"/>
15
+		<result property="img" column="img"/>
16
+		<result property="place" column="place"/>
17
+		<result property="isPublish" column="is_publish"/>
18
+		<result property="roomType" column="room_type"/>
19
+		<result property="saleType" column="sale_type"/>
20
+	</resultMap>
21
+
22
+	<sql id="columnSql">
23
+		<trim suffixOverrides=",">
24
+			t.id,
25
+			t.url,
26
+			t.create_time,
27
+			t.sort,
28
+			t.min_acreage,
29
+			t.max_acreage,
30
+			t.total_price,
31
+			t.address,
32
+			t.building_name,
33
+			t.img,
34
+			t.place,
35
+			t.is_publish,
36
+			t.room_type,
37
+			t.sale_type,
38
+		</trim>
39
+	</sql>
40
+
41
+	<select id="findList" parameterMap="parameterMap" resultMap="resultMap">
42
+		select
43
+		<include refid="columnSql"></include>
44
+		from tf_new_room_recommend t
45
+		<where>
46
+			t.is_publish = 1
47
+			<if test="place != null and place != ''">
48
+				and t.place = #{place}
49
+			</if>
50
+		</where>
51
+	</select>
52
+
53
+	<select id="getById" parameterType="java.lang.Integer" resultMap="resultMap">
54
+		select
55
+		<include refid="columnSql"></include>
56
+		from tf_new_room_recommend t
57
+		where t.id = #{value}
58
+	</select>
59
+
60
+	<insert id="add" parameterMap="parameterMap">
61
+		insert into tf_new_room_recommend
62
+		<trim prefix="(" suffix=")" suffixOverrides=",">
63
+			url,
64
+			create_time,
65
+			sort,
66
+			acreage,
67
+			total_price,
68
+			address,
69
+			building_name,
70
+			img,
71
+			place,
72
+			is_publish,
73
+		</trim>
74
+		<trim prefix="values (" suffix=")" suffixOverrides=",">
75
+			#{url},
76
+			#{createTime},
77
+			#{sort},
78
+			#{acreage},
79
+			#{totalPrice},
80
+			#{address},
81
+			#{buildingName},
82
+			#{img},
83
+			#{place},
84
+			#{isPublish},
85
+		</trim>
86
+	</insert>
87
+
88
+	<insert id="batchAdd" parameterType="java.util.List">
89
+		insert into tf_new_room_recommend
90
+		<trim prefix="(" suffix=")" suffixOverrides=",">
91
+			url,
92
+			create_time,
93
+			sort,
94
+			acreage,
95
+			total_price,
96
+			address,
97
+			building_name,
98
+			img,
99
+			place,
100
+			is_publish,
101
+		</trim>
102
+		values
103
+		<foreach collection="list" item="item" separator=",">
104
+			<trim prefix="(" suffix=")" suffixOverrides=",">
105
+				#{item.url},
106
+				#{item.createTime},
107
+				#{item.sort},
108
+				#{item.acreage},
109
+				#{item.totalPrice},
110
+				#{item.address},
111
+				#{item.buildingName},
112
+				#{item.img},
113
+				#{item.place},
114
+				#{item.isPublish},
115
+			</trim>
116
+		</foreach>
117
+	</insert>
118
+
119
+	<update id="update" parameterMap="parameterMap">
120
+		update tf_new_room_recommend
121
+		<set>
122
+			url = #{url},
123
+			create_time = #{createTime},
124
+			sort = #{sort},
125
+			acreage = #{acreage},
126
+			total_price = #{totalPrice},
127
+			address = #{address},
128
+			building_name = #{buildingName},
129
+			img = #{img},
130
+			place = #{place},
131
+			is_publish = #{isPublish},
132
+		</set>
133
+		where id = #{id}
134
+	</update>
135
+
136
+	<update id="updateNotNull" parameterMap="parameterMap">
137
+		update tf_new_room_recommend
138
+		<set>
139
+			<if test="url != null">
140
+				url = #{url},
141
+			</if>
142
+			<if test="createTime != null">
143
+				create_time = #{createTime},
144
+			</if>
145
+			<if test="sort != null">
146
+				sort = #{sort},
147
+			</if>
148
+			<if test="acreage != null">
149
+				acreage = #{acreage},
150
+			</if>
151
+			<if test="totalPrice != null">
152
+				total_price = #{totalPrice},
153
+			</if>
154
+			<if test="address != null">
155
+				address = #{address},
156
+			</if>
157
+			<if test="buildingName != null">
158
+				building_name = #{buildingName},
159
+			</if>
160
+			<if test="img != null">
161
+				img = #{img},
162
+			</if>
163
+			<if test="place != null">
164
+				place = #{place},
165
+			</if>
166
+			<if test="isPublish != null">
167
+				is_publish = #{isPublish},
168
+			</if>
169
+		</set>
170
+		where id = #{id}
171
+	</update>
172
+
173
+	<delete id="delete" parameterType="java.lang.Integer">
174
+		delete from tf_new_room_recommend where id = #{value}
175
+	</delete>
176
+
177
+	<delete id="batchDelete" parameterType="java.util.List">
178
+		delete from tf_new_room_recommend where id in
179
+		<foreach collection="list" item="item" open="(" close=")" separator=",">
180
+			#{item}
181
+		</foreach>
182
+	</delete>
183
+</mapper>

+ 62
- 0
house-service/src/main/resources/mapper/pictureInfoMapper.xml Прегледај датотеку

@@ -0,0 +1,62 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.yincheng.jcjy.huiju.dao.cms.PictureInfoMapper">
4
+
5
+	<parameterMap id="parameterMap" type="com.yincheng.jcjy.huiju.pc.entity.po.cms.PictureInfo"></parameterMap>
6
+	<resultMap id="resultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.cms.PictureInfo">
7
+		<result property="id" column="id"/>
8
+		<result property="title" column="title"/>
9
+		<result property="sonTitle" column="son_title"/>
10
+		<result property="smallImg" column="small_img"/>
11
+		<result property="img" column="img"/>
12
+		<result property="url" column="url"/>
13
+		<result property="status" column="status"/>
14
+		<result property="sort" column="sort"/>
15
+		<result property="pictureType" column="picture_type"/>
16
+		<result property="createId" column="create_id"/>
17
+		<result property="createName" column="createName"/>
18
+		<result property="updateName" column="updateName"/>
19
+		<result property="createTime" column="create_time"/>
20
+		<result property="updateId" column="update_id"/>
21
+		<result property="updateTime" column="update_time"/>
22
+		<result property="place" column="place"/>
23
+	</resultMap>
24
+
25
+	<sql id="columnSql">
26
+		<trim suffixOverrides=",">
27
+			t.id,
28
+			t.title,
29
+			t.son_title,
30
+			t.small_img,
31
+			t.img,
32
+			t.url,
33
+			t.status,
34
+			t.sort,
35
+			t.picture_type,
36
+			t.create_id,
37
+			t.create_time,
38
+			t.update_id,
39
+			t.update_time,
40
+	 	</trim>
41
+	</sql>
42
+	
43
+	<select id="find" parameterMap="parameterMap" resultMap="resultMap">
44
+		select
45
+			<include refid="columnSql"></include>
46
+		from tf_picture_info t
47
+		<where>
48
+			status = 1
49
+			 <if test="null != place || '' != place">
50
+				 and place = #{place}
51
+			 </if>
52
+			<if test="null != pictureType || '' != pictureType">
53
+				and picture_type = #{pictureType}
54
+			</if>
55
+		</where>
56
+		order by  t.create_time DESC
57
+	</select>
58
+
59
+
60
+
61
+
62
+</mapper>

+ 457
- 0
house-service/src/main/resources/mapper/roomInfoMapper.xml Прегледај датотеку

@@ -0,0 +1,457 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.yincheng.jcjy.huiju.dao.room.RoomInfoMapper">
4
+
5
+    <parameterMap id="parameterMap" type="com.yincheng.jcjy.huiju.pc.entity.po.room.RoomInfo"></parameterMap>
6
+    <resultMap id="resultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.room.RoomInfo">
7
+        <result property="id" column="id"/>
8
+        <result property="roomCode" column="room_code"/>
9
+        <result property="title" column="title"/>
10
+        <result property="imgUrl" column="img_url"/>
11
+        <result property="estateId" column="estate_id"/>
12
+        <result property="estateName" column="estate_name"/>
13
+        <result property="districtCode" column="district_code"/>
14
+        <result property="businessId" column="business_id"/>
15
+        <result property="metroLine" column="metro_line"/>
16
+        <result property="metroPoint" column="metro_point"/>
17
+        <result property="innerAcreage" column="inner_acreage"/>
18
+        <result property="proportion" column="proportion"/>
19
+        <result property="listTime" column="list_time"/>
20
+        <result property="roomBuild" column="room_build"/>
21
+        <result property="roomUnit" column="room_unit"/>
22
+        <result property="roomFloor" column="room_floor"/>
23
+        <result property="roomNum" column="room_num"/>
24
+        <result property="roomDesc" column="room_desc"/>
25
+        <result property="acreage" column="acreage"/>
26
+        <result property="totalPrice" column="total_price"/>
27
+        <result property="roomType" column="room_type"/>
28
+        <result property="aspect" column="aspect"/>
29
+        <result property="decoration" column="decoration"/>
30
+        <result property="elevator" column="elevator"/>
31
+        <result property="payWay" column="pay_way"/>
32
+        <result property="nature" column="nature"/>
33
+        <result property="purpose" column="purpose"/>
34
+        <result property="buildTime" column="build_time"/>
35
+        <result property="buildType" column="build_type"/>
36
+        <result property="buildYear" column="build_year"/>
37
+        <result property="metroNear" column="metro_near"/>
38
+        <result property="schoolNear" column="school_near"/>
39
+        <result property="isMortgage" column="is_mortgage"/>
40
+        <result property="tags" column="tags"/>
41
+        <result property="status" column="status"/>
42
+        <result property="ownerName" column="owner_name"/>
43
+        <result property="ownerSex" column="owner_sex"/>
44
+        <result property="ownerTel" column="owner_tel"/>
45
+        <result property="keyStatus" column="key_status"/>
46
+        <result property="rescStatus" column="resc_status"/>
47
+        <result property="authStatus" column="auth_status"/>
48
+        <result property="areaName" column="area_name"/>
49
+        <result property="avePrice" column="ave_price"/>
50
+        <result property="leaseWay" column="lease_way"/>
51
+        <result property="estateName" column="building_name"/>
52
+
53
+    </resultMap>
54
+    <resultMap id="resultVoMap" type="com.yincheng.jcjy.huiju.pc.entity.po.room.RoomResultVo">
55
+        <result property="id" column="id"/>
56
+        <result property="roomCode" column="room_code"/>
57
+        <result property="title" column="title"/>
58
+        <result property="imgUrl" column="img_url"/>
59
+        <result property="estateId" column="estate_id"/>
60
+        <result property="estateName" column="estate_name"/>
61
+        <result property="districtCode" column="district_code"/>
62
+        <result property="businessId" column="business_id"/>
63
+        <result property="metroLine" column="metro_line"/>
64
+        <result property="metroPoint" column="metro_point"/>
65
+        <result property="innerAcreage" column="inner_acreage"/>
66
+        <result property="proportion" column="proportion"/>
67
+        <result property="listTime" column="list_time"/>
68
+        <result property="roomBuild" column="room_build"/>
69
+        <result property="roomUnit" column="room_unit"/>
70
+        <result property="roomFloor" column="room_floor"/>
71
+        <result property="roomNum" column="room_num"/>
72
+        <result property="roomDesc" column="room_desc"/>
73
+        <result property="acreage" column="acreage"/>
74
+        <result property="totalPrice" column="total_price"/>
75
+        <result property="roomType" column="room_type"/>
76
+        <result property="aspect" column="aspect"/>
77
+        <result property="decoration" column="decoration"/>
78
+        <result property="elevator" column="elevator"/>
79
+        <result property="nature" column="nature"/>
80
+        <result property="purpose" column="purpose"/>
81
+        <result property="buildTime" column="build_time"/>
82
+        <result property="buildType" column="build_type"/>
83
+        <result property="metroNear" column="metro_near"/>
84
+        <result property="schoolNear" column="school_near"/>
85
+        <result property="isMortgage" column="is_mortgage"/>
86
+        <result property="tags" column="tags"/>
87
+        <result property="status" column="status"/>
88
+        <result property="ownerName" column="owner_name"/>
89
+        <result property="ownerSex" column="owner_sex"/>
90
+        <result property="ownerTel" column="owner_tel"/>
91
+        <result property="keyStatus" column="key_status"/>
92
+        <result property="rescStatus" column="resc_status"/>
93
+        <result property="authStatus" column="auth_status"/>
94
+        <result property="address" column="address"/>
95
+        <result property="buildingName" column="building_name"/>
96
+        <result property="aliasName" column="alias_name"/>
97
+        <result property="districtName" column="district_name"/>
98
+        <result property="businessArea" column="business_name"/>
99
+        <result property="distance" column="distance"/>
100
+        <result property="leaseWay" column="lease_way"/>
101
+        <result property="buildingName" column="building_name"/>
102
+    </resultMap>
103
+    <sql id="columnSql">
104
+        <trim suffixOverrides=",">
105
+            t.id,
106
+            t.room_code,
107
+            t.title,
108
+            t.img_url,
109
+            t.estate_id,
110
+            t.estate_name,
111
+            t.district_code,
112
+            t.business_id,
113
+            t.metro_line,
114
+            t.metro_point,
115
+            t.inner_acreage,
116
+            t.proportion,
117
+            t.list_time,
118
+            t.room_build,
119
+            t.room_unit,
120
+            t.room_floor,
121
+            t.room_num,
122
+            t.room_desc,
123
+            t.acreage,
124
+            t.total_price,
125
+            t.room_type,
126
+            t.aspect,
127
+            t.decoration,
128
+            t.elevator,
129
+            t.pay_way,
130
+            t.nature,
131
+            t.purpose,
132
+            t.build_time,
133
+            t.build_type,
134
+            t.build_year,
135
+            t.school_near,
136
+            t.metro_near,
137
+            t.is_mortgage,
138
+            t.tags,
139
+            t.status,
140
+            t.owner_name,
141
+            t.owner_sex,
142
+            t.owner_tel,
143
+            t.key_status,
144
+            t.resc_status,
145
+            t.auth_status,
146
+            t.lease_way,
147
+        </trim>
148
+    </sql>
149
+
150
+
151
+
152
+    <resultMap id="rescResultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.room.RoomResc">
153
+        <result property="id" column="id"/>
154
+        <result property="roomId" column="room_id"/>
155
+        <result property="url" column="url"/>
156
+        <result property="imgType" column="img_type"/>
157
+        <result property="imgTags" column="img_tags"/>
158
+        <result property="sort" column="sort"/>
159
+        <result property="isShow" column="is_show"/>
160
+        <result property="status" column="status"/>
161
+        <result property="createId" column="create_id"/>
162
+        <result property="createTime" column="create_time"/>
163
+        <result property="updateId" column="update_id"/>
164
+        <result property="updateTime" column="update_time"/>
165
+    </resultMap>
166
+
167
+    <sql id="rescColumnSql">
168
+        <trim suffixOverrides=",">
169
+            t.id,
170
+            t.room_id,
171
+            t.url,
172
+            t.img_type,
173
+            t.img_tags,
174
+            t.sort,
175
+            t.is_show,
176
+            t.status,
177
+            t.create_id,
178
+            t.create_time,
179
+            t.update_id,
180
+            t.update_time,
181
+        </trim>
182
+    </sql>
183
+
184
+    <resultMap id="roleResultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.room.RoomRole">
185
+        <result property="id" column="id"/>
186
+        <result property="roomId" column="room_id"/>
187
+        <result property="recordId" column="record_id"/>
188
+        <result property="recordTime" column="record_time"/>
189
+        <result property="rescId" column="resc_id"/>
190
+        <result property="keyId" column="key_id"/>
191
+        <result property="authId" column="auth_id"/>
192
+        <result property="belongId" column="belong_id"/>
193
+    </resultMap>
194
+
195
+    <sql id="roleColumnSql">
196
+        <trim suffixOverrides=",">
197
+            t.id,
198
+            t.room_id,
199
+            t.record_id,
200
+            t.record_time,
201
+            t.belong_id,
202
+            t.belong_time,
203
+            t.resc_id,
204
+            t.resc_time,
205
+            t.key_id,
206
+            t.key_time,
207
+            t.auth_id,
208
+            t.auth_time
209
+        </trim>
210
+    </sql>
211
+    <resultMap id="roleAccount" type="com.yincheng.jcjy.huiju.pc.entity.po.room.RoomRoleVo">
212
+        <result property="id" column="id"/>
213
+        <result property="userName" column="user_name"/>
214
+        <result property="headimg" column="head_img"/>
215
+        <result property="phone" column="tel"/>
216
+    </resultMap>
217
+
218
+
219
+
220
+
221
+    <!--热门 -->
222
+    <select id="findListByType"  resultMap="resultMap" parameterType="com.yincheng.jcjy.huiju.pc.entity.po.building.Building"  >
223
+        select
224
+        b.img_url,
225
+        b.total_price,
226
+        b.acreage,
227
+        b.title,
228
+        b.id,
229
+        d.district_code,
230
+        b.lease_way,
231
+        d.building_name,
232
+        b.room_type,
233
+        b.decoration
234
+        FROM
235
+        tf_room_info b
236
+        LEFT JOIN tf_room_role c ON c.room_id = b.id
237
+        LEFT JOIN tf_building d ON d.id = b.estate_id
238
+        WHERE b.status = 0
239
+        <if test="isMetro != null and isMetro != ''">
240
+            and d.is_metro = #{isMetro}
241
+        </if>
242
+        <if test="roomCode != null and roomCode != ''">
243
+            and b.room_code = #{roomCode}
244
+        </if>
245
+        GROUP BY
246
+        b.id
247
+        ORDER BY b.resc_status asc,b.id desc
248
+    </select>
249
+
250
+
251
+
252
+<!--获取优势推荐-->
253
+    <select id="findGoodRecommend"  resultMap="resultMap" >
254
+        SELECT
255
+            img imgUrl,
256
+            room_name title,
257
+            unit_price avePrice,
258
+            url
259
+        FROM
260
+            `tf_room_recommend`
261
+        WHERE
262
+            type = 2 AND status = 1
263
+        ORDER BY
264
+            update_time DESC
265
+        LIMIT 4
266
+    </select>
267
+
268
+    <select id="findRoomById" parameterType="java.lang.Integer" resultMap="resultMap">
269
+         select <include refid="columnSql"></include>,b.building_name
270
+        from tf_room_info t
271
+        left join tf_building b on t.estate_id = b.id
272
+        where t.id = #{value}
273
+    </select>
274
+
275
+    <select id="findRoomByBuildingId" resultMap="resultMap">
276
+        select <include refid="columnSql"></include>
277
+        from tf_room_info t
278
+        WHERE t.estate_id = #{buildingId}
279
+        AND t.status = '0'
280
+        <if test="roomCode != null or roomCode != '' ">
281
+            and room_code = #{roomCode}
282
+        </if>
283
+        order by t.resc_status asc, id desc
284
+        limit 0, ${size}
285
+    </select>
286
+
287
+    <select id="countBuildHouseNum" parameterType="java.lang.Integer" resultType="java.lang.Integer">
288
+        select count(t.id)
289
+        from tf_room_info t
290
+        WHERE t.estate_id = #{value}
291
+        and t.room_code = 'cs'
292
+        AND t.status  = '0'
293
+    </select>
294
+
295
+    <select id="countBuildRentNum" parameterType="java.lang.Integer" resultType="java.lang.Integer">
296
+        select count(t.id)
297
+        from tf_room_info t
298
+        WHERE t.estate_id = #{value}
299
+        and t.room_code = 'cz'
300
+        AND t.status  = '0'
301
+    </select>
302
+
303
+    <select id="findRoomByCondition" parameterType="com.yincheng.jcjy.huiju.pc.entity.po.room.RoomSearchVo"
304
+            resultMap="resultVoMap">
305
+        select
306
+        <include refid="columnSql"/>,
307
+        b.address AS address,
308
+        b.building_name AS building_name,
309
+        b.alias_name AS alias_name,
310
+        c1.area_name as district_name,
311
+        c2.area_name as business_name
312
+        from tf_room_info t
313
+        LEFT JOIN tf_building b on t.estate_id = b.id
314
+        LEFT JOIN tf_room_role r on t.id = r.room_id
315
+        LEFT JOIN td_business_city c1 on t.district_code= c1.`code`
316
+        LEFT JOIN td_business_city c2 on t.business_id = c2.id
317
+        where t.id = r.room_id and r.status = '0'
318
+        and t.status = '0'
319
+        <if test="roomCode != null and roomCode != ''">
320
+            AND t.room_code = #{roomCode}
321
+        </if>
322
+        <if test="rentType != null and rentType != ''">
323
+            and t.lease_way = #{rentType}
324
+        </if>
325
+        <if test="estateId != null and estateId != ''">
326
+            and t.estate_id = #{estateId}
327
+        </if>
328
+        <if test="district != null and district != ''">
329
+            and t.district_code = #{district}
330
+        </if>
331
+        <if test="business != null and business != ''">
332
+            and t.business_id = #{business}
333
+        </if>
334
+        <if test="metroLine != null and metroLine != ''">
335
+            and FIND_IN_SET(#{metroLine},t.metro_line)
336
+        </if>
337
+        <if test="metroPoint != null and metroPoint != ''">
338
+            and FIND_IN_SET(#{metroPoint},t.metro_point)
339
+        </if>
340
+        <if test="keyword != null and keyword != ''">
341
+            and (
342
+            b.building_name like concat('%',#{keyword},'%')
343
+            OR b.alias_name like concat('%',#{keyword},'%')
344
+            OR c1.area_name like concat('%',#{keyword},'%')
345
+            OR c2.area_name like concat('%',#{keyword},'%')
346
+            )
347
+        </if>
348
+        <if test="acreageStart != null and acreageStart != ''">
349
+            and t.acreage &gt;= #{acreageStart}
350
+        </if>
351
+        <if test="acreageEnd != null and acreageEnd != ''">
352
+            and t.acreage &lt;= #{acreageEnd}
353
+        </if>
354
+        <if test="acreageRentStart != null and acreageRentStart != ''">
355
+            and t.acreage &gt;= #{acreageRentStart}
356
+        </if>
357
+        <if test="acreageRentEnd != null and acreageRentEnd != ''">
358
+            and t.acreage &lt;= #{acreageRentEnd}
359
+        </if>
360
+        <if test="priceStart != null and priceStart != ''">
361
+            and t.total_price &gt;= #{priceStart}
362
+        </if>
363
+        <if test="priceEnd != null and priceEnd != ''">
364
+            and t.total_price &lt;= #{priceEnd}
365
+        </if>
366
+        <if test="rentPriceStart != null and rentPriceStart != ''">
367
+            and t.total_price &gt;= #{rentPriceStart}
368
+        </if>
369
+        <if test="rentPriceEnd != null and rentPriceEnd != ''">
370
+            and t.total_price &lt;= #{rentPriceEnd}
371
+        </if>
372
+        <if test="roomType != null and roomType != '' ">
373
+            <choose>
374
+                <when test="roomType eq 4">
375
+                    and t.room_type &gt;= #{roomType}
376
+                </when>
377
+                <otherwise>
378
+                    and t.room_type like CONCAT(#{roomType},',%')
379
+                </otherwise>
380
+            </choose>
381
+        </if>
382
+        <if test="rentRoomNum != null and rentRoomNum != '' ">
383
+            <choose>
384
+                <when test="rentRoomNum eq 4">
385
+                    and t.room_type &gt;= #{rentRoomNum}
386
+                </when>
387
+                <otherwise>
388
+                    and t.room_type like CONCAT(#{rentRoomNum},',%')
389
+                </otherwise>
390
+            </choose>
391
+        </if>
392
+        <if test="decoration != null and decoration !='' ">
393
+            and t.decoration = #{decoration}
394
+        </if>
395
+        <if test="yearStart != null and yearStart !='' ">
396
+            and YEAR(NOW())-t.build_year &gt;= #{yearStart}
397
+        </if>
398
+        <if test="yearEnd!= null and yearEnd !='' ">
399
+            and YEAR(NOW())-t.build_year &lt;= #{yearEnd}
400
+        </if>
401
+        ORDER BY t.resc_status asc, ${orderKey} ${orderVal}
402
+    </select>
403
+
404
+    <select id="findRoomDescByRoomId" parameterType="java.lang.Integer" resultMap="rescResultMap">
405
+        select
406
+        <include refid="rescColumnSql"></include>
407
+        from tf_room_resources t
408
+        where t.room_id = #{value}
409
+        and t.status = '0'
410
+        order by concat(img_type, sort) asc;
411
+    </select>
412
+
413
+    <select id="findRoomRole" resultMap="roleResultMap">
414
+        select
415
+        <include refid="roleColumnSql"></include>
416
+        from tf_room_role t
417
+        where t.room_id = #{value} and t.status = '0'
418
+    </select>
419
+
420
+    <select id="findRoomFollowChampion" resultType="java.lang.Integer">
421
+        select follow_user from
422
+        tl_follow_record t
423
+        where room_id = #{value}
424
+        GROUP BY follow_user
425
+        ORDER BY COUNT(1) DESC
426
+        limit 0,1
427
+    </select>
428
+
429
+
430
+    <select id="findUserAccountBylist" resultMap="roleAccount">
431
+        select t.id, t.user_name, t.head_img, t.tel
432
+        from tf_user_account t
433
+        where t.status = '0' and t.id in
434
+        <foreach collection="list" item="item" open="(" close=")" separator=",">
435
+            ${item}
436
+        </foreach>
437
+    </select>
438
+
439
+
440
+    <select id="findNearRoom" resultMap="resultVoMap">
441
+        select <include refid="columnSql"></include>,
442
+        b.area_name districtName,c.area_name businessArea,
443
+        (ACOS(SIN(( #{lan} * 3.1415) / 180 ) *SIN((e.latitude  * 3.1415) / 180 ) +
444
+        COS((#{lan} * 3.1415) / 180 ) * COS((e.latitude  * 3.1415) / 180 ) *COS((#{lng} * 3.1415) / 180
445
+        - (e.longitude * 3.1415) / 180 ) ) * 6371) as distance
446
+        from tf_room_info t
447
+        LEFT JOIN td_business_city b on t.district_code = b.code
448
+        LEFT JOIN td_business_city c on c.id = t.business_id
449
+        LEFT JOIN tf_building e on e.id = t.estate_id
450
+        where
451
+        ((e.latitude &gt; #{lan} -1 and e.latitude &lt; 31.981539 ) OR (e.latitude &gt; #{lan}  and e.latitude &lt; 31.981539 +1) ) AND
452
+        ((e.longitude &gt; #{lng} -1 and e.longitude  &lt; #{lng}) OR (e.longitude &gt; #{lng}  and e.longitude  &lt; #{lng} +1))
453
+        and room_code = #{roomCode}
454
+        order by t.resc_status asc, distance ASC limit 0, ${size};
455
+
456
+    </select>
457
+</mapper>

+ 87
- 0
house-service/src/main/resources/mapper/roomRecommendMapper.xml Прегледај датотеку

@@ -0,0 +1,87 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.yincheng.jcjy.huiju.dao.cms.RoomRecommendMapper">
4
+
5
+	<parameterMap id="parameterMap" type="com.yincheng.jcjy.huiju.pc.entity.po.cms.RoomRecommend"></parameterMap>
6
+	<resultMap id="resultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.cms.RoomRecommend">
7
+		<result property="id" column="id"/>
8
+		<result property="roomId" column="room_id"/>
9
+		<result property="url" column="url"/>
10
+		<result property="createId" column="create_id"/>
11
+		<result property="createTime" column="create_time"/>
12
+		<result property="updateId" column="update_id"/>
13
+		<result property="updateTime" column="update_time"/>
14
+		<result property="sort" column="sort"/>
15
+		<result property="status" column="status"/>
16
+		<result property="createName" column="createName"/>
17
+		<result property="updateName" column="updateName"/>
18
+		<result property="roomTitle" column="room_title"/>
19
+		<result property="areaName" column="area_name"/>
20
+		<result property="place" column="place"/>
21
+		<result property="roomName" column="room_name"/>
22
+		<result property="type" column="type"/> 
23
+		<association property="roomInfo" column="room_id" select="com.yincheng.jcjy.huiju.dao.room.RoomInfoMapper.findRoomById" />
24
+	</resultMap>
25
+
26
+	<sql id="columnSql">
27
+		<trim suffixOverrides=",">
28
+			t.id,
29
+			t.room_id,
30
+			t.url,
31
+			t.create_id,
32
+			t.create_time,
33
+			t.update_id,
34
+			t.update_time,
35
+			t.sort,
36
+			t.room_name,
37
+			t.status,
38
+			t.type,
39
+			(SELECT u.user_name FROM tf_user_account u WHERE  u.id = t.create_id) as createName,
40
+			(SELECT u.user_name FROM tf_user_account u WHERE  u.id = t.update_id) as updateName,
41
+		</trim>
42
+	</sql>
43
+
44
+	<select id="findList"  resultMap="resultMap" parameterMap="parameterMap">
45
+		select
46
+		<include refid="columnSql"></include>
47
+		,b.area_name,
48
+		e.average_price,e.building_name
49
+		from tf_room_recommend t
50
+		LEFT JOIN tf_room_info r ON t.room_id = r.id
51
+		LEFT JOIN tf_building e ON r.estate_id = e.id
52
+		LEFT JOIN td_business_city b ON e.district_code = b.code
53
+		<where>
54
+
55
+		  	 t.status =1
56
+			<if test="districtId != null and districtId != ''">
57
+				and e.district_code = #{districtId}
58
+			</if>
59
+			<if test="cityId != null and cityId != ''">
60
+				and e.city_code = #{cityId}
61
+			</if>
62
+			<if test="place !=null and place != ''">
63
+				and t.place =#{place}
64
+			</if>
65
+		</where>
66
+
67
+		ORDER BY t.sort DESC
68
+	</select>
69
+
70
+
71
+
72
+
73
+
74
+
75
+	<select id="getById" parameterType="java.lang.String" resultMap="resultMap">
76
+		select
77
+		<include refid="columnSql"></include>,
78
+		from tf_room_recommend t
79
+		Left JOIN tf_room_info r on t.room_id =r.id
80
+		LEFT JOIN tf_building e ON r.estate_id = e.id
81
+		where t.id = #{value}
82
+	</select>
83
+
84
+
85
+
86
+
87
+</mapper>

+ 77
- 0
house-service/src/main/resources/mapper/schoolMapper.xml Прегледај датотеку

@@ -0,0 +1,77 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.yincheng.jcjy.huiju.dao.building.SchoolMapper">
4
+
5
+    <resultMap id="resultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.building.SchoolInfo">
6
+        <result property="id" column="id"/>
7
+        <result property="schoolName" column="school_name"/>
8
+        <result property="property" column="property"/>
9
+        <result property="schoolType" column="school_type"/>
10
+        <result property="schoolImg" column="school_img"/>
11
+        <result property="cityCode" column="city_code"/>
12
+        <result property="districtCode" column="district_code"/>
13
+        <result property="districtName" column="district_name"/>
14
+        <result property="address" column="address"/>
15
+        <result property="higherSchools" column="higher_schools"/>
16
+        <result property="relBuildingNum" column="rel_building_num"/>
17
+        <result property="status" column="status"/>
18
+        <result property="level" column="level"/>
19
+        <result property="schoolDesc" column="school_desc"/>
20
+        <result property="schoolZsjz" column="school_zsjz"/>
21
+        <result property="schoolRxtj" column="school_rxtj"/>
22
+        <result property="schoolZsfw" column="school_zsfw"/>
23
+        <result property="schoolTel" column="school_tel"/>
24
+        <result property="businessId" column="business_id"/>
25
+        <result property="businessName" column="business_name"/>
26
+        <result property="characteristicIds" column="characteristic_ids"/>
27
+    </resultMap>
28
+
29
+    <sql id="columnRelSql">
30
+        <trim suffixOverrides=",">
31
+            t.id,
32
+            t.school_name,
33
+            t.property,
34
+            t.school_type,
35
+            t.school_img,
36
+            t.city_code,
37
+            t.district_code,
38
+            t.address,
39
+            t.higher_schools,
40
+            t.status,
41
+            t.level,
42
+            t.school_desc,
43
+            t.school_zsjz,
44
+            t.school_rxtj,
45
+            t.school_zsfw,
46
+            t.school_tel,
47
+            t.business_id,
48
+            t.characteristic_ids,
49
+            c.area_name as district_name,
50
+            b.area_name as business_name,
51
+        </trim>
52
+    </sql>
53
+
54
+    <select id="getByBuildingid" resultMap="resultMap">
55
+        select
56
+        <include refid="columnRelSql"></include>
57
+        from tf_school_building r LEFT JOIN
58
+        tf_school_info t on t.id = r.school_id
59
+        left join td_business_city c on c.`code` = t.district_code
60
+        left join td_business_city b on b.id = t.business_id
61
+        where r.building_id = #{id}
62
+    </select>
63
+
64
+
65
+    <select id="findByIds" resultMap="resultMap" parameterType="java.util.List">
66
+        select
67
+        <include refid="columnRelSql"></include>
68
+        from tf_school_info t
69
+        left join td_business_city c on c.`code` = t.district_code
70
+        left join td_business_city b on b.id = t.business_id
71
+        where t.id in
72
+        <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
73
+            #{item}
74
+        </foreach>
75
+    </select>
76
+
77
+</mapper>

+ 48
- 0
house-service/src/main/resources/mapper/sysDictionaryMapper.xml Прегледај датотеку

@@ -0,0 +1,48 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.yincheng.jcjy.huiju.dao.util.SysDictionaryMapper">
4
+
5
+	<parameterMap id="parameterMap" type="com.yincheng.jcjy.huiju.pc.entity.po.util.SysDictionary"></parameterMap>
6
+	<resultMap id="resultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.util.SysDictionary">
7
+		<result property="id" column="id"/>
8
+		<result property="code" column="code"/>
9
+		<result property="name" column="name"/>
10
+		<result property="groupId" column="group_id"/>
11
+		<result property="sort" column="sort"/>
12
+	</resultMap>
13
+	
14
+	<sql id="columnSql">
15
+		<trim suffixOverrides=",">
16
+			t.id,
17
+			t.code,
18
+			t.name,
19
+			t.group_id,
20
+			t.sort,
21
+		</trim>
22
+	</sql>
23
+	
24
+
25
+
26
+	<select id="validateCode" parameterMap="parameterMap" resultType="java.lang.Integer">
27
+		select
28
+			COUNT(1)
29
+		from sys_dictionary t
30
+		<where>
31
+			t.group_id is null
32
+			and t.code = #{code}
33
+			<if test="id != null and id != ''">
34
+				and t.id != #{id}
35
+			</if>
36
+		</where>
37
+	</select>
38
+	
39
+
40
+	
41
+	<select id="getByGroupCode" parameterType="java.lang.String" resultMap="resultMap">
42
+		select <include refid="columnSql"></include>
43
+		from sys_dictionary t where t.group_id = (
44
+		select c.id from sys_dictionary c where c.`code` = #{code} and c.group_id is null);
45
+	</select>
46
+
47
+	
48
+</mapper>

+ 50
- 0
house-service/src/main/resources/mapper/sysMetroMapper.xml Прегледај датотеку

@@ -0,0 +1,50 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.yincheng.jcjy.huiju.dao.sys.MetroMapper">
4
+
5
+    <parameterMap id="parameterMap" type="com.yincheng.jcjy.huiju.pc.entity.po.sys.SysMetro"></parameterMap>
6
+    <resultMap id="resultMap" type="com.yincheng.jcjy.huiju.pc.entity.po.sys.SysMetro">
7
+        <result property="address" column="address"/>
8
+        <result property="name" column="name"/>
9
+        <result property="location" column="location"/>
10
+        <result property="gdId" column="gd_id"/>
11
+        <result property="metroCodes" column="metro_codes"/>
12
+        <result property="metroType" column="metro_type"/>
13
+        <result property="code" column="code"/>
14
+        <result property="sort" column="sort"/>
15
+    </resultMap>
16
+
17
+    <sql id="columnSql">
18
+        <trim suffixOverrides=",">
19
+            t.id,
20
+            t.address,
21
+            t.name,
22
+            t.location,
23
+            t.gd_id,
24
+            t.metro_codes,
25
+            t.metro_type,
26
+            t.code,
27
+            t.sort
28
+        </trim>
29
+    </sql>
30
+
31
+    <select id="findMetroLineList" resultMap="resultMap">
32
+        SELECT <include refid="columnSql"/>
33
+        FROM sys_metro t
34
+        where  t.metro_type= '0'
35
+    </select>
36
+
37
+    <select id="findMetroListByLine" parameterType="java.lang.String" resultMap="resultMap">
38
+        select <include refid="columnSql"/>
39
+        from sys_metro t
40
+        WHERE FIND_IN_SET(#{value},t.metro_codes)
41
+    </select>
42
+
43
+    <select id="getMetroById" parameterType="java.lang.Integer" resultMap="resultMap">
44
+        SELECT <include refid="columnSql"/>
45
+        from sys_metro t
46
+        where t.id = #{value}
47
+    </select>
48
+
49
+
50
+</mapper>

+ 19
- 0
house-service/src/main/resources/mybatis-config.xml Прегледај датотеку

@@ -0,0 +1,19 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE configuration
3
+        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
4
+        "https://mybatis.org/dtd/mybatis-3-config.dtd">
5
+<configuration>
6
+    <properties>
7
+        <property name="dialect" value="mysql" />
8
+    </properties>
9
+
10
+    <settings>
11
+        <setting name="cacheEnabled" value="false" />
12
+        <!-- 打印sql语句 -->
13
+        <setting name="logImpl" value="SLF4J" />
14
+    </settings>
15
+    <!-- 分页助手 -->
16
+    <plugins>
17
+        <plugin interceptor="com.yincheng.jcjy.huiju.persistence.plugin.PageHelper"></plugin>
18
+    </plugins>
19
+</configuration>