Shanks 7 년 전
부모
커밋
d41e2e68d8

+ 17 - 3
pom.xml

@@ -31,7 +31,7 @@
 		<dependency>
 			<groupId>org.mybatis.spring.boot</groupId>
 			<artifactId>mybatis-spring-boot-starter</artifactId>
-			<version>1.3.0</version>
+			<version>1.3.1</version>
 		</dependency>
 
 		<dependency>
@@ -51,6 +51,8 @@
 			<artifactId>spring-boot-starter-tomcat</artifactId>
 			<scope>provided</scope>
 		</dependency-->
+
+
 		<dependency>
 			<groupId>com.fasterxml.jackson.core</groupId>
 			<artifactId>jackson-annotations</artifactId>
@@ -72,12 +74,13 @@
 			<artifactId>druid</artifactId>
 			<version>1.1.3</version>
 		</dependency>
-
+		<!--分页-->
 		<dependency>
 			<groupId>com.github.pagehelper</groupId>
 			<artifactId>pagehelper-spring-boot-starter</artifactId>
-			<version>1.1.1</version>
+			<version>1.1.0</version>
 		</dependency>
+
 		<dependency>
 			<groupId>org.apache.httpcomponents</groupId>
 			<artifactId>httpclient</artifactId>
@@ -128,6 +131,17 @@
 			<artifactId>bcprov-jdk15on</artifactId>
 			<version>1.54</version>
 		</dependency>
+		<!--全局配置>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-configuration-processor</artifactId>
+			<optional>true</optional>
+		</dependency-->
+		<!--Spring Security-->
+		<!--dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-security</artifactId>
+		</dependency-->
 	</dependencies>
 
 	<build>

+ 0 - 13
src/main/java/com/ygj/yuemum/ScheduledService.java

@@ -1,13 +0,0 @@
-package com.ygj.yuemum;
-
-import org.springframework.stereotype.Component;
-
-@Component
-public class ScheduledService {
-//    @Autowired
-//    private WeChatInfoService weChatInfoService;
-//    @Scheduled(fixedRate = 5400000)
-//    public void timerCron() {
-//        weChatInfoService.SaveWeChatInfo();
-//    }
-}

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

@@ -8,11 +8,12 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @SpringBootApplication
 @MapperScan("com.ygj.yuemum.dao")
 @EnableScheduling
-public class YueMumApplication {
+public class YueMumApplication  {
 
     public static void main(String[] args) {
         SpringApplication.run(YueMumApplication.class, args);
     }
+
 }
 //public class YueMumApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
 //

+ 138 - 0
src/main/java/com/ygj/yuemum/component/Constant.java

@@ -0,0 +1,138 @@
+package com.ygj.yuemum.component;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 常量
+ * @author pibigstar
+ *
+ */
+@Configuration
+public class Constant {
+    //此数据是读取的配置文件
+    public static String NEWUSER_COUPON;
+    public static String CONSULTTASK_COUPON;
+    public static String DETECTIONTASK_COUPON;
+    public static String RECHARGETASK_COUPON;
+
+    public static String ROOT;
+    public static String RESUMEFILE;
+    public static String HTTPROOT;
+    public static String HTTPHTMLROOT;
+    public static String MODULEPATH;
+    public static String PAYVOUCHER;
+    public static String HTTPPAYVOUCHER;
+
+    public static String APPID;
+    public static String APPSECRET;
+    public static String GRANT_TYPE;
+    public static String JSAPI_TICKET_TYPE;
+    public static String ACCESS_TOKEN_URL;
+    public static String JSAPI_TICKET_URL;
+    public static String JSCODE2SESSION;
+    public static String SENDMESSAGEURL;
+    public static String ORDERTEMPLATEID;
+    public static String BOOKINGTEMPLATEID;
+    public static String MINIAPPID;
+    public static String MINIAPPSECRET;
+
+    //注入
+    @Autowired(required = false)
+    public void getNewUserCoupon(@Value("${coupon.NewUserCoupon}")String NEWUSER_COUPON) {
+        Constant.NEWUSER_COUPON = NEWUSER_COUPON;
+    }
+    @Autowired(required = false)
+    public void getConsultTaskCoupon(@Value("${coupon.ConsultTaskCoupon}")String CONSULTTASK_COUPON) {
+        Constant.CONSULTTASK_COUPON = CONSULTTASK_COUPON;
+    }
+    @Autowired(required = false)
+    public void getDetectionTaskCoupon(@Value("${coupon.DetectionTaskCoupon}")String DETECTIONTASK_COUPON) {
+        Constant.DETECTIONTASK_COUPON = DETECTIONTASK_COUPON;
+    }
+    @Autowired(required = false)
+    public void getRechargeTaskCoupon(@Value("${coupon.NewUserCoupon}")String RECHARGETASK_COUPON) {
+        Constant.RECHARGETASK_COUPON = RECHARGETASK_COUPON;
+    }
+
+    @Autowired(required = false)
+    public void getROOT(@Value("${file.ROOT}")String ROOT) {
+        Constant.ROOT = ROOT;
+    }
+    @Autowired(required = false)
+    public void getResumeFile(@Value("${file.ResumeFile}")String RESUMEFILE) {
+        Constant.RESUMEFILE = RESUMEFILE;
+    }
+    @Autowired(required = false)
+    public void gethttpRoot(@Value("${file.httpRoot}")String HTTPROOT) {
+        Constant.HTTPROOT = HTTPROOT;
+    }
+    @Autowired(required = false)
+    public void gethttphtmlRoot(@Value("${file.httphtmlRoot}")String HTTPHTMLROOT) {
+        Constant.HTTPHTMLROOT = HTTPHTMLROOT;
+    }
+    @Autowired(required = false)
+    public void getmodulePath(@Value("${file.modulePath}")String MODULEPATH) {
+        Constant.MODULEPATH = MODULEPATH;
+    }
+    @Autowired(required = false)
+    public void getPayvoucher(@Value("${file.payvoucher}")String PAYVOUCHER) {
+        Constant.PAYVOUCHER = PAYVOUCHER;
+    }
+    @Autowired(required = false)
+    public void getHttppayvoucher(@Value("${file.httppayvoucher}")String HTTPPAYVOUCHER) {
+        Constant.HTTPPAYVOUCHER = HTTPPAYVOUCHER;
+    }
+
+
+    @Autowired(required = false)
+    public void getAPPID(@Value("${wechat.APPID}")String APPID) {
+        Constant.APPID = APPID;
+    }
+    @Autowired(required = false)
+    public void getAPPSECRET(@Value("${wechat.APPSECRET}")String APPSECRET) {
+        Constant.APPSECRET = APPSECRET;
+    }
+    @Autowired(required = false)
+    public void getGRANT_TYPE(@Value("${wechat.GRANT_TYPE}")String GRANT_TYPE) {
+        Constant.GRANT_TYPE = GRANT_TYPE;
+    }
+    @Autowired(required = false)
+    public void getJSAPI_TICKET_TYPE(@Value("${wechat.JSAPI_TICKET_TYPE}")String JSAPI_TICKET_TYPE) {
+        Constant.JSAPI_TICKET_TYPE = JSAPI_TICKET_TYPE;
+    }
+    @Autowired(required = false)
+    public void getACCESS_TOKEN_URL(@Value("${wechat.ACCESS_TOKEN_URL}")String ACCESS_TOKEN_URL) {
+        Constant.ACCESS_TOKEN_URL = ACCESS_TOKEN_URL;
+    }
+    @Autowired(required = false)
+    public void getJSAPI_TICKET_URL(@Value("${wechat.JSAPI_TICKET_URL}")String JSAPI_TICKET_URL) {
+        Constant.JSAPI_TICKET_URL = JSAPI_TICKET_URL;
+    }
+    @Autowired(required = false)
+    public void getJSCODE2SESSION(@Value("${wechat.JSCODE2SESSION}")String JSCODE2SESSION) {
+        Constant.JSCODE2SESSION = JSCODE2SESSION;
+    }
+    @Autowired(required = false)
+    public void getSENDMESSAGEURL(@Value("${wechat.SENDMESSAGEURL}")String SENDMESSAGEURL) {
+        Constant.SENDMESSAGEURL = SENDMESSAGEURL;
+    }
+    @Autowired(required = false)
+    public void getOrderTemplateid(@Value("${wechat.OrderTemplateid}")String ORDERTEMPLATEID) {
+        Constant.ORDERTEMPLATEID = ORDERTEMPLATEID;
+    }
+    @Autowired(required = false)
+    public void getBookingTemplateid(@Value("${wechat.BookingTemplateid}")String BOOKINGTEMPLATEID) {
+        Constant.BOOKINGTEMPLATEID = BOOKINGTEMPLATEID;
+    }
+    @Autowired(required = false)
+    public void getMINIAPPID(@Value("${wechat.MINIAPPID}")String MINIAPPID) {
+        Constant.MINIAPPID = MINIAPPID;
+    }
+    @Autowired(required = false)
+    public void getMINIAPPSECRET(@Value("${wechat.MINIAPPSECRET}")String MINIAPPSECRET) {
+        Constant.MINIAPPSECRET = MINIAPPSECRET;
+    }
+
+}

+ 1 - 1
src/main/java/com/ygj/yuemum/MyWebAppConfigurer.java

@@ -1,4 +1,4 @@
-package com.ygj.yuemum;
+package com.ygj.yuemum.component;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.config.annotation.CorsRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

+ 16 - 0
src/main/java/com/ygj/yuemum/component/ScheduledService.java

@@ -0,0 +1,16 @@
+package com.ygj.yuemum.component;
+
+import com.ygj.yuemum.service.global.WeChatInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ScheduledService {
+    @Autowired
+    private WeChatInfoService weChatInfoService;
+    @Scheduled(fixedRate = 5400000)
+    public void timerCron() {
+//        weChatInfoService.SaveWeChatInfo();
+    }
+}

+ 2 - 1
src/main/java/com/ygj/yuemum/ServletInitializer.java

@@ -1,5 +1,6 @@
-package com.ygj.yuemum;
+package com.ygj.yuemum.component;
 
+import com.ygj.yuemum.YueMumApplication;
 import org.springframework.boot.builder.SpringApplicationBuilder;
 import org.springframework.boot.web.support.SpringBootServletInitializer;
 

+ 8 - 23
src/main/java/com/ygj/yuemum/controller/admin/ImageUploadController.java

@@ -1,6 +1,7 @@
 package com.ygj.yuemum.controller.admin;
 
 import com.alibaba.fastjson.JSONObject;
+import com.ygj.yuemum.component.Constant;
 import com.ygj.yuemum.domain.admin.Photo;
 import com.ygj.yuemum.domain.admin.Resume;
 import com.ygj.yuemum.domain.maternitymatron.JlServiceUser;
@@ -34,30 +35,14 @@ public class ImageUploadController {
     @Autowired
     private CustomerPayVoucherService customerPayVoucherService;
     private ResourceLoader resourceLoader;
-//    public static final String ROOT = "/usr/local/apache-tomcat-8.5.30/webapps/resume/img/";
-//    public static final String ResumeFile = "/usr/local/apache-tomcat-8.5.30/webapps/resume/";
-//    public static final String httpRoot = "http://192.168.1.24/resume/img/";
-//    public static final String httphtmlRoot = "http://192.168.1.24/resume/";
-//    public static final String modulePath = "/usr/local/apache-tomcat-8.5.30/webapps/resume/resume.html";
-//    public static final String payvoucher = "/usr/local/apache-tomcat-8.5.30/webapps/payvoucher";
-//    public static final String httppayvoucher = "http://192.168.1.24/payvoucher";
 
-//
-//    public static final String ROOT = "/usr/local/tomcat/tomcat7/webapps/resume/img/";
-//    public static final String ResumeFile = "/usr/local/tomcat/tomcat7/webapps/resume/";
-//    public static final String httpRoot = "http://yuesuo.yueguanjia.com/resume/img/";
-//    public static final String httphtmlRoot = "http://yuesuo.yueguanjia.com/resume/";
-//    public static final String modulePath = "/usr/local/tomcat/tomcat7/webapps/resume/resume.html";
-//    public static final String payvoucher = "/usr/local/tomcat/tomcat7/webapps/payvoucher";
-//    public static final String httppayvoucher = "http://yuesuo.yueguanjia.com/payvoucher";
-
-    public static final String ROOT = "D:/apache-tomcat-9.0.6/webapps/resume/img/";
-    public static final String ResumeFile = "D:/apache-tomcat-9.0.6/webapps/resume/";
-    public static final String httpRoot = "http://localhost:8080/resume/img/";
-    public static final String httphtmlRoot = "http://localhost:8080/resume/";
-    public static final String modulePath = "D:/apache-tomcat-9.0.6/webapps/resume/resume.html";
-    public static final String payvoucher = "D:/apache-tomcat-9.0.6/webapps/payvoucher";
-    public static final String httppayvoucher = "http://localhost:8080/payvoucher";
+    public static final String ROOT = Constant.ROOT;
+    public static final String ResumeFile = Constant.RESUMEFILE;
+    public static final String httpRoot = Constant.HTTPROOT;
+    public static final String httphtmlRoot = Constant.HTTPHTMLROOT;
+    public static final String modulePath = Constant.MODULEPATH;
+    public static final String payvoucher = Constant.PAYVOUCHER;
+    public static final String httppayvoucher = Constant.HTTPPAYVOUCHER;
 
     @RequestMapping(value = "/upload", method = RequestMethod.GET)
     public String upload() {

+ 6 - 8
src/main/java/com/ygj/yuemum/service/coupon/CouponService.java

@@ -2,6 +2,7 @@ package com.ygj.yuemum.service.coupon;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.ygj.yuemum.component.Constant;
 import com.ygj.yuemum.dao.coupon.CouponDao;
 import com.ygj.yuemum.domain.coupon.Coupon;
 import com.ygj.yuemum.domain.coupon.CouponLog;
@@ -29,15 +30,11 @@ public class CouponService {
     @Autowired
     private CouponLogService couponLogService;
       //test
-    String couponNewUserCoupon = "PVP2018051297451";
-    String couponConsultTaskCoupon = "PVP2018051273883";
-    String couponDetectionTaskCoupon = "PVP2018051211608";
-    String couponRechargeTaskCoupon = "PVP2018051263016";
+    String couponNewUserCoupon = Constant.NEWUSER_COUPON;
+    String couponConsultTaskCoupon = Constant.CONSULTTASK_COUPON;
+    String couponDetectionTaskCoupon = Constant.DETECTIONTASK_COUPON;
+    String couponRechargeTaskCoupon = Constant.RECHARGETASK_COUPON;
 
-//    String couponNewUserCoupon = "PVP2018051717019";
-//    String couponConsultTaskCoupon = "PVP2018051739929";
-//    String couponDetectionTaskCoupon = "PVP2018051713733";
-//    String couponRechargeTaskCoupon = "PVP2018051714111";
     //分页
     public Map<String, Object> getCoupons(int page, int limit) {
         PageHelper.startPage(page, limit);
@@ -106,6 +103,7 @@ public class CouponService {
             CustomerCoupon checkCustomer = new CustomerCoupon();
             checkCustomer.setCm_phone(phone);
             checkCustomer.setCb_code(couponNewUserCoupon);
+     
             if (customerCouponService.checkCustomerCoupon(checkCustomer) > 0) {
                 return 62;
             }

+ 13 - 18
src/main/java/com/ygj/yuemum/service/global/WeChatInfoService.java

@@ -2,6 +2,7 @@ package com.ygj.yuemum.service.global;
 
 import com.alibaba.fastjson.JSON;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.ygj.yuemum.component.Constant;
 import com.ygj.yuemum.dao.global.WeChatInfoDao;
 import com.ygj.yuemum.domain.customer.CustomerBooking;
 import com.ygj.yuemum.domain.global.TemplateData;
@@ -44,24 +45,18 @@ public class WeChatInfoService {
     private WeChatInfoDao weChatInfoDao;
     @Autowired
     private WXUserService wxUserService;
-    public static String APPID = "wx52852a3c47540fad";
-    public static String APPSECRET = "31e4eef58038830327eb88661e3a681f";
-    //生产
-//    public static String MINIAPPID = "wx20a080f3bf83ba47";
-//    public static String MINIAPPSECRET = "61021776790449943ba5f40288efa0d6";
-    //测试
-    public static String MINIAPPID = "wx1c3ef3300b74ed86";
-    public static String MINIAPPSECRET = "ba5624bc087921d5a5832da9193e40f1";
-
-    public static String GRANT_TYPE = "client_credential";
-    public static String JSAPI_TICKET_TYPE = "jsapi";
-    public static String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token";
-    public static String JSAPI_TICKET_URL = "https://api.weixin.qq.com/cgi-bin/ticket/getticket";
-    public static String JSCODE2SESSION = "https://api.weixin.qq.com/sns/jscode2session";
-
-    public static String SENDMESSAGEURL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";
-    public static String OrderTemplateid = "VyMPKDDGOy85wDIJuXR7sBuiIBEg0OPaCg6C_Dt_D0g";
-    public static String BookingTemplateid = "Wvysqh3Ec9lXpf5tytq0T2zzs662uowNLFCPiAPBFkA";
+    public String APPID = Constant.APPID;
+    public String APPSECRET = Constant.APPSECRET;
+    public String MINIAPPID = Constant.MINIAPPID;
+    public String MINIAPPSECRET = Constant.MINIAPPSECRET;
+    public String GRANT_TYPE = Constant.GRANT_TYPE;
+    public String JSAPI_TICKET_TYPE = Constant.JSAPI_TICKET_TYPE;
+    public String ACCESS_TOKEN_URL = Constant.ACCESS_TOKEN_URL;
+    public String JSAPI_TICKET_URL = Constant.JSAPI_TICKET_URL;
+    public String JSCODE2SESSION = Constant.JSCODE2SESSION;
+    public String SENDMESSAGEURL = Constant.SENDMESSAGEURL;
+    public String OrderTemplateid = Constant.ORDERTEMPLATEID;
+    public String BookingTemplateid = Constant.BOOKINGTEMPLATEID;
 
     private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
     String access_Token;

+ 60 - 3
src/main/resources/application.yml

@@ -14,8 +14,6 @@ spring:
   thymeleaf:
     mode: LEGACYHTML5
     prefix: classpath:/templates
-
-# 分页配置
 pagehelper:
   helper-dialect: mysql
   reasonable: true
@@ -23,4 +21,63 @@ pagehelper:
   params: count=countSql
 logging:
   level:
-     com.ygj.yuemum.dao : debug
+     com.ygj.yuemum.dao : debug
+#优惠券批次号信息--------------------
+#测试
+coupon:
+  NewUserCoupon : "PVP2018051297451"
+  ConsultTaskCoupon : "PVP2018051273883"
+  DetectionTaskCoupon : "PVP2018051211608"
+  RechargeTaskCoupon : "PVP2018051263016"
+#生产
+#coupon:
+#  NewUserCoupon : "PVP2018051717019"
+#  ConsultTaskCoupon : "PVP2018051739929"
+#  DetectionTaskCoupon : "PVP2018051713733"
+#  RechargeTaskCoupon : "PVP2018051714111"
+#图片上传路径--------------------------
+#本地
+file:
+  ROOT : "D:/apache-tomcat-9.0.6/webapps/resume/img/"
+  ResumeFile : "D:/apache-tomcat-9.0.6/webapps/resume/"
+  httpRoot : "http://localhost:8080/resume/img/"
+  httphtmlRoot : "http://localhost:8080/resume/"
+  modulePath : "D:/apache-tomcat-9.0.6/webapps/resume/resume.html"
+  payvoucher : "D:/apache-tomcat-9.0.6/webapps/payvoucher"
+  httppayvoucher : "http://localhost:8080/payvoucher"
+#测试
+#file:
+#  ROOT : "/usr/local/apache-tomcat-8.5.30/webapps/resume/img/"
+#  ResumeFile : "/usr/local/apache-tomcat-8.5.30/webapps/resume/"
+#  httpRoot : "http://192.168.1.24/resume/img/"
+#  httphtmlRoot : "http://192.168.1.24/resume/"
+#  modulePath : "/usr/local/apache-tomcat-8.5.30/webapps/resume/resume.html"
+#  payvoucher : "/usr/local/apache-tomcat-8.5.30/webapps/payvoucher"
+#  httppayvoucher : "http://192.168.1.24/payvoucher"
+#生产
+#file:
+#  ROOT : "/usr/local/tomcat/tomcat7/webapps/resume/img/"
+#  ResumeFile : "/usr/local/tomcat/tomcat7/webapps/resume/"
+#  httpRoot : "http://yuesuo.yueguanjia.com/resume/img/"
+#  httphtmlRoot : "http://yuesuo.yueguanjia.com/resume/"
+#  modulePath : "/usr/local/tomcat/tomcat7/webapps/resume/resume.html"
+#  payvoucher : "/usr/local/tomcat/tomcat7/webapps/payvoucher"
+#  httppayvoucher : "http://yuesuo.yueguanjia.com/payvoucher"
+#微信公众号---------------------------------------------------
+wechat:
+  APPID : "wx52852a3c47540fad"
+  APPSECRET : "31e4eef58038830327eb88661e3a681f" #获取access_token
+  GRANT_TYPE : "client_credential"
+  JSAPI_TICKET_TYPE : "jsapi"
+  ACCESS_TOKEN_URL : "https://api.weixin.qq.com/cgi-bin/token"
+  JSAPI_TICKET_URL : "https://api.weixin.qq.com/cgi-bin/ticket/getticket"
+  JSCODE2SESSION : "https://api.weixin.qq.com/sns/jscode2session"
+  SENDMESSAGEURL : "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" #公众号消息发送地址
+  OrderTemplateid : "VyMPKDDGOy85wDIJuXR7sBuiIBEg0OPaCg6C_Dt_D0g"  #公众号消息模版
+  BookingTemplateid : "Wvysqh3Ec9lXpf5tytq0T2zzs662uowNLFCPiAPBFkA" #公众号消息模版
+  #测试小程序
+  #MINIAPPID : "wx1c3ef3300b74ed86"
+  #MINIAPPSECRET : "ba5624bc087921d5a5832da9193e40f1"
+  #生产小程序
+  MINIAPPID : "wx20a080f3bf83ba47"
+  MINIAPPSECRET : "61021776790449943ba5f40288efa0d6"

+ 1 - 0
src/main/resources/mybatis/mapper/customer/CustomerCouponMapper.xml

@@ -133,6 +133,7 @@
         left JOIN coupon tc on ta.cc_code = tc.cp_code
         where
         ta.cm_phone = #{cm_phone,jdbcType=VARCHAR}
+        and ta.cp_status = 2
         order by ta.cb_code ,tc.cp_amount desc
     </select>
 

+ 6 - 2
src/main/resources/mybatis/mapper/global/PackageItemMapper.xml

@@ -20,12 +20,16 @@
     </select>
 
     <select id="getPIGroups" resultType="com.ygj.yuemum.domain.global.PackageItem" >
-        select pi_groupid,pi_groupname from package_item group by pi_groupid
+        select pi_groupid,pi_groupname
+        from package_item
+        group by pi_groupid,pi_groupname
         order by 1 asc
     </select>
 
     <select id="getPIClasses" resultType="com.ygj.yuemum.domain.global.PackageItem" >
-        select pi_groupid,pi_classid,pi_classname from package_item group by pi_groupid,pi_classid
+        select pi_groupid,pi_classid,pi_classname
+        from package_item
+        group by pi_groupid,pi_classid,pi_classname
         order by pi_groupid asc,pi_classid asc
     </select>