Shanks 7 rokov pred
rodič
commit
08e7589877

+ 5 - 2
pom.xml

@@ -70,8 +70,11 @@
 			<artifactId>cors-filter</artifactId>
 			<version>1.7.1</version>
 		</dependency>
-
-    </dependencies>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-thymeleaf</artifactId>
+		</dependency>
+	</dependencies>
 
 	<build>
 		<plugins>

+ 2 - 0
src/main/resources/application.yml

@@ -11,6 +11,8 @@ spring:
     url: jdbc:mysql://121.43.235.99:3306/yuemum?useUnicode=true&characterEncoding=utf-8&noDatetimeStringSync=true
     username: jielin
     password: jielin123
+  thymeleaf:
+      prefix: classpath:/template/
 # 分页配置
 pagehelper:
   helper-dialect: mysql

+ 38 - 38
src/main/resources/mybatis/mapper/maternitymatron/JlServiceUserMapper.xml

@@ -69,37 +69,37 @@
         on jl_store_service.store_id = jl_region.`code` group by service_id) as
         city ON jl_service_user.id = city.service_id
         where 1=1
-        <if test="ids != null">
+        <if test="ids != null and ids != ''">
             and jl_service_user.id not in ( #{ids,jdbcType=INTEGER} )
         </if>
-        <if test="truename != null">
+        <if test="truename != null and truename !=''">
             and jl_service_user.truename like #{truename,jdbcType=VARCHAR}
         </if>
-        <if test="constellation != null">
+        <if test="constellation != null and constellation !=''">
             and constellation = #{constellation,jdbcType=VARCHAR}
         </if>
-        <if test="zodiac != null">
+        <if test="zodiac != null and zodiac !=''">
             and zodiac = #{zodiac,jdbcType=VARCHAR}
         </if>
-        <if test="np != null">
+        <if test="np != null and np !=''">
             and city = #{np,jdbcType=VARCHAR}
         </if>
-        <if test="experience != null">
+        <if test="experience != null and experience !=''">
             and seniority = #{experience,jdbcType=VARCHAR}
         </if>
-        <if test="gender != null">
+        <if test="gender != null and gender !=''">
             and gender = #{gender,jdbcType=VARCHAR}
         </if>
-        <if test="status != null">
+        <if test="status != null and status !=''">
             and status = #{status,jdbcType=VARCHAR}
         </if>
-        <if test="gender != null">
+        <if test="gender != null and gender !=''">
             and gender = #{gender,jdbcType=VARCHAR}
         </if>
-        <if test="babynumber != null">
+        <if test="babynumber != null and babynumber !=''">
             and babynumber = #{babynumber,jdbcType=VARCHAR}
         </if>
-        <if test="cityname != null">
+        <if test="cityname != null and cityname !=''">
             and cityname in #{cityname,jdbcType=VARCHAR}
         </if>
     </select>
@@ -113,28 +113,28 @@
 
     <select id="getquerycount" resultType="java.lang.Integer" parameterType="com.ygj.yuemum.domain.maternitymatron.QueryServiceUser">
         select count(1) from jl_service_user where 2=2
-        <if test="id != null">
+        <if test="id != null and id != ''">
             and jl_service_user.id = #{id,jdbcType=INTEGER}
         </if>
-        <if test="truename != null">
+        <if test="truename != null and truename != ''">
             and jl_service_user.truename like #{truename,jdbcType=VARCHAR}
         </if>
-        <if test="status != null">
+        <if test="status != null and status != ''">
             and status = #{status,jdbcType=VARCHAR}
         </if>
-        <if test="idcard != null">
+        <if test="idcard != null and idcard != ''">
             and idcard = #{idcard,jdbcType=VARCHAR}
         </if>
-        <if test="cityname != null">
+        <if test="cityname != null and cityname != ''">
             and cityname = #{cityname,jdbcType=VARCHAR}
         </if>
-        <if test="np != null">
+        <if test="np != null and np != ''">
             and np = #{np,jdbcType=VARCHAR}
         </if>
-        <if test="experience != null">
+        <if test="experience != null and experience != ''">
             and experience = #{experience,jdbcType=VARCHAR}
         </if>
-        <if test="gender != null">
+        <if test="gender != null and gender != ''">
             and gender = #{gender,jdbcType=VARCHAR}
         </if>
     </select>
@@ -192,28 +192,28 @@
         on jl_store_service.store_id = jl_region.`code` where jl_store_service.service_id = 3 group by service_id) as
         city ON jl_service_user.id = city.service_id
         where 1=1
-        <if test="id != null">
+        <if test="id != null and id != ''">
           and jl_service_user.id = #{ids,jdbcType=INTEGER}
         </if>
-        <if test="truename != null">
+        <if test="truename != null and truename != ''">
             and jl_service_user.truename like #{truename,jdbcType=VARCHAR}
         </if>
-        <if test="status != null">
+        <if test="status != null and status != ''">
             and status = #{status,jdbcType=VARCHAR}
         </if>
-        <if test="idcard != null">
+        <if test="idcard != null and idcard != ''">
             and idcard = #{idcard,jdbcType=VARCHAR}
         </if>
-        <if test="cityname != null">
+        <if test="cityname != null and cityname != ''">
             and cityname = #{cityname,jdbcType=VARCHAR}
         </if>
-        <if test="np != null">
+        <if test="np != null and np != ''">
             and np = #{np,jdbcType=VARCHAR}
         </if>
-        <if test="experience != null">
+        <if test="experience != null and experience != ''">
             and experience = #{experience,jdbcType=VARCHAR}
         </if>
-        <if test="gender != null">
+        <if test="gender != null and gender != ''">
             and gender = #{gender,jdbcType=VARCHAR}
         </if>
         order by id
@@ -238,37 +238,37 @@
         on jl_store_service.store_id = jl_region.`code` group by service_id) as
         city ON jl_service_user.id = city.service_id
         where 1=1
-        <if test="ids != null">
+        <if test="ids != null and ids != ''">
             and jl_service_user.id not in ( #{ids,jdbcType=INTEGER} )
         </if>
-        <if test="truename != null">
+        <if test="truename != null and truename !=''">
             and jl_service_user.truename like #{truename,jdbcType=VARCHAR}
         </if>
-        <if test="constellation != null">
+        <if test="constellation != null and constellation !=''">
             and constellation = #{constellation,jdbcType=VARCHAR}
         </if>
-        <if test="zodiac != null">
+        <if test="zodiac != null and zodiac !=''">
             and zodiac = #{zodiac,jdbcType=VARCHAR}
         </if>
-        <if test="np != null">
+        <if test="np != null and np !=''">
             and city = #{np,jdbcType=VARCHAR}
         </if>
-        <if test="experience != null">
+        <if test="experience != null and experience !=''">
             and seniority = #{experience,jdbcType=VARCHAR}
         </if>
-        <if test="gender != null">
+        <if test="gender != null and gender !=''">
             and gender = #{gender,jdbcType=VARCHAR}
         </if>
-        <if test="status != null">
+        <if test="status != null and status !=''">
             and status = #{status,jdbcType=VARCHAR}
         </if>
-        <if test="gender != null">
+        <if test="gender != null and gender !=''">
             and gender = #{gender,jdbcType=VARCHAR}
         </if>
-        <if test="babynumber != null">
+        <if test="babynumber != null and babynumber !=''">
             and babynumber = #{babynumber,jdbcType=VARCHAR}
         </if>
-        <if test="cityname != null">
+        <if test="cityname != null and cityname !=''">
             and cityname in #{cityname,jdbcType=VARCHAR}
         </if>
         order by  gender desc , babynumber desc , status asc

+ 14 - 0
src/main/resources/static/test.html

@@ -0,0 +1,14 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:th="http://www.thymeleaf.org"
+      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
+      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
+<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
+<head>
+    <meta charset="UTF-8"/>
+    <title>第一个HTML页面</title>
+</head>
+<body>
+<h1>Hello Spring Boot!!!</h1>
+<p th:text="${hello}"></p>
+</body>
+</html>