Shanks 6 年之前
父节点
当前提交
99b9683799

+ 10 - 10
pom.xml

@@ -6,7 +6,7 @@
 	<groupId>com.ygj</groupId>
 	<artifactId>yuemum</artifactId>
 	<version>1</version>
-	<packaging>jar</packaging>
+	<packaging>war</packaging>
 	<name>yuemum</name>
 	<description>Demo project for Spring Boot</description>
 
@@ -31,7 +31,7 @@
 		<dependency>
 			<groupId>org.mybatis.spring.boot</groupId>
 			<artifactId>mybatis-spring-boot-starter</artifactId>
-			<version>1.3.1</version>
+			<version>1.2.0</version>
 		</dependency>
 
 		<dependency>
@@ -45,12 +45,12 @@
 			<artifactId>fastjson</artifactId>
 			<version>1.2.31</version>
 		</dependency>
-
-		<!--dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-tomcat</artifactId>
-			<scope>provided</scope>
-		</dependency-->
+		<!--启动-->
+		<!--<dependency>-->
+			<!--<groupId>org.springframework.boot</groupId>-->
+			<!--<artifactId>spring-boot-starter-tomcat</artifactId>-->
+			<!--<scope>provided</scope>-->
+		<!--</dependency>-->
 
 
 		<dependency>
@@ -77,8 +77,8 @@
 		<!--分页-->
 		<dependency>
 			<groupId>com.github.pagehelper</groupId>
-			<artifactId>pagehelper-spring-boot-starter</artifactId>
-			<version>1.1.0</version>
+			<artifactId>pagehelper</artifactId>
+			<version>4.1.6</version>
 		</dependency>
 
 		<dependency>

+ 28 - 1
src/main/java/com/ygj/yuemum/YueMumApplication.java

@@ -1,19 +1,35 @@
 package com.ygj.yuemum;
 
+import com.github.pagehelper.PageHelper;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
+import java.util.Properties;
+
 @SpringBootApplication
 @MapperScan("com.ygj.yuemum.dao")
 @EnableScheduling
-public class YueMumApplication  {
+public class YueMumApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(YueMumApplication.class, args);
     }
 
+    @Bean
+    public PageHelper pageHelper() {
+        PageHelper pageHelper = new PageHelper();
+        Properties properties = new Properties();
+        properties.setProperty("offsetAsPageNum", "true");
+        properties.setProperty("rowBoundsWithCount", "true");
+        properties.setProperty("reasonable", "true");
+        properties.setProperty("dialect", "mysql");    //配置mysql数据库的方言
+        pageHelper.setProperties(properties);
+        return pageHelper;
+    }
+
 }
 //public class YueMumApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
 //
@@ -26,4 +42,15 @@ public class YueMumApplication  {
 //    public static void main(String[] args) {
 //        SpringApplication.run(YueMumApplication.class, args);
 //    }
+//    @Bean
+//    public PageHelper pageHelper() {
+//        PageHelper pageHelper = new PageHelper();
+//        Properties properties = new Properties();
+//        properties.setProperty("offsetAsPageNum", "true");
+//        properties.setProperty("rowBoundsWithCount", "true");
+//        properties.setProperty("reasonable", "true");
+//        properties.setProperty("dialect", "mysql");    //配置mysql数据库的方言
+//        pageHelper.setProperties(properties);
+//        return pageHelper;
+//    }
 //}

+ 9 - 0
src/main/java/com/ygj/yuemum/domain/customer/CustomerBooking.java

@@ -11,6 +11,15 @@ public class CustomerBooking {
     private String eh_code;
     private Integer limit;
     private Integer page;
+    private String bk_typedesc;
+
+    public String getBk_typedesc() {
+        return bk_typedesc;
+    }
+
+    public void setBk_typedesc(String bk_typedesc) {
+        this.bk_typedesc = bk_typedesc;
+    }
 
     public Integer getLimit() {
         return limit;

+ 1 - 1
src/main/resources/application.yml

@@ -67,7 +67,7 @@ file:
 #  modulePath : "/usr/local/tomcat/tomcat7/webapps/resume/resume.html"
 #  payvoucher : "/usr/local/tomcat/tomcat7/webapps/payvoucher"
 #  httppayvoucher : "http://yuesuo.yueguanjia.com/payvoucher"
-#  promotionvoucher : "/usr/local/tomcat/tomcat7/webapps/promotion/offline"
+#  promotionvoucher : "/usr/local/tomcat/tomcat7/webapps/MiniProgram/promotion/offline"
 #  httppromotionvoucher : "http://yuesuo.yueguanjia.com/MiniProgram/promotion/offline"
 #微信公众号---------------------------------------------------
 wechat:

+ 3 - 1
src/main/resources/mybatis/mapper/customer/CustomerBookingMapper.xml

@@ -9,6 +9,7 @@
         <result column="bk_date" property="bk_date" jdbcType="DATE" />
         <result column="bk_type" property="bk_type" jdbcType="INTEGER" />
         <result column="bk_desc" property="bk_desc" jdbcType="VARCHAR" />
+        <result column="bk_typedesc" property="bk_typedesc" jdbcType="VARCHAR" />
     </resultMap>
 
     <sql id="Base_Column_List" >
@@ -25,7 +26,8 @@
 
     <select id="selectAll" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.customer.CustomerBooking">
         select
-        id, bk_phone,bk_duedate,bk_date,bk_type,bk_desc
+        id, bk_phone,bk_duedate,bk_date,bk_type,bk_desc,
+        case bk_type when 1 then '套餐预约' WHEN 2 then '月嫂预约' WHEN 3 then '设备租赁' WHEN 4 then '顾问预约' WHEN 5 then '设备归还' End as bk_typedesc
         from customer_booking
         where 1=1
         <if test="bk_phone != null and bk_phone != ''">