Shanks 7 lat temu
rodzic
commit
1061c4a2fe
28 zmienionych plików z 1857 dodań i 7 usunięć
  1. 8 5
      src/main/java/com/ygj/yuemum/controller/admin/ImageUploadController.java
  2. 69 0
      src/main/java/com/ygj/yuemum/controller/coupon/CouponBatchController.java
  3. 50 0
      src/main/java/com/ygj/yuemum/controller/coupon/CouponController.java
  4. 71 0
      src/main/java/com/ygj/yuemum/controller/coupon/CouponCreateController.java
  5. 50 0
      src/main/java/com/ygj/yuemum/controller/coupon/CouponLogController.java
  6. 29 0
      src/main/java/com/ygj/yuemum/controller/global/PackagesController.java
  7. 1 0
      src/main/java/com/ygj/yuemum/controller/maternitymatron/JlServiceUserController.java
  8. 26 0
      src/main/java/com/ygj/yuemum/dao/coupon/CouponBatchDao.java
  9. 37 0
      src/main/java/com/ygj/yuemum/dao/coupon/CouponCreateDao.java
  10. 29 0
      src/main/java/com/ygj/yuemum/dao/coupon/CouponDao.java
  11. 25 0
      src/main/java/com/ygj/yuemum/dao/coupon/CouponLogDao.java
  12. 13 0
      src/main/java/com/ygj/yuemum/dao/global/PackagesDao.java
  13. 77 0
      src/main/java/com/ygj/yuemum/domain/coupon/Coupon.java
  14. 77 0
      src/main/java/com/ygj/yuemum/domain/coupon/CouponBatch.java
  15. 148 0
      src/main/java/com/ygj/yuemum/domain/coupon/CouponCreate.java
  16. 77 0
      src/main/java/com/ygj/yuemum/domain/coupon/CouponLog.java
  17. 58 0
      src/main/java/com/ygj/yuemum/domain/global/Packages.java
  18. 69 0
      src/main/java/com/ygj/yuemum/service/coupon/CouponBatchService.java
  19. 118 0
      src/main/java/com/ygj/yuemum/service/coupon/CouponCreateService.java
  20. 49 0
      src/main/java/com/ygj/yuemum/service/coupon/CouponLogService.java
  21. 57 0
      src/main/java/com/ygj/yuemum/service/coupon/CouponService.java
  22. 24 0
      src/main/java/com/ygj/yuemum/service/global/PackagesService.java
  23. 2 2
      src/main/resources/application.yml
  24. 167 0
      src/main/resources/mybatis/mapper/coupon/CouponBatchMapper.xml
  25. 263 0
      src/main/resources/mybatis/mapper/coupon/CouponCreateMapper.xml
  26. 127 0
      src/main/resources/mybatis/mapper/coupon/CouponLogMapper.xml
  27. 109 0
      src/main/resources/mybatis/mapper/coupon/CouponMapper.xml
  28. 27 0
      src/main/resources/mybatis/mapper/global/packagesMapper.xml

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

@@ -30,11 +30,11 @@ public class ImageUploadController {
     @Autowired
     private ResumeService resumeService;
     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 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 ROOT = "D:/apache-tomcat-9.0.6/webapps/resume/img/";
 //    public static final String ResumeFile = "D:/apache-tomcat-9.0.6/webapps/resume/";
@@ -120,6 +120,7 @@ public class ImageUploadController {
             String service ="";
             String servicehref ="";
             String comment ="";
+            String littcomm = "";
             if(photo.getComment() == null){
                 photo.setComment(" ");
             }
@@ -161,6 +162,7 @@ public class ImageUploadController {
                     }
                     if(onePhoto.getPhoto_type() == 3){
                         comment = comment +"<a href=\"\"><img src='"+onePhoto.getPhoto_path()+"'/></a>"+"\r\n";
+                        littcomm = littcomm + "<image class=\"resume-comments-list\" src=\"" +onePhoto.getPhoto_path() + "\"/>";
                     }
                 }
             }
@@ -223,6 +225,7 @@ public class ImageUploadController {
                 str = str.replace("$service",service);
                 str = str.replace("$scstyle",servicehref);
                 str = str.replace("$comment",comment);
+                str = str.replace("$littcomm",littcomm);
                 str = str.replace("$yuesaohref",httphtmlRoot+photo.getServant_code() + ".html");
                 stringHtml.append(str+"\r\n");
             }

+ 69 - 0
src/main/java/com/ygj/yuemum/controller/coupon/CouponBatchController.java

@@ -0,0 +1,69 @@
+package com.ygj.yuemum.controller.coupon;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ygj.yuemum.domain.coupon.CouponBatch;
+import com.ygj.yuemum.service.coupon.CouponBatchService;
+import com.ygj.yuemum.service.coupon.CouponCreateService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+public class CouponBatchController {
+
+    @Autowired
+    private CouponBatchService couponBatchService;
+    @Autowired
+    private CouponCreateService couponCreateService;
+
+    @GetMapping("/getCouponbatchs")
+    public String getCouponbatchs(@RequestParam("page") Integer page,@RequestParam("limit") Integer limit) {
+        Map<String, Object> couponBatchs= couponBatchService.getCouponBatchs(page,limit);
+        String jso = JSONObject.toJSONString(couponBatchs);
+        return jso;
+    }
+
+    @GetMapping("/getAllCouponBatchs")
+    public List<CouponBatch> getAllCouponBatchs() {
+            return couponBatchService.getAll();
+    }
+
+    @GetMapping("/selectCouponBatch")
+    public List<CouponBatch> selectCouponBatch() {
+        return couponBatchService.selectCouponBatch();
+    }
+
+    @PostMapping("/addCouponBatch")
+    public int add(@ModelAttribute CouponBatch couponbatch) {
+        return couponBatchService.addCouponBatch(couponbatch);
+    }
+
+    @GetMapping("/deleteCouponBatch")
+    public int delete(@RequestParam("cb_code") String cb_code) {
+        if(couponCreateService.checkCouponBatch(cb_code) > 0){
+            return 9;
+        } else {
+            return couponBatchService.deleteCouponBatch(cb_code);
+        }
+    }
+
+    @PostMapping("/updateCouponBatch")
+    public int update(@ModelAttribute CouponBatch couponbatch) {
+        return couponBatchService.updateCouponBatch(couponbatch);
+    }
+
+    @PostMapping("/getQCouponBatch")
+    public String getQCouponBatch(@ModelAttribute CouponBatch couponbatch) {
+        Map<String, Object> couponBatchs= couponBatchService.getQCouponBatch(couponbatch);
+        String jso = JSONObject.toJSONString(couponBatchs);
+        return jso;
+    }
+
+    @GetMapping("/getCouponBatch")
+    public CouponBatch getOne(@RequestParam("id") Integer id) {
+        return couponBatchService.getCouponBatch(id);
+    }
+}

+ 50 - 0
src/main/java/com/ygj/yuemum/controller/coupon/CouponController.java

@@ -0,0 +1,50 @@
+package com.ygj.yuemum.controller.coupon;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ygj.yuemum.domain.coupon.Coupon;
+import com.ygj.yuemum.service.coupon.CouponService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+public class CouponController {
+
+    @Autowired
+    private CouponService couponService;
+
+    @GetMapping("/getCoupons")
+    public String getCoupons(@RequestParam("page") Integer page,@RequestParam("limit") Integer limit) {
+        Map<String, Object> coupons= couponService.getCoupons(page,limit);
+        String jso = JSONObject.toJSONString(coupons);
+        return jso;
+    }
+
+    @GetMapping("/getAllCoupons")
+    public List<Coupon> getAllCoupons() {
+            return couponService.getAll();
+    }
+
+    @PostMapping("/addCoupon")
+    public int add(@ModelAttribute Coupon coupon) {
+        return couponService.addCoupon(coupon);
+    }
+
+    @GetMapping("/deleteCoupon/{id}")
+    public int delete(@PathVariable("id") Integer id) {
+        return couponService.deleteCoupon(id);
+    }
+
+    @PostMapping("/updateCoupon")
+    public int update(@ModelAttribute Coupon coupon) {
+        return couponService.updateCoupon(coupon);
+    }
+
+    @GetMapping("/getCoupon/{id}")
+    public Coupon getOne(@PathVariable("id") Integer id) {
+        return couponService.getCoupon(id);
+    }
+}

+ 71 - 0
src/main/java/com/ygj/yuemum/controller/coupon/CouponCreateController.java

@@ -0,0 +1,71 @@
+package com.ygj.yuemum.controller.coupon;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ygj.yuemum.domain.coupon.CouponCreate;
+import com.ygj.yuemum.service.coupon.CouponCreateService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+public class CouponCreateController {
+
+    @Autowired
+    private CouponCreateService couponCreateService;
+
+    @GetMapping("/getCouponCreates")
+    public String getCouponCreates(@RequestParam("page") Integer page,@RequestParam("limit") Integer limit) {
+        Map<String, Object> couponCreates= couponCreateService.getCouponCreates(page,limit);
+        String jso = JSONObject.toJSONString(couponCreates);
+        return jso;
+    }
+
+    @GetMapping("/getAllCouponCreates")
+    public List<CouponCreate> getAllCouponCreates() {
+            return couponCreateService.getAll();
+    }
+
+    @PostMapping("/addCouponCreate")
+    public int add(@ModelAttribute CouponCreate couponCreate) {
+        return couponCreateService.addCouponCreate(couponCreate);
+    }
+
+    @GetMapping("/deleteCouponCreate/{id}")
+    public int delete(@PathVariable("id") Integer id) {
+        return couponCreateService.deleteCouponCreate(id);
+    }
+
+    @PostMapping("/updateCouponCreate")
+    public int update(@ModelAttribute CouponCreate couponCreate) {
+        return couponCreateService.updateCouponCreate(couponCreate);
+    }
+
+    @GetMapping("/getCouponCreate/{id}")
+    public CouponCreate getOne(@PathVariable("id") Integer id) {
+        return couponCreateService.getCouponCreate(id);
+    }
+
+    @PostMapping("/getQCouponCreate")
+    public String getQCouponCreate(@ModelAttribute CouponCreate couponCreate) {
+        Map<String, Object> couponCreates= couponCreateService.getQCouponCreate(couponCreate);
+        String jso = JSONObject.toJSONString(couponCreates);
+        return jso;
+    }
+    @GetMapping("/disableCouponCreate")
+    public int disableCouponCreate(@RequestParam("id") Integer id) {
+        return couponCreateService.disableCouponCreate(id);
+    }
+    @GetMapping("/enableCouponCreate")
+    public int enableCouponCreate(@RequestParam("id") Integer id) {
+        return couponCreateService.enableCouponCreate(id);
+    }
+
+    @GetMapping("/checkCouponBatchid")
+    public int checkCouponBatchid(@RequestParam("id") Integer id) {
+        return couponCreateService.checkCouponBatchid(id);
+    }
+
+}

+ 50 - 0
src/main/java/com/ygj/yuemum/controller/coupon/CouponLogController.java

@@ -0,0 +1,50 @@
+package com.ygj.yuemum.controller.coupon;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ygj.yuemum.domain.coupon.CouponLog;
+import com.ygj.yuemum.service.coupon.CouponLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+public class CouponLogController {
+
+    @Autowired
+    private CouponLogService couponLogService;
+
+    @GetMapping("/getCouponLogs")
+    public String getCouponLogs(@RequestParam("page") Integer page,@RequestParam("limit") Integer limit) {
+        Map<String, Object> couponLogs= couponLogService.getCouponLogs(page,limit);
+        String jso = JSONObject.toJSONString(couponLogs);
+        return jso;
+    }
+
+    @GetMapping("/getAllCouponLogs")
+    public List<CouponLog> getAllCouponLogs() {
+            return couponLogService.getAll();
+    }
+
+    @PostMapping("/addCouponLogs")
+    public int add(@ModelAttribute CouponLog couponLog) {
+        return couponLogService.addCouponLog(couponLog);
+    }
+
+    @GetMapping("/deleteCouponLogs/{id}")
+    public int delete(@PathVariable("id") Integer id) {
+        return couponLogService.deleteCouponLog(id);
+    }
+
+    @PostMapping("/updateCouponLogs")
+    public int update(@ModelAttribute CouponLog couponLog) {
+        return couponLogService.updateCouponLog(couponLog);
+    }
+
+    @GetMapping("/getCouponLogs/{id}")
+    public CouponLog getOne(@PathVariable("id") Integer id) {
+        return couponLogService.getCouponLog(id);
+    }
+}

+ 29 - 0
src/main/java/com/ygj/yuemum/controller/global/PackagesController.java

@@ -0,0 +1,29 @@
+package com.ygj.yuemum.controller.global;
+
+
+import com.ygj.yuemum.domain.global.Packages;
+import com.ygj.yuemum.service.global.PackagesService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+public class PackagesController {
+
+    @Autowired
+    private PackagesService packagesService;
+    @GetMapping("/getPackageSelect")
+    public List<Packages> getPackageSelect() {
+        List<Packages> packages = packagesService.getPackageSelect();
+        return packages;
+    }
+
+    @GetMapping("/getPackageAll")
+    public List<Packages> getPackageAll() {
+        List<Packages> packages = packagesService.getPackageAll();
+        return packages;
+    }
+
+}

+ 1 - 0
src/main/java/com/ygj/yuemum/controller/maternitymatron/JlServiceUserController.java

@@ -75,6 +75,7 @@ public class JlServiceUserController {
         jlServiceUser.setStatus("1");
         jlServiceUser.setTruename(addMMInfo.getTruename());
         jlServiceUser.setSalt(addMMInfo.getSalt());
+//        jlServiceUser.setMobile_phone(addMMInfo.getMobile_phone());
         //jlServiceUserInfo
         jlServiceUserInfo.setId(id);
         jlServiceUserInfo.setIdcard(addMMInfo.getIdcard());

+ 26 - 0
src/main/java/com/ygj/yuemum/dao/coupon/CouponBatchDao.java

@@ -0,0 +1,26 @@
+package com.ygj.yuemum.dao.coupon;
+
+import com.ygj.yuemum.domain.coupon.CouponBatch;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface CouponBatchDao {
+
+    List<CouponBatch> getAll();
+    List<CouponBatch> selectCouponBatch();
+
+    int deleteByPrimaryKey(String id);
+
+    int insertSelective(CouponBatch record);
+
+    CouponBatch selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(CouponBatch record);
+
+    int getCount();
+    int getQCouponBatchconut(CouponBatch couponBatch);
+    List<CouponBatch> getQCouponBatch(CouponBatch couponBatch);
+
+}

+ 37 - 0
src/main/java/com/ygj/yuemum/dao/coupon/CouponCreateDao.java

@@ -0,0 +1,37 @@
+package com.ygj.yuemum.dao.coupon;
+
+import com.ygj.yuemum.domain.coupon.CouponCreate;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface CouponCreateDao {
+
+    List<CouponCreate> getAll();
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(CouponCreate record);
+
+    CouponCreate selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(CouponCreate record);
+
+    int getCount();
+    int checkCouponBatch(String id);
+
+    int checkCouponBatchid(Integer id);
+
+    int getccpmid();
+
+    int disableCouponCreate(Integer id);
+
+    int enableCouponCreate(Integer id);
+
+    int getQCouponCreateCount(CouponCreate record);
+    List<CouponCreate> getQCouponCreate(CouponCreate record);
+
+
+
+}

+ 29 - 0
src/main/java/com/ygj/yuemum/dao/coupon/CouponDao.java

@@ -0,0 +1,29 @@
+package com.ygj.yuemum.dao.coupon;
+
+import com.ygj.yuemum.domain.coupon.Coupon;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface CouponDao {
+
+    List<Coupon> getAll();
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(Coupon record);
+
+    Coupon selectByPrimaryKey(Integer id);
+
+    int disableCoupon(Integer id);
+
+    int enableCoupon(Integer id);
+
+    int updateByPrimaryKeySelective(Coupon record);
+
+    int getCount();
+
+
+
+}

+ 25 - 0
src/main/java/com/ygj/yuemum/dao/coupon/CouponLogDao.java

@@ -0,0 +1,25 @@
+package com.ygj.yuemum.dao.coupon;
+
+import com.ygj.yuemum.domain.coupon.CouponLog;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface CouponLogDao {
+
+    List<CouponLog> getAll();
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(CouponLog record);
+
+    CouponLog selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(CouponLog record);
+
+    int getCount();
+
+
+
+}

+ 13 - 0
src/main/java/com/ygj/yuemum/dao/global/PackagesDao.java

@@ -0,0 +1,13 @@
+package com.ygj.yuemum.dao.global;
+
+import com.ygj.yuemum.domain.global.Packages;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface PackagesDao {
+
+    List<Packages> getPackageSelect();
+    List<Packages> getPackageAll();
+}

+ 77 - 0
src/main/java/com/ygj/yuemum/domain/coupon/Coupon.java

@@ -0,0 +1,77 @@
+package com.ygj.yuemum.domain.coupon;
+
+public class Coupon {
+
+    private Integer id;
+    private String cp_code;
+    private String cb_code;
+    private Integer cc_code;
+    private String cp_startdate;
+    private String cp_enddate;
+    private Integer cp_amount;
+    private Integer cp_status;
+
+    public Integer getCc_code() {
+        return cc_code;
+    }
+
+    public void setCc_code(Integer cc_code) {
+        this.cc_code = cc_code;
+    }
+
+    public String getCb_code() {
+        return cb_code;
+    }
+
+    public void setCb_code(String cb_code) {
+        this.cb_code = cb_code;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getCp_code() {
+        return cp_code;
+    }
+
+    public void setCp_code(String cp_code) {
+        this.cp_code = cp_code;
+    }
+
+    public String getCp_startdate() {
+        return cp_startdate;
+    }
+
+    public void setCp_startdate(String cp_startdate) {
+        this.cp_startdate = cp_startdate;
+    }
+
+    public String getCp_enddate() {
+        return cp_enddate;
+    }
+
+    public void setCp_enddate(String cp_enddate) {
+        this.cp_enddate = cp_enddate;
+    }
+
+    public Integer getCp_amount() {
+        return cp_amount;
+    }
+
+    public void setCp_amount(Integer cp_amount) {
+        this.cp_amount = cp_amount;
+    }
+
+    public Integer getCp_status() {
+        return cp_status;
+    }
+
+    public void setCp_status(Integer cp_status) {
+        this.cp_status = cp_status;
+    }
+}

+ 77 - 0
src/main/java/com/ygj/yuemum/domain/coupon/CouponBatch.java

@@ -0,0 +1,77 @@
+package com.ygj.yuemum.domain.coupon;
+
+public class CouponBatch {
+
+    private Integer id;
+    private String cb_code;
+    private String cb_name;
+    private String cb_rule;
+    private String cb_packages;
+    private String cb_citys;
+    private Integer page;
+    private Integer limit;
+
+    public Integer getPage() {
+        return page;
+    }
+
+    public void setPage(Integer page) {
+        this.page = page;
+    }
+
+    public Integer getLimit() {
+        return limit;
+    }
+
+    public void setLimit(Integer limit) {
+        this.limit = limit;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getCb_code() {
+        return cb_code;
+    }
+
+    public void setCb_code(String cb_code) {
+        this.cb_code = cb_code;
+    }
+
+    public String getCb_name() {
+        return cb_name;
+    }
+
+    public void setCb_name(String cb_name) {
+        this.cb_name = cb_name;
+    }
+
+    public String getCb_rule() {
+        return cb_rule;
+    }
+
+    public void setCb_rule(String cb_rule) {
+        this.cb_rule = cb_rule;
+    }
+
+    public String getCb_packages() {
+        return cb_packages;
+    }
+
+    public void setCb_packages(String cb_packages) {
+        this.cb_packages = cb_packages;
+    }
+
+    public String getCb_citys() {
+        return cb_citys;
+    }
+
+    public void setCb_citys(String cb_citys) {
+        this.cb_citys = cb_citys;
+    }
+}

+ 148 - 0
src/main/java/com/ygj/yuemum/domain/coupon/CouponCreate.java

@@ -0,0 +1,148 @@
+package com.ygj.yuemum.domain.coupon;
+
+public class CouponCreate {
+    private Integer id;
+    private String cb_code;
+    private String cb_name;
+    private Integer cc_quantity;
+    private Integer cc_amount;
+    private String cc_createdate;
+    private String cc_startdate;
+    private String cc_enddate;
+    private Integer cc_status;
+    private String syncmodoodate;
+    private Integer syncmodoo;
+    private String usercode;
+    private Integer page;
+    private Integer limit;
+    private String cb_packages;
+    private String cb_citys;
+
+    public String getCb_packages() {
+        return cb_packages;
+    }
+
+    public void setCb_packages(String cb_packages) {
+        this.cb_packages = cb_packages;
+    }
+
+    public String getCb_citys() {
+        return cb_citys;
+    }
+
+    public void setCb_citys(String cb_citys) {
+        this.cb_citys = cb_citys;
+    }
+
+    public String getCb_name() {
+        return cb_name;
+    }
+
+    public void setCb_name(String cb_name) {
+        this.cb_name = cb_name;
+    }
+
+    public Integer getPage() {
+        return page;
+    }
+
+    public void setPage(Integer page) {
+        this.page = page;
+    }
+
+    public Integer getLimit() {
+        return limit;
+    }
+
+    public void setLimit(Integer limit) {
+        this.limit = limit;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getCb_code() {
+        return cb_code;
+    }
+
+    public void setCb_code(String cb_code) {
+        this.cb_code = cb_code;
+    }
+
+    public Integer getCc_quantity() {
+        return cc_quantity;
+    }
+
+    public void setCc_quantity(Integer cc_quantity) {
+        this.cc_quantity = cc_quantity;
+    }
+
+    public Integer getCc_amount() {
+        return cc_amount;
+    }
+
+    public void setCc_amount(Integer cc_amount) {
+        this.cc_amount = cc_amount;
+    }
+
+    public String getCc_createdate() {
+        return cc_createdate;
+    }
+
+    public void setCc_createdate(String cc_createdate) {
+        this.cc_createdate = cc_createdate;
+    }
+
+    public String getCc_startdate() {
+        return cc_startdate;
+    }
+
+    public void setCc_startdate(String cc_startdate) {
+        this.cc_startdate = cc_startdate;
+    }
+
+    public String getCc_enddate() {
+        return cc_enddate;
+    }
+
+    public void setCc_enddate(String cc_enddate) {
+        this.cc_enddate = cc_enddate;
+    }
+
+    public Integer getCc_status() {
+        return cc_status;
+    }
+
+    public void setCc_status(Integer cc_status) {
+        this.cc_status = cc_status;
+    }
+
+    public String getSyncmodoodate() {
+        return syncmodoodate;
+    }
+
+    public void setSyncmodoodate(String syncmodoodate) {
+        this.syncmodoodate = syncmodoodate;
+    }
+
+    public Integer getSyncmodoo() {
+        return syncmodoo;
+    }
+
+    public void setSyncmodoo(Integer syncmodoo) {
+        this.syncmodoo = syncmodoo;
+    }
+
+    public String getUsercode() {
+        return usercode;
+    }
+
+    public void setUsercode(String usercode) {
+        this.usercode = usercode;
+    }
+}

+ 77 - 0
src/main/java/com/ygj/yuemum/domain/coupon/CouponLog.java

@@ -0,0 +1,77 @@
+package com.ygj.yuemum.domain.coupon;
+
+public class CouponLog {
+
+    private Integer id;
+    private String cp_code;
+    private Integer cl_type;
+    private Integer cb_code;
+    private Integer cl_mp;
+    private Integer cl_user;
+    private String cl_date;
+    private String cl_billno;
+
+    public Integer getCb_code() {
+        return cb_code;
+    }
+
+    public void setCb_code(Integer cb_code) {
+        this.cb_code = cb_code;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getCp_code() {
+        return cp_code;
+    }
+
+    public void setCp_code(String cp_code) {
+        this.cp_code = cp_code;
+    }
+
+    public Integer getCl_type() {
+        return cl_type;
+    }
+
+    public void setCl_type(Integer cl_type) {
+        this.cl_type = cl_type;
+    }
+
+    public Integer getCl_mp() {
+        return cl_mp;
+    }
+
+    public void setCl_mp(Integer cl_mp) {
+        this.cl_mp = cl_mp;
+    }
+
+    public Integer getCl_user() {
+        return cl_user;
+    }
+
+    public void setCl_user(Integer cl_user) {
+        this.cl_user = cl_user;
+    }
+
+    public String getCl_date() {
+        return cl_date;
+    }
+
+    public void setCl_date(String cl_date) {
+        this.cl_date = cl_date;
+    }
+
+    public String getCl_billno() {
+        return cl_billno;
+    }
+
+    public void setCl_billno(String cl_billno) {
+        this.cl_billno = cl_billno;
+    }
+}

+ 58 - 0
src/main/java/com/ygj/yuemum/domain/global/Packages.java

@@ -0,0 +1,58 @@
+package com.ygj.yuemum.domain.global;
+
+public class Packages {
+    private Integer id;
+    private String p_code;
+    private Integer p_type;
+    private String p_name;
+    private Integer p_days;
+    private Integer p_amount;
+
+    public Integer getP_type() {
+        return p_type;
+    }
+
+    public void setP_type(Integer p_type) {
+        this.p_type = p_type;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getP_code() {
+        return p_code;
+    }
+
+    public void setP_code(String p_code) {
+        this.p_code = p_code;
+    }
+
+    public String getP_name() {
+        return p_name;
+    }
+
+    public void setP_name(String p_name) {
+        this.p_name = p_name;
+    }
+
+    public Integer getP_days() {
+        return p_days;
+    }
+
+    public void setP_days(Integer p_days) {
+        this.p_days = p_days;
+    }
+
+    public Integer getP_amount() {
+        return p_amount;
+    }
+
+    public void setP_amount(Integer p_amount) {
+        this.p_amount = p_amount;
+    }
+}

+ 69 - 0
src/main/java/com/ygj/yuemum/service/coupon/CouponBatchService.java

@@ -0,0 +1,69 @@
+package com.ygj.yuemum.service.coupon;
+
+import com.github.pagehelper.PageHelper;
+import com.ygj.yuemum.dao.coupon.CouponBatchDao;
+import com.ygj.yuemum.domain.coupon.CouponBatch;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class CouponBatchService {
+
+    @Autowired
+    private CouponBatchDao couponBatchDao;
+    //分页
+    public Map<String, Object> getCouponBatchs(int page, int limit) {
+        PageHelper.startPage(page, limit);
+        List<CouponBatch> couponBatches = couponBatchDao.getAll();
+        Map<String, Object> tableData = new HashMap<>();
+        Integer count  = couponBatchDao.getCount();
+        tableData.put("items", couponBatches);
+        tableData.put("total", count);
+        return tableData;
+    }
+    public List<CouponBatch> getAll() {
+        List<CouponBatch> couponBatches = couponBatchDao.getAll();
+        return couponBatches;
+    }
+
+    public List<CouponBatch> selectCouponBatch() {
+        List<CouponBatch> couponBatches = couponBatchDao.selectCouponBatch();
+        return couponBatches;
+    }
+    public int addCouponBatch(CouponBatch couponBatch) {
+        SimpleDateFormat dateFormat= new SimpleDateFormat("yyyyMMdd");
+        Date date = new Date();
+        couponBatch.setCb_code("PVP"+dateFormat.format(date)+(int)((Math.random()*9+1)*10000));
+        return couponBatchDao.insertSelective(couponBatch);
+    }
+
+    public int deleteCouponBatch(String id) {
+        return couponBatchDao.deleteByPrimaryKey(id);
+    }
+
+    public int updateCouponBatch(CouponBatch couponBatch) {
+        return couponBatchDao.updateByPrimaryKeySelective(couponBatch);
+    }
+
+    public CouponBatch getCouponBatch(Integer id) {
+        return couponBatchDao.selectByPrimaryKey(id);
+    }
+
+    public Map<String, Object> getQCouponBatch(CouponBatch couponBatch) {
+        PageHelper.startPage(couponBatch.getPage(), couponBatch.getLimit());
+        List<CouponBatch> couponBatches = couponBatchDao.getQCouponBatch(couponBatch);
+        Map<String, Object> tableData = new HashMap<>();
+        Integer count = couponBatchDao.getQCouponBatchconut(couponBatch);
+        tableData.put("items", couponBatches);
+        tableData.put("total", count);
+        return tableData;
+    }
+
+
+}

+ 118 - 0
src/main/java/com/ygj/yuemum/service/coupon/CouponCreateService.java

@@ -0,0 +1,118 @@
+package com.ygj.yuemum.service.coupon;
+
+import com.github.pagehelper.PageHelper;
+import com.ygj.yuemum.dao.coupon.CouponCreateDao;
+import com.ygj.yuemum.domain.coupon.Coupon;
+import com.ygj.yuemum.domain.coupon.CouponCreate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Service
+public class CouponCreateService {
+
+    @Autowired
+    private CouponCreateDao couponCreateDao;
+    @Autowired
+    private CouponService couponService;
+
+    //分页
+    public Map<String, Object> getCouponCreates(int page, int limit) {
+        PageHelper.startPage(page, limit);
+        List<CouponCreate> couponCreates = couponCreateDao.getAll();
+        Map<String, Object> tableData = new HashMap<>();
+        Integer count = couponCreateDao.getCount();
+        tableData.put("items", couponCreates);
+        tableData.put("total", count);
+        return tableData;
+    }
+
+    public List<CouponCreate> getAll() {
+        List<CouponCreate> couponCreates = couponCreateDao.getAll();
+        return couponCreates;
+    }
+
+    public int addCouponCreate(CouponCreate couponCreate) {
+        try {
+            int ccpmid = couponCreateDao.getccpmid();
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            couponCreate.setCc_status(1);
+            couponCreate.setCc_createdate(String.valueOf(sdf.format(new Date())));
+            couponCreateDao.insertSelective(couponCreate);
+            //取数量 生成优惠券
+            for(int i=0;i<couponCreate.getCc_quantity();i++){
+                Coupon coupon = new  Coupon();
+                coupon.setCp_code(UUID.randomUUID().toString().replace("-", ""));
+                coupon.setCb_code(couponCreate.getCb_code());
+                coupon.setCc_code(ccpmid);
+                coupon.setCp_amount(couponCreate.getCc_amount());
+                coupon.setCp_startdate(couponCreate.getCc_startdate());
+                coupon.setCp_enddate(couponCreate.getCc_enddate());
+                coupon.setCp_status(1);
+                if(couponService.addCoupon(coupon) !=1){
+                    return 0;
+                }
+            }
+        }catch (Exception ex) {
+            ex.printStackTrace();
+            return 0;
+        }
+        return 1;
+    }
+
+    public int deleteCouponCreate(Integer id) {
+        return couponCreateDao.deleteByPrimaryKey(id);
+    }
+
+    public int disableCouponCreate(Integer id) {
+        try {
+            int tempa = couponCreateDao.disableCouponCreate(id);
+            int tempb = couponService.disableCoupon(id);
+        }catch (Exception ex){
+            ex.printStackTrace();
+            return 0;
+        }
+        return 1;
+    }
+
+    public int enableCouponCreate(Integer id) {
+        try {
+            int tempa = couponCreateDao.enableCouponCreate(id);
+            int tempb = couponService.enableCoupon(id);
+        }catch (Exception ex){
+            ex.printStackTrace();
+            return 0;
+        }
+        return 1;
+    }
+
+    public int updateCouponCreate(CouponCreate couponCreate) {
+        return couponCreateDao.updateByPrimaryKeySelective(couponCreate);
+    }
+
+    public int checkCouponBatch(String id) {
+        return couponCreateDao.checkCouponBatch(id);
+    }
+
+    public int checkCouponBatchid(Integer id) {
+        return couponCreateDao.checkCouponBatchid(id);
+    }
+
+
+    public CouponCreate getCouponCreate(Integer id) {
+        return couponCreateDao.selectByPrimaryKey(id);
+    }
+
+    public Map<String, Object> getQCouponCreate(CouponCreate couponCreate) {
+        PageHelper.startPage(couponCreate.getPage(), couponCreate.getLimit());
+        List<CouponCreate> couponCreates = couponCreateDao.getQCouponCreate(couponCreate);
+        Map<String, Object> tableData = new HashMap<>();
+        Integer count = couponCreateDao.getQCouponCreateCount(couponCreate);
+        tableData.put("items", couponCreates);
+        tableData.put("total", count);
+        return tableData;
+    }
+
+}

+ 49 - 0
src/main/java/com/ygj/yuemum/service/coupon/CouponLogService.java

@@ -0,0 +1,49 @@
+package com.ygj.yuemum.service.coupon;
+
+import com.github.pagehelper.PageHelper;
+import com.ygj.yuemum.dao.coupon.CouponLogDao;
+import com.ygj.yuemum.domain.coupon.CouponLog;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class CouponLogService {
+
+    @Autowired
+    private CouponLogDao couponLogDao;
+    //分页
+    public Map<String, Object> getCouponLogs(int page, int limit) {
+        PageHelper.startPage(page, limit);
+        List<CouponLog> couponLogs= couponLogDao.getAll();
+        Map<String, Object> tableData = new HashMap<>();
+        Integer count  = couponLogDao.getCount();
+        tableData.put("items", couponLogs);
+        tableData.put("total", count);
+        return tableData;
+    }
+    public List<CouponLog> getAll() {
+        List<CouponLog> couponLogs = couponLogDao.getAll();
+        return couponLogs;
+    }
+    public int addCouponLog(CouponLog couponLog) {
+        return couponLogDao.insertSelective(couponLog);
+    }
+
+    public int deleteCouponLog(Integer id) {
+        return couponLogDao.deleteByPrimaryKey(id);
+    }
+
+    public int updateCouponLog(CouponLog couponLog) {
+        return couponLogDao.updateByPrimaryKeySelective(couponLog);
+    }
+
+    public CouponLog getCouponLog(Integer id) {
+        return couponLogDao.selectByPrimaryKey(id);
+    }
+
+
+}

+ 57 - 0
src/main/java/com/ygj/yuemum/service/coupon/CouponService.java

@@ -0,0 +1,57 @@
+package com.ygj.yuemum.service.coupon;
+
+import com.github.pagehelper.PageHelper;
+import com.ygj.yuemum.dao.coupon.CouponDao;
+import com.ygj.yuemum.domain.coupon.Coupon;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class CouponService {
+
+    @Autowired
+    private CouponDao couponDao;
+    //分页
+    public Map<String, Object> getCoupons(int page, int limit) {
+        PageHelper.startPage(page, limit);
+        List<Coupon> coupons = couponDao.getAll();
+        Map<String, Object> tableData = new HashMap<>();
+        Integer count  = couponDao.getCount();
+        tableData.put("items", coupons);
+        tableData.put("total", count);
+        return tableData;
+    }
+    public List<Coupon> getAll() {
+        List<Coupon> coupons = couponDao.getAll();
+        return coupons;
+    }
+    public int addCoupon(Coupon coupon) {
+        return couponDao.insertSelective(coupon);
+    }
+
+    public int disableCoupon(Integer id) {
+        return couponDao.disableCoupon(id);
+    }
+
+    public int enableCoupon(Integer id) {
+        return couponDao.enableCoupon(id);
+    }
+
+    public int deleteCoupon(Integer id) {
+        return couponDao.deleteByPrimaryKey(id);
+    }
+
+    public int updateCoupon(Coupon coupon) {
+        return couponDao.updateByPrimaryKeySelective(coupon);
+    }
+
+    public Coupon getCoupon(Integer id) {
+        return couponDao.selectByPrimaryKey(id);
+    }
+
+
+}

+ 24 - 0
src/main/java/com/ygj/yuemum/service/global/PackagesService.java

@@ -0,0 +1,24 @@
+package com.ygj.yuemum.service.global;
+
+import com.ygj.yuemum.dao.global.PackagesDao;
+import com.ygj.yuemum.domain.global.Packages;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class PackagesService {
+
+    @Autowired
+
+    private PackagesDao packagesDao;
+
+    public List<Packages> getPackageSelect() {
+        return packagesDao.getPackageSelect();
+    }
+    public List<Packages> getPackageAll() {
+        return packagesDao.getPackageAll();
+    }
+
+}

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

@@ -2,8 +2,8 @@ server:
   port: 8888
 mybatis:
   config-location: classpath:mybatis/mybatis-config.xml
-  mapper-locations: mybatis/mapper/admin/*.xml,mybatis/mapper/maternitymatron/*.xml
-  mybatis.type-aliases-package: com.ygj.yuemum.domain/admin,com.ygj.yuemum.domain/maternitymatron
+  mapper-locations: mybatis/mapper/admin/*.xml,mybatis/mapper/maternitymatron/*.xml,mybatis/mapper/coupon/*.xml,mybatis/mapper/global/*.xml
+  mybatis.type-aliases-package: com.ygj.yuemum.domain/admin,com.ygj.yuemum.domain/maternitymatron,com.ygj.yuemum.domain/coupon,com.ygj.yuemum.domain/global
   log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 spring:
   datasource:

+ 167 - 0
src/main/resources/mybatis/mapper/coupon/CouponBatchMapper.xml

@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ygj.yuemum.dao.coupon.CouponBatchDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.coupon.CouponBatch" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="cb_code" property="cb_code" jdbcType="VARCHAR" />
+        <result column="cb_name" property="cb_name" jdbcType="VARCHAR" />
+        <result column="cb_rule" property="cb_rule" jdbcType="VARCHAR" />
+        <result column="cb_packages" property="cb_packages" jdbcType="VARCHAR" />
+        <result column="cb_citys" property="cb_citys" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <sql id="Base_Column_List" >
+        id, cb_code,cb_name,cb_rule,cb_packages,cb_citys
+    </sql>
+
+    <!--获取所有数据-->
+    <select id="getCount" resultType="java.lang.Integer" >
+        select
+        count(1)
+        from coupon_batch
+    </select>
+
+
+    <select id="getAll" resultMap="BaseResultMap" >
+        select
+        id, cb_code,cb_name,cb_rule,fgetpackages(id) cb_packages,fgetmoretcityname(id) cb_citys
+        from coupon_batch
+        order by id desc
+    </select>
+
+    <select id="selectCouponBatch" resultMap="BaseResultMap" >
+        select
+        cb_code,cb_name
+        from coupon_batch
+        order by id desc
+    </select>
+
+
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from coupon_batch
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+        delete from coupon_batch
+        where cb_code = #{cb_code,jdbcType=VARCHAR}
+    </delete>
+
+    <!-- 插入一条培训信息 -->
+    <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.coupon.CouponBatch" >
+        insert into coupon_batch
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="cb_code != null" >
+                cb_code,
+            </if>
+            <if test="cb_name != null" >
+                cb_name,
+            </if>
+            <if test="cb_rule != null" >
+                cb_rule,
+            </if>
+            <if test="cb_packages != null" >
+                cb_packages,
+            </if>
+            <if test="cb_citys != null" >
+                cb_citys
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="cb_code != null" >
+                #{cb_code,jdbcType=VARCHAR},
+            </if>
+            <if test="cb_name != null" >
+                #{cb_name,jdbcType=VARCHAR},
+            </if>
+            <if test="cb_rule != null" >
+                #{cb_rule,jdbcType=VARCHAR},
+            </if>
+            <if test="cb_packages != null" >
+                #{cb_packages,jdbcType=VARCHAR},
+            </if>
+            <if test="cb_citys != null" >
+                #{cb_citys,jdbcType=VARCHAR}
+            </if>
+        </trim>
+    </insert>
+
+    <!-- 根据id更新一条培训信息 -->
+    <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.coupon.CouponBatch" >
+        update coupon_batch
+        <set >
+            <if test="cb_code != null" >
+                cb_code = #{cb_code,jdbcType=VARCHAR},
+            </if>
+            <if test="cb_name != null" >
+                cb_name = #{cb_name,jdbcType=VARCHAR},
+            </if>
+            <if test="cb_rule != null" >
+                cb_rule = #{cb_rule,jdbcType=VARCHAR},
+            </if>
+            <if test="cb_packages != null" >
+                cb_packages = #{cb_packages,jdbcType=VARCHAR},
+            </if>
+            <if test="cb_citys != null" >
+                cb_citys = #{cb_citys,jdbcType=VARCHAR}
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+    <select id="getQCouponBatchconut" resultType="java.lang.Integer" parameterType="com.ygj.yuemum.domain.coupon.CouponBatch">
+        select
+        count(1)
+        from coupon_batch
+        where 1=1
+        <if test="id != null and id != ''">
+            and id = #{id,jdbcType=INTEGER}
+        </if>
+        <if test="cb_code != null and cb_code != ''">
+            and cb_code = #{cb_code,jdbcType=INTEGER}
+        </if>
+        <if test="cb_name != null and cb_name != ''">
+            and cb_name like "%"#{cb_name,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="cb_rule != null and cb_rule != ''">
+            and cb_rule like "%"#{cb_rule,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="cb_packages != null and cb_packages != ''">
+            and cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="cb_citys != null and cb_citys != ''">
+            and cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+        </if>
+    </select>
+
+    <select id="getQCouponBatch" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.coupon.CouponBatch">
+        select
+        id, cb_code,cb_name,cb_rule,fgetpackages(id) cb_packages,fgetmoretcityname(id) cb_citys
+        from coupon_batch
+        where 1=1
+        <if test="id != null and id != ''">
+            and id = #{id,jdbcType=INTEGER}
+        </if>
+        <if test="cb_code != null and cb_code != ''">
+            and cb_code = #{cb_code,jdbcType=INTEGER}
+        </if>
+        <if test="cb_name != null and cb_name != ''">
+            and cb_name like "%"#{cb_name,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="cb_rule != null and cb_rule != ''">
+            and cb_rule like "%"#{cb_rule,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="cb_packages != null and cb_packages != ''">
+            and cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="cb_citys != null and cb_citys != ''">
+            and cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+        </if>
+
+    </select>
+
+
+</mapper>

+ 263 - 0
src/main/resources/mybatis/mapper/coupon/CouponCreateMapper.xml

@@ -0,0 +1,263 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ygj.yuemum.dao.coupon.CouponCreateDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.coupon.CouponCreate" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="cb_code" property="cb_code" jdbcType="VARCHAR" />
+        <result column="cb_name" property="cb_name" jdbcType="VARCHAR" />
+        <result column="cc_quantity" property="cc_quantity" jdbcType="INTEGER" />
+        <result column="cc_amount" property="cc_amount" jdbcType="INTEGER" />
+        <result column="cc_createdate" property="cc_createdate" jdbcType="DATE" />
+        <result column="cc_startdate" property="cc_startdate" jdbcType="DATE" />
+        <result column="cc_enddate" property="cc_enddate" jdbcType="DATE" />
+        <result column="cc_status" property="cc_status" jdbcType="INTEGER" />
+        <result column="syncmodoodate" property="syncmodoodate" jdbcType="DATE" />
+        <result column="syncmodoo" property="syncmodoo" jdbcType="VARCHAR" />
+        <result column="usercode" property="usercode" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <sql id="Base_Column_List" >
+      id,cb_code,cb_name,cc_quantity,cc_amount,cc_createdate,cc_startdate,cc_enddate,cc_status,syncmodoodate,syncmodoo,usercode
+    </sql>
+
+    <!--获取所有数据-->
+    <select id="getCount" resultType="java.lang.Integer" >
+        select
+        count(1)
+        from coupon_create
+    </select>
+
+    <select id="getAll" resultMap="BaseResultMap" >
+        SELECT
+            id,
+            fgetcouponbatch(cb_code) cb_name,
+            cc_startdate,
+            cc_enddate,
+            cc_createdate,
+            cc_amount,
+            cc_quantity,
+            cc_status
+        FROM
+            coupon_create
+    </select>
+
+
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from coupon_create
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+
+    <select id="checkCouponBatch" resultType="java.lang.Integer" parameterType="java.lang.String" >
+        select
+        count(1)
+        from coupon_create
+        where cb_code = #{id,jdbcType=VARCHAR}
+    </select>
+
+    <select id="checkCouponBatchid" resultType="java.lang.Integer" parameterType="java.lang.Integer" >
+        SELECT
+            count(1)
+        FROM
+            coupon_create ta
+        LEFT JOIN coupon_batch tb ON ta.cb_code = tb.cb_code
+        WHERE
+        tb.id = #{id,jdbcType=VARCHAR}
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from coupon_create
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <!-- 插入一条培训信息 -->
+    <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.coupon.CouponCreate" >
+        insert into coupon_create
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="cb_code != null" >
+                cb_code,
+            </if>
+            <if test="cc_quantity != null" >
+                cc_quantity,
+            </if>
+            <if test="cc_amount != null" >
+                cc_amount,
+            </if>
+            <if test="cc_startdate != null" >
+                cc_startdate,
+            </if>
+            <if test="cc_enddate != null" >
+                cc_enddate,
+            </if>
+            <if test="cc_createdate != null" >
+                cc_createdate,
+            </if>
+            <if test="cc_status != null" >
+                cc_status
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="cb_code != null" >
+                #{cb_code,jdbcType=VARCHAR},
+            </if>
+            <if test="cc_quantity != null" >
+                #{cc_quantity,jdbcType=INTEGER},
+            </if>
+            <if test="cc_amount != null" >
+                #{cc_amount,jdbcType=INTEGER},
+            </if>
+            <if test="cc_startdate != null" >
+                #{cc_startdate,jdbcType=DATE},
+            </if>
+            <if test="cc_enddate != null" >
+                #{cc_enddate,jdbcType=DATE},
+            </if>
+            <if test="cc_createdate != null" >
+                #{cc_createdate,jdbcType=DATE},
+            </if>
+            <if test="cc_status != null" >
+                #{cc_status,jdbcType=INTEGER}
+            </if>
+        </trim>
+    </insert>
+
+    <!-- 根据id更新一条培训信息 -->
+    <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.coupon.CouponCreate" >
+        update coupon_create
+        <set >
+            <if test="cb_code != null" >
+                cb_code = #{cb_code,jdbcType=VARCHAR},
+            </if>
+            <if test="cb_desc != null" >
+                cb_desc = #{cb_desc,jdbcType=VARCHAR},
+            </if>
+            <if test="cc_quantity != null" >
+                cc_quantity = #{cc_quantity,jdbcType=INTEGER},
+            </if>
+            <if test="cc_amount != null" >
+                cc_amount = #{cc_amount,jdbcType=INTEGER},
+            </if>
+            <if test="syncmodoodate != null" >
+                syncmodoodate = #{syncmodoodate,jdbcType=DATE},
+            </if>
+            <if test="syncmodoo != null" >
+                syncmodoo = #{syncmodoo,jdbcType=INTEGER},
+            </if>
+            <if test="usercode != null" >
+                usercode = #{usercode,jdbcType=VARCHAR},
+            </if>
+            <if test="date != null" >
+                date = #{date,jdbcType=DATE}
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+    <!--获取所有数据-->
+    <select id="getQCouponCreateCount" resultType="java.lang.Integer" parameterType="com.ygj.yuemum.domain.coupon.CouponCreate">
+        SELECT
+        count(1)
+        FROM
+        coupon_create ta
+        LEFT JOIN coupon_batch tb ON ta.cb_code = tb.cb_code
+        where 1=1
+        <if test="id != null and id != ''">
+            and ta.id = #{id,jdbcType=INTEGER}
+        </if>
+        <if test="cb_code != null and cb_code != ''">
+            and tb.cb_code = #{cb_code,jdbcType=VARCHAR}
+        </if>
+        <if test="cb_packages != null and cb_packages != ''">
+            and tb.cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="cb_citys != null and cb_citys != ''">
+            and tb.cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="cc_startdate != null and cc_startdate != ''">
+            and ta.cc_startdate = #{cc_startdate,jdbcType=VARCHAR}
+        </if>
+        <if test="cc_enddate != null and cc_enddate != ''">
+            and ta.cc_enddate = #{cc_enddate,jdbcType=VARCHAR}
+        </if>
+        <if test="cc_createdate != null and cc_createdate != ''">
+            and ta.cc_createdate = #{cc_createdate,jdbcType=VARCHAR}
+        </if>
+        <if test="cc_amount != null and cc_amount != ''">
+            and ta.cc_amount = #{cc_amount,jdbcType=INTEGER}
+        </if>
+        <if test="cc_quantity != null and cc_quantity != ''">
+            and ta.cc_quantity = #{cc_quantity,jdbcType=INTEGER}
+        </if>
+        <if test="cc_status != null ">
+            and ta.cc_status = #{cc_status,jdbcType=INTEGER}
+        </if>
+    </select>
+
+    <select id="getQCouponCreate" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.coupon.CouponCreate">
+        SELECT
+        ta.id,
+        tb.cb_code,
+        tb.cb_name,
+        ta.cc_amount,
+        ta.cc_quantity,
+        ta.cc_createdate,
+        ta.cc_status,
+        ta.cc_startdate,
+        ta.cc_enddate
+        FROM
+        coupon_create ta
+        LEFT JOIN coupon_batch tb ON ta.cb_code = tb.cb_code
+        where 1=1
+        <if test="id != null and id != ''">
+            and ta.id = #{id,jdbcType=INTEGER}
+        </if>
+        <if test="cb_code != null and cb_code != ''">
+            and tb.cb_code = #{cb_code,jdbcType=VARCHAR}
+        </if>
+        <if test="cb_packages != null and cb_packages != ''">
+            and tb.cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="cb_citys != null and cb_citys != ''">
+            and tb.cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="cc_startdate != null and cc_startdate != ''">
+            and ta.cc_startdate = #{cc_startdate,jdbcType=VARCHAR}
+        </if>
+        <if test="cc_enddate != null and cc_enddate != ''">
+            and ta.cc_enddate = #{cc_enddate,jdbcType=VARCHAR}
+        </if>
+        <if test="cc_createdate != null and cc_createdate != ''">
+            and ta.cc_createdate = #{cc_createdate,jdbcType=VARCHAR}
+        </if>
+        <if test="cc_amount != null and cc_amount != ''">
+            and ta.cc_amount = #{cc_amount,jdbcType=INTEGER}
+        </if>
+        <if test="cc_quantity != null and cc_quantity != ''">
+            and ta.cc_quantity = #{cc_quantity,jdbcType=INTEGER}
+        </if>
+        <if test="cc_status != null ">
+            and ta.cc_status = #{cc_status,jdbcType=INTEGER}
+        </if>
+    </select>
+    <select id="getccpmid" resultType="java.lang.Integer" >
+        SELECT auto_increment
+        FROM information_schema.tables
+        where table_schema="yuemum"
+        and table_name="coupon_create";
+    </select>
+
+    <update id="disableCouponCreate" parameterType="java.lang.Integer" >
+        update coupon_create
+        set cc_status = 0
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+    <update id="enableCouponCreate" parameterType="java.lang.Integer" >
+        update coupon_create
+        set cc_status = 1
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+</mapper>

+ 127 - 0
src/main/resources/mybatis/mapper/coupon/CouponLogMapper.xml

@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ygj.yuemum.dao.coupon.CouponLogDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.coupon.CouponLog" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="cp_code" property="cp_code" jdbcType="VARCHAR" />
+        <result column="cb_code" property="cb_code" jdbcType="INTEGER" />
+        <result column="cl_type" property="cl_type" jdbcType="INTEGER" />
+        <result column="cl_mp" property="cl_mp" jdbcType="INTEGER" />
+        <result column="cl_user" property="cl_user" jdbcType="INTEGER" />
+        <result column="cl_date" property="cl_date" jdbcType="DATE" />
+        <result column="cl_billno" property="cl_billno" jdbcType="DATE" />
+    </resultMap>
+
+    <sql id="Base_Column_List" >
+        id, cp_code,cb_code,cl_type,cl_mp,cl_user,cl_date,cl_billno
+    </sql>
+
+    <!--获取所有数据-->
+    <select id="getCount" resultType="java.lang.Integer" >
+        select
+        count(1)
+        from coupon_log
+    </select>
+
+
+    <select id="getAll" resultMap="BaseResultMap" >
+        select
+        <include refid="Base_Column_List" />
+        from coupon_log
+        order by id desc
+    </select>
+
+
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from coupon_log
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from coupon_log
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.coupon.CouponLog" >
+        insert into coupon_log
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="cp_code != null" >
+                cp_code,
+            </if>
+            <if test="cb_code != null" >
+                cb_code,
+            </if>
+            <if test="cl_type != null" >
+                cl_type,
+            </if>
+            <if test="cl_mp != null" >
+                cl_mp,
+            </if>
+            <if test="cl_user != null" >
+                cl_user,
+            </if>
+            <if test="cl_date != null" >
+                cl_date,
+            </if>
+            <if test="cl_billno != null" >
+                cl_billno
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="cp_code != null" >
+                #{cp_code,jdbcType=VARCHAR},
+            </if>
+            <if test="cb_code != null" >
+                #{cb_code,jdbcType=INTEGER},
+            </if>
+            <if test="cl_type != null" >
+                #{cl_type,jdbcType=INTEGER},
+            </if>
+            <if test="cl_mp != null" >
+                #{cl_mp,jdbcType=INTEGER},
+            </if>
+            <if test="cl_user != null" >
+                #{cl_user,jdbcType=INTEGER},
+            </if>
+            <if test="cl_date != null" >
+                #{cl_date,jdbcType=DATE},
+            </if>
+            <if test="cl_billno != null" >
+                #{cl_billno,jdbcType=VARCHAR}
+            </if>
+        </trim>
+    </insert>
+
+    <!-- 根据id更新一条培训信息 -->
+    <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.coupon.CouponLog" >
+        update coupon_log
+        <set >
+            <if test="cp_code != null" >
+                cp_code = #{cp_code,jdbcType=VARCHAR},
+            </if>
+            <if test="cb_code != null" >
+                cb_code = #{cb_code,jdbcType=INTEGER},
+            </if>
+            <if test="cl_type != null" >
+                cl_type = #{cl_type,jdbcType=INTEGER},
+            </if>
+            <if test="cl_mp != null" >
+                cl_mp = #{cl_mp,jdbcType=INTEGER},
+            </if>
+            <if test="cl_user != null" >
+                cl_user = #{cl_user,jdbcType=INTEGER},
+            </if>
+            <if test="cl_date != null" >
+                cl_date = #{cl_date,jdbcType=DATE}
+            </if>
+            <if test="cl_billno != null" >
+                cl_billno = #{cl_billno,jdbcType=VARCHAR}
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+</mapper>

+ 109 - 0
src/main/resources/mybatis/mapper/coupon/CouponMapper.xml

@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ygj.yuemum.dao.coupon.CouponDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.coupon.Coupon" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="cp_code" property="cp_code" jdbcType="VARCHAR" />
+        <result column="cb_code" property="cb_code" jdbcType="VARCHAR" />
+        <result column="cc_code" property="cc_code" jdbcType="INTEGER" />
+        <result column="cp_startdate" property="cp_startdate" jdbcType="DATE" />
+        <result column="cp_enddate" property="cp_enddate" jdbcType="DATE" />
+        <result column="cp_amount" property="cp_amount" jdbcType="INTEGER" />
+        <result column="cp_status" property="cp_status" jdbcType="INTEGER" />
+    </resultMap>
+
+    <sql id="Base_Column_List" >
+        id, cp_code,cc_code,cb_code,cp_startdate,cp_enddate,cp_amount,cp_status
+    </sql>
+
+    <!--获取所有数据-->
+    <select id="getCount" resultType="java.lang.Integer" >
+        select
+        count(1)
+        from coupon
+    </select>
+
+
+    <select id="getAll" resultMap="BaseResultMap" >
+        select
+        <include refid="Base_Column_List" />
+        from coupon
+        order by id desc
+    </select>
+
+
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from coupon
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from coupon
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <update id="disableCoupon" parameterType="java.lang.Integer" >
+        update coupon
+        set cp_status = 4
+        where cc_code = #{id,jdbcType=INTEGER}
+    </update>
+
+    <update id="enableCoupon" parameterType="java.lang.Integer" >
+        update coupon
+        set cp_status = 1
+        where cc_code = #{id,jdbcType=INTEGER}
+    </update>
+
+    <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.coupon.Coupon" >
+        insert into coupon
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="cp_code != null" >
+                cp_code,
+            </if>
+            <if test="cb_code != null" >
+                cb_code,
+            </if>
+            <if test="cc_code != null" >
+                cc_code,
+            </if>
+            <if test="cp_startdate != null" >
+                cp_startdate,
+            </if>
+            <if test="cp_enddate != null" >
+                cp_enddate,
+            </if>
+            <if test="cp_amount != null" >
+                cp_amount,
+            </if>
+            <if test="cp_status != null" >
+                cp_status
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="cp_code != null" >
+                #{cp_code,jdbcType=VARCHAR},
+            </if>
+            <if test="cb_code != null" >
+                #{cb_code,jdbcType=VARCHAR},
+            </if>
+            <if test="cc_code != null" >
+                #{cc_code,jdbcType=VARCHAR},
+            </if>
+            <if test="cp_startdate != null" >
+                #{cp_startdate,jdbcType=DATE},
+            </if>
+            <if test="cp_enddate != null" >
+                #{cp_enddate,jdbcType=DATE},
+            </if>
+            <if test="cp_amount != null" >
+                #{cp_amount,jdbcType=INTEGER},
+            </if>
+            <if test="cp_status != null" >
+                #{cp_status,jdbcType=INTEGER}
+            </if>
+        </trim>
+    </insert>
+</mapper>

+ 27 - 0
src/main/resources/mybatis/mapper/global/packagesMapper.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ygj.yuemum.dao.global.PackagesDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.global.Packages" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="p_code" property="p_code" jdbcType="VARCHAR" />
+        <result column="p_type" property="p_type" jdbcType="INTEGER" />
+        <result column="p_name" property="p_name" jdbcType="VARCHAR" />
+        <result column="p_days" property="p_days" jdbcType="INTEGER" />
+        <result column="p_amount" property="p_amount" jdbcType="INTEGER" />
+    </resultMap>
+
+    <!--获取所有数据-->
+    <select id="getPackageSelect" resultType="com.ygj.yuemum.domain.global.Packages" >
+        select
+        p_code,p_name
+        from packages
+    </select>
+
+    <select id="getPackageAll" resultType="com.ygj.yuemum.domain.global.Packages" >
+        select
+        p_code,p_type,p_name,p_days,p_amount
+        from packages
+    </select>
+
+</mapper>