浏览代码

需求变更

huan.wang 6 年之前
父节点
当前提交
a873bd4d93

+ 4 - 4
src/main/java/com/ygj/yuemum/YueMumApplication.java

@@ -38,9 +38,9 @@ public class YueMumApplication {
     public MultipartConfigElement multipartConfigElement() {
         MultipartConfigFactory factory = new MultipartConfigFactory();
         //  单个数据大小
-        factory.setMaxFileSize("5120KB");
+        factory.setMaxFileSize("50240KB");
         /// 总上传数据大小
-        factory.setMaxRequestSize("5120KB");
+        factory.setMaxRequestSize("50240KB");
         return factory.createMultipartConfig();
     }
 }
@@ -70,9 +70,9 @@ public class YueMumApplication {
 //    public MultipartConfigElement multipartConfigElement() {
 //        MultipartConfigFactory factory = new MultipartConfigFactory();
 //        //  单个数据大小
-//        factory.setMaxFileSize("5120KB");
+//        factory.setMaxFileSize("10240KB");
 //        /// 总上传数据大小
-//        factory.setMaxRequestSize("5120KB");
+//        factory.setMaxRequestSize("10240KB");
 //        return factory.createMultipartConfig();
 //    }
 //}

+ 24 - 0
src/main/java/com/ygj/yuemum/controller/global/PackageImagesController.java

@@ -0,0 +1,24 @@
+package com.ygj.yuemum.controller.global;
+
+
+import com.ygj.yuemum.domain.global.PackageImages;
+import com.ygj.yuemum.service.global.PackageImagesService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+public class PackageImagesController {
+
+    @Autowired
+    private PackageImagesService packageImagesService;
+
+    @GetMapping("/getPackageImagesByID")
+    public List<PackageImages> getPackageImagesByID(@RequestParam("p_id") Integer p_id) {
+        List<PackageImages> packageItems = packageImagesService.getPackageImagesByID(p_id);
+        return packageItems;
+    }
+}

+ 12 - 15
src/main/java/com/ygj/yuemum/controller/wxmini/WXDianpingController.java

@@ -42,35 +42,32 @@ public class WXDianpingController {
         return wxBanners;
     }
 
-
-    @RequestMapping(value = "/insertWXDianPing", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
+    @RequestMapping(value = "/insertWXDianPing", method = RequestMethod.POST, produces="application/json;charset=UTF-8")
     @ResponseBody
-    public int insertWXDianPing(@RequestParam Map<String, Object> jsonParam) {
-        WXDianPing wxDianPing = JSON.parseObject(JSON.toJSONString(jsonParam), WXDianPing.class);
-        JSONArray imageLists = JSONArray.parseArray(wxDianPing.getImage_list());
+    public int insertWXDianPing(@RequestBody Map<String,String> params) {
+        WXDianPing wxDianPing = JSON.parseObject(JSON.toJSONString(params), WXDianPing.class);
+        String[] imageLists = wxDianPing.getImage_list().split(",");
         int dianPingID = wxDianPingService.getDianPingID();
-        for (int i = 0; i < imageLists.size(); i++) {
+        for (int i = 0; i < imageLists.length; i++) {
             WXDianPingImages wxDianPingImages = new WXDianPingImages();
             wxDianPingImages.setWd_id(dianPingID);
-            wxDianPingImages.setWdi_image_path(imageLists.getString(i));
+            wxDianPingImages.setWdi_image_path(imageLists[i]);
             wxDianPingImagesService.insertWXDianPingImages(wxDianPingImages);
         }
         wxDianPingService.insertWXDianPing(wxDianPing);
         return 1;
     }
 
-
-
-    @RequestMapping(value = "/updateWXDianPing", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
+    @RequestMapping(value = "/updateWXDianPing", method = RequestMethod.POST, produces="application/json;charset=UTF-8")
     @ResponseBody
-    public int updateWXDianPing(@RequestParam Map<String, Object> jsonParam) {
-        WXDianPing wxDianPing = JSON.parseObject(JSON.toJSONString(jsonParam), WXDianPing.class);
-        JSONArray imageLists = JSONArray.parseArray(wxDianPing.getImage_list());
+    public int updateWXDianPing(@RequestBody Map<String,String> params) {
+        WXDianPing wxDianPing = JSON.parseObject(JSON.toJSONString(params), WXDianPing.class);
+        String[] imageLists = wxDianPing.getImage_list().split(",");
         wxDianPingImagesService.deleteWXDianPingImage(wxDianPing.getId());
-        for (int i = 0; i < imageLists.size(); i++) {
+        for (int i=0;i<imageLists.length;i++) {
             WXDianPingImages wxDianPingImages = new WXDianPingImages();
             wxDianPingImages.setWd_id(wxDianPing.getId());
-            wxDianPingImages.setWdi_image_path(imageLists.getString(i));
+            wxDianPingImages.setWdi_image_path(imageLists[i]);
             wxDianPingImagesService.insertWXDianPingImages(wxDianPingImages);
         }
         wxDianPingService.updateWXDianPing(wxDianPing);

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

@@ -0,0 +1,13 @@
+package com.ygj.yuemum.dao.global;
+
+import com.ygj.yuemum.domain.global.PackageImages;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface PackageImagesDao {
+
+    List<PackageImages> getPackageImagesByID(Integer p_id);
+
+}

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

@@ -13,9 +13,18 @@ public class CustomerBooking {
     private String bk_introducer_consultant;
     private String bk_typedesc;
     private Integer bk_branches_id;
+    private String  bk_branches_name;
     private Integer limit;
     private Integer page;
 
+    public String getBk_branches_name() {
+        return bk_branches_name;
+    }
+
+    public void setBk_branches_name(String bk_branches_name) {
+        this.bk_branches_name = bk_branches_name;
+    }
+
     public Integer getBk_branches_id() {
         return bk_branches_id;
     }

+ 40 - 0
src/main/java/com/ygj/yuemum/domain/global/PackageImages.java

@@ -0,0 +1,40 @@
+package com.ygj.yuemum.domain.global;
+
+public class PackageImages {
+    private Integer id;
+    private Integer p_id;
+    private String pi_path;
+    private Integer pi_seq;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getP_id() {
+        return p_id;
+    }
+
+    public void setP_id(Integer p_id) {
+        this.p_id = p_id;
+    }
+
+    public String getPi_path() {
+        return pi_path;
+    }
+
+    public void setPi_path(String pi_path) {
+        this.pi_path = pi_path;
+    }
+
+    public Integer getPi_seq() {
+        return pi_seq;
+    }
+
+    public void setPi_seq(Integer pi_seq) {
+        this.pi_seq = pi_seq;
+    }
+}

+ 9 - 0
src/main/java/com/ygj/yuemum/domain/wxmini/WXContent.java

@@ -12,9 +12,18 @@ public class WXContent {
     private String wc_create_user_name;
     private String wc_create_date;
     private Integer wct_step;
+    private String desc;
     private Integer limit;
     private  Integer page;
 
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
     public Integer getWct_step() {
         return wct_step;
     }

+ 22 - 0
src/main/java/com/ygj/yuemum/service/global/PackageImagesService.java

@@ -0,0 +1,22 @@
+package com.ygj.yuemum.service.global;
+
+import com.ygj.yuemum.dao.global.PackageImagesDao;
+import com.ygj.yuemum.domain.global.PackageImages;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class PackageImagesService {
+
+    @Autowired
+
+    private PackageImagesDao packageImagesDao;
+
+    public List<PackageImages> getPackageImagesByID(Integer p_id) {
+        return packageImagesDao.getPackageImagesByID(p_id);
+    }
+
+
+}

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

@@ -304,21 +304,20 @@ public class WeChatInfoService {
             for (WXPublic wxPublic : wxPublics) {
                 wechatTemplate.setTouser(wxPublic.getWp_openid());
                 wechatTemplate.setData(mapdata);
-
-            }
-            String toString = mapper.writeValueAsString(wechatTemplate);
-            String result = "";
-            CloseableHttpClient httpClient = HttpClients.createDefault();
-            WeChatInfo weChatInfo = weChatInfoDao.getWeChatInfo();
-            HttpPost httpPost = new HttpPost(SENDMESSAGEURL + weChatInfo.getAccess_token());
-            StringEntity stringEntity = new StringEntity(toString, ContentType.APPLICATION_JSON);
-            stringEntity.setContentEncoding("utf-8");
-            httpPost.setEntity(stringEntity);
-            CloseableHttpResponse response = httpClient.execute(httpPost);
-            if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
-                result = EntityUtils.toString(response.getEntity(), "utf-8");
-            } else {
-                return 0;
+                String toString = mapper.writeValueAsString(wechatTemplate);
+                String result = "";
+                CloseableHttpClient httpClient = HttpClients.createDefault();
+                WeChatInfo weChatInfo = weChatInfoDao.getWeChatInfo();
+                HttpPost httpPost = new HttpPost(SENDMESSAGEURL + weChatInfo.getAccess_token());
+                StringEntity stringEntity = new StringEntity(toString, ContentType.APPLICATION_JSON);
+                stringEntity.setContentEncoding("utf-8");
+                httpPost.setEntity(stringEntity);
+                CloseableHttpResponse response = httpClient.execute(httpPost);
+                if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
+                    result = EntityUtils.toString(response.getEntity(), "utf-8");
+                } else {
+                    return 0;
+                }
             }
         } catch (Exception ex) {
             ex.printStackTrace();
@@ -377,6 +376,7 @@ public class WeChatInfoService {
         Map<String, String> result = new HashMap<>();
         String resultToken = sendGet(JSCODE2SESSION + "?grant_type=authorization_code" + "&appid=" + MINIAPPID + "&secret=" + MINIAPPSECRET + "&js_code=" + js_code);
         Map mapToken = JSON.parseObject(resultToken);
+        System.out.println(mapToken);
         session_key = String.valueOf(mapToken.get("session_key"));
         openid = String.valueOf(mapToken.get("openid"));
         //save database

+ 53 - 29
src/main/java/com/ygj/yuemum/service/wxmini/WXContentService.java

@@ -27,38 +27,62 @@ public class WXContentService {
     public WXContent queryUserContent(String openid) {
         try {
             WXUser wxUser = wxUserService.getWXUser(openid);
-            WXContentType wxContentType = wxContentTypeService.queryWXContentType(wxUser.getXu_content_type());
-            SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
-            Date dateNow = new Date();
-            Date getDate = sdf.parse(wxUser.getXu_content_date());
-            WXContent wxContent = new WXContent();
-            int showTime = 1;
-            if(wxContentType.getWct_frequency().equals("周")) {
-                showTime = 40 - DateUtil.getWeekDiff(getDate,dateNow);
-                if (showTime >= wxContentType.getWct_step()) {
-                    wxContent.setWc_showtime(wxContentType.getWct_step());
-                    wxContent.setWc_content("宝宝出生了!");
-                    return wxContent;
-                }
+            System.out.println(wxUser);
+            if (wxUser == null ) {
+                return null;
+            } else {
+                if (wxUser.getXu_content_date() == null) {
+                    return null;
+                } else {
+                    WXContent wxContent = new WXContent();
+                    WXContent wxContentTemp = new WXContent();
+                    WXContent wxContentReturn = new WXContent();
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                    Date dateNow = new Date();
+                    Date getDate = sdf.parse(wxUser.getXu_content_date());
+                    WXContentType wxContentType = wxContentTypeService.queryWXContentType(wxUser.getXu_content_type());
+                    wxContentReturn.setWc_type(wxContentType.getWct_code());
+                    if (wxContentType.getWct_frequency().equals("周")) {
+                        //日期不对 小于当前日期
+                        System.out.println(DateUtil.getWeekDiff(dateNow, getDate));
+                        if(DateUtil.getWeekDiff(dateNow, getDate) < 0) {
+                            wxContent.setWc_showtime(wxContentType.getWct_step());
+                        } else if (DateUtil.getWeekDiff(dateNow, getDate) > wxContentType.getWct_step()) {
+                            wxContent.setWc_showtime(0);
+                        } else {
+                            wxContent.setWc_showtime(wxContentType.getWct_step() - DateUtil.getWeekDiff(dateNow, getDate));
+                        }
+                        wxContent.setWc_type(wxUser.getXu_content_type());
+                        wxContentTemp = wxContentDao.queryUserContent(wxContent);
+                        if (wxContentTemp == null) {
+                            wxContentReturn.setWct_frequency("周");
+                            wxContentReturn.setWc_showtime(wxContent.getWc_showtime());
+                        } else {
+                            wxContentReturn = wxContentTemp;
+                        }
+                        return wxContentReturn;
 
-            } else if (wxContentType.getWct_frequency().equals("月")) {
-                System.out.println(DateUtil.getMonthDiff(dateNow,getDate));
-                showTime = DateUtil.getMonthDiff(dateNow,getDate)+1;
-                if(showTime <= 0) {
-                    showTime = 1;
+                    } else if (wxContentType.getWct_frequency().equals("月")) {
+                        if(DateUtil.getMonthDiff(dateNow, getDate) + 1 < 0) {
+                            wxContent.setWc_showtime(0);
+                        } else {
+                            wxContent.setWc_showtime(DateUtil.getMonthDiff(dateNow, getDate) + 1);
+                        }
+                        wxContent.setWc_type(wxUser.getXu_content_type());
+                        wxContentTemp = wxContentDao.queryUserContent(wxContent);
+                        if (wxContentTemp == null) {
+                            wxContentReturn.setWct_frequency("月");
+                            wxContentReturn.setWc_showtime(wxContent.getWc_showtime());
+                        } else {
+                            wxContentReturn = wxContentTemp;
+                        }
+                        return wxContentReturn;
+                    } else {
+                        return null;
+                    }
                 }
-                if (showTime > wxContentType.getWct_step()) {
-                    wxContent.setWc_showtime(wxContentType.getWct_step());
-                    wxContent.setWc_content("宝宝俩岁啦!");
-                    return wxContent;
-                }
-            } else {
-                showTime = 0;
             }
-            wxContent.setWc_type(wxUser.getXu_content_type());
-            wxContent.setWc_showtime(showTime);
-            return wxContentDao.queryUserContent(wxContent);
-        }catch (Exception ex) {
+        } catch (Exception ex) {
             ex.printStackTrace();
             return null;
         }

+ 1 - 0
src/main/java/com/ygj/yuemum/shiro/ShiroConfig.java

@@ -103,6 +103,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/getWXMMSearchQuestion", "anon");
         filterChainDefinitionMap.put("/queryUserMMSearch", "anon");
         filterChainDefinitionMap.put("/getMmInfoResume", "anon");
+        filterChainDefinitionMap.put("/getPackageImagesByID", "anon");
         //萌动开放权限
         filterChainDefinitionMap.put("/getNewUserCoupon", "anon");
         filterChainDefinitionMap.put("/getConsultTaskCoupon", "anon");

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

@@ -19,7 +19,7 @@ spring:
       enabled: true
       file-size-threshold: 0
       max-file-size: 5M
-      max-request-size: 5M
+      max-request-size: 50M
   devtools:
     restart:
       enabled: true  #设置开启热部署

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

@@ -29,7 +29,7 @@
 
     <select id="selectAll" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.customer.CustomerBooking">
         select
-        id, bk_phone,bk_duedate,bk_date,bk_type,bk_desc,bk_introducer_phone,bk_introducer_consultant,bk_branches_id,
+        id, bk_phone,bk_duedate,bk_date,bk_type,bk_desc,bk_introducer_phone,bk_introducer_consultant,bk_branches_id,fgetbranches_name(bk_branches_id) bk_branches_name,
         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
@@ -55,6 +55,9 @@
         <if test="bk_duedate != null and bk_duedate != ''">
             and bk_duedate = #{bk_duedate,jdbcType=INTEGER}
         </if>
+        <if test="bk_branches_id != null and bk_branches_id != ''">
+            and bk_branches_id = #{bk_branches_id,jdbcType=INTEGER}
+        </if>
         order by 1 desc
     </select>
 

+ 353 - 361
src/main/resources/mybatis/mapper/customer/CustomerCouponMapper.xml

@@ -1,362 +1,354 @@
-<?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.customer.CustomerCouponDao" >
-
-    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.customer.CustomerCoupon" >
-        <id column="id" property="id" jdbcType="INTEGER" />
-        <result column="cm_code" property="cm_code" jdbcType="VARCHAR" />
-        <result column="cm_phone" property="cm_phone" jdbcType="VARCHAR" />
-        <result column="cb_code" property="cb_code" jdbcType="VARCHAR" />
-        <result column="cc_code" property="cc_code" jdbcType="VARCHAR" />
-        <result column="cp_status" property="cp_status" jdbcType="INTEGER" />
-        <result column="cc_getdate" property="cc_getdate" jdbcType="DATE" />
-        <result column="cc_getchannel" property="cc_getchannel" jdbcType="INTEGER" />
-        <result column="cc_usedate" property="cc_usedate" jdbcType="DATE" />
-        <result column="cc_usebillno" property="cc_usebillno" 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" />
-        <result column="cp_enddate" property="cp_enddate" jdbcType="VARCHAR" />
-        <result column="cp_amount" property="cp_amount" jdbcType="INTEGER" />
-        <result column="cc_quantity" property="cc_quantity" jdbcType="INTEGER" />
-    </resultMap>
-
-    <sql id="Base_Column_List" >
-        id, cm_code,cm_phone,cb_code,cc_code,cp_status,cc_getdate,cc_getchannel,cc_usedate,cc_usebillno
-    </sql>
-
-    <!--获取所有数据-->
-    <select id="getCount" resultType="java.lang.Integer" >
-        select
-        count(1)
-        from customer_coupon
-    </select>
-
-
-    <select id="getAll" resultMap="BaseResultMap" >
-        select
-        id, cm_code,cm_phone,cb_code,cc_code,cp_status,cc_getdate,cc_getchannel,cc_usedate,cc_usebillno
-        from customer_coupon
-        order by id desc
-    </select>
-
-
-    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
-        select
-        <include refid="Base_Column_List" />
-        from customer_coupon
-        where id = #{id,jdbcType=INTEGER}
-    </select>
-
-
-    <select id="getCouponSum" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.customer.CustomerCouponQuery"  >
-        SELECT
-        cm_phone,
-        count(1) cc_quantity,
-        sum(cp_amount) cp_amount
-        FROM
-        (
-        SELECT
-        ta.cm_phone,
-        ta.cc_code,
-        tb.cb_packages,
-        tb.cb_citys
-        FROM
-        customer_coupon ta
-        LEFT JOIN coupon_batch tb ON ta.cb_code = tb.cb_code
-        where ta.cp_status = 2
-        <if test="cm_phone != null and cm_phone != ''" >
-            and ta.cm_phone = #{cm_phone,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>
-        ) tta,
-        coupon ttb
-        WHERE
-        tta.cc_code = ttb.cp_code
-        group by tta.cm_phone
-    </select>
-
-    <select id="getCustomerCoupons" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.customer.CustomerCouponQuery"  >
-        SELECT
-        ta.cc_code,
-        tb.cb_name,
-        tb.cb_rule,
-        fgetpackages(tb.id) cb_packages,
-        fgetmoretcityname(tb.id) cb_citys,
-        tc.cp_startdate,
-        tc.cp_enddate,
-        tc.cp_amount,
-        cc_getdate,
-        ta.cp_status
-        FROM
-            customer_coupon ta
-        LEFT JOIN coupon_batch tb ON ta.cb_code = tb.cb_code
-        left JOIN coupon tc on ta.cc_code = tc.cp_code
-        where
-        1=1
-        <if test="cm_phone != null and cm_phone != ''" >
-            and ta.cm_phone = #{cm_phone,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>
-        and ta.cp_status = 2
-        order by ta.cb_code ,tc.cp_amount desc
-    </select>
-
-
-
-    <select id="getWXCustomerCoupons" resultMap="BaseResultMap" parameterType="java.lang.String"  >
-        SELECT
-        ta.cc_code,
-        tb.cb_name,
-        tb.cb_rule,
-        fgetpackages(tb.id) cb_packages,
-        fgetmoretcityname(tb.id) cb_citys,
-        DATE_FORMAT(tc.cp_startdate,'%Y.%m.%d') cp_startdate,
-        DATE_FORMAT(tc.cp_enddate,'%Y.%m.%d') cp_enddate,
-        tc.cp_amount,
-        cc_getdate,
-        ta.cp_status
-        FROM
-        customer_coupon ta
-        LEFT JOIN coupon_batch tb ON ta.cb_code = tb.cb_code
-        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>
-
-
-    <select id="getCustomerCouponsCount" resultType="java.lang.Integer"  parameterType="com.ygj.yuemum.domain.customer.CustomerCouponQuery" >
-        SELECT
-        count(1)
-        FROM
-        customer_coupon ta
-        LEFT JOIN coupon_batch tb ON ta.cb_code = tb.cb_code
-        left JOIN coupon tc on ta.cc_code = tc.cp_code
-        where
-        1=1
-        <if test="cm_phone != null and cm_phone != ''" >
-            and ta.cm_phone = #{cm_phone,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>
-        and ta.cp_status = 2
-        order by ta.cb_code ,tc.cp_amount desc
-    </select>
-
-
-    <select id="checkCustomerCoupon" resultType="java.lang.Integer" parameterType="com.ygj.yuemum.domain.customer.CustomerCoupon" >
-        SELECT
-        count(1)
-        FROM
-        customer_coupon
-        WHERE
-        1=1
-        <if test="_parameter != null" >
-            and cm_phone = #{cm_phone,jdbcType=VARCHAR}
-        </if>
-        <if test="cb_code != null" >
-            and cb_code = #{cb_code,jdbcType=VARCHAR}
-        </if>
-    </select>
-
-    <select id="checkSumCustomerCoupon" resultType="java.lang.Integer" parameterType="java.lang.String" >
-        SELECT
-        ifnull(sum(tb.cp_amount), 0)
-        FROM
-        customer_coupon ta,
-        coupon tb
-        WHERE
-        ta.cc_code = tb.cp_code
-        <if test="_parameter != null" >
-            and cm_phone = #{cm_phone,jdbcType=VARCHAR}
-        </if>
-        AND ta.cp_status = 1
-        AND tb.cc_code IN (
-        'PVP2018051297451',
-        'PVP2018051273883',
-        'PVP2018051211608',
-        'PVP2018051263016'
-        )
-
-    </select>
-
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
-        delete from customer_coupon
-        where cb_code = #{cb_code,jdbcType=VARCHAR}
-    </delete>
-
-    <!-- 插入一条培训信息 -->
-    <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.customer.CustomerCoupon" >
-        insert into customer_coupon
-        <trim prefix="(" suffix=")" suffixOverrides="," >
-            <if test="cm_code != null" >
-                cm_code,
-            </if>
-            <if test="cm_phone != null" >
-                cm_phone,
-            </if>
-            <if test="cb_code != null" >
-                cb_code,
-            </if>
-            <if test="cc_code != null" >
-                cc_code,
-            </if>
-            <if test="cp_status != null" >
-                cp_status,
-            </if>
-            <if test="cc_getdate != null" >
-                cc_getdate,
-            </if>
-            <if test="cc_getchannel != null" >
-                cc_getchannel,
-            </if>
-            <if test="cc_usedate != null" >
-                cc_usedate,
-            </if>
-            <if test="cc_usebillno != null" >
-                cc_usebillno
-            </if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides="," >
-            <if test="cm_code != null" >
-                #{cm_code,jdbcType=VARCHAR},
-            </if>
-            <if test="cm_phone != null" >
-                #{cm_phone,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_status != null" >
-                #{cp_status,jdbcType=INTEGER},
-            </if>
-            <if test="cc_getdate != null" >
-                #{cc_getdate,jdbcType=DATE},
-            </if>
-            <if test="cc_getchannel != null" >
-                #{cc_getchannel,jdbcType=INTEGER},
-            </if>
-            <if test="cc_usedate != null" >
-                #{cc_usedate,jdbcType=DATE},
-            </if>
-            <if test="cc_usebillno != null" >
-                #{cc_usebillno,jdbcType=VARCHAR}
-            </if>
-        </trim>
-    </insert>
-
-    <!-- 根据id更新一条培训信息 -->
-    <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.customer.CustomerCoupon" >
-        update customer_coupon
-        <set >
-            <if test="cm_code != null" >
-                cm_code = #{cm_code,jdbcType=VARCHAR},
-            </if>
-            <if test="cm_phone != null" >
-                cm_phone = #{cm_phone,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>
-            <if test="cb_citys != null" >
-                cb_citys = #{cb_citys,jdbcType=VARCHAR}
-            </if>
-            <if test="cb_citys != null" >
-                cb_citys = #{cb_citys,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.customer.CustomerCoupon">
-        select
-        count(1)
-        from customer_coupon
-        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.customer.CustomerCoupon">
-        select
-        id, cb_code,cb_name,cb_rule,fgetpackages(id) cb_packages,fgetmoretcityname(id) cb_citys
-        from customer_coupon
-        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>
-
-    <update id="updateCustomerUseCoupon" parameterType="com.ygj.yuemum.domain.customer.CustomerCoupon" >
-        update customer_coupon
-        <set >
-            <if test="cp_status != null" >
-                cp_status = #{cp_status,jdbcType=VARCHAR},
-            </if>
-        </set>
-        where cc_code = #{cc_code,jdbcType=INTEGER}
-    </update>
-
-
+<?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.customer.CustomerCouponDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.customer.CustomerCoupon" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="cm_code" property="cm_code" jdbcType="VARCHAR" />
+        <result column="cm_phone" property="cm_phone" jdbcType="VARCHAR" />
+        <result column="cb_code" property="cb_code" jdbcType="VARCHAR" />
+        <result column="cc_code" property="cc_code" jdbcType="VARCHAR" />
+        <result column="cp_status" property="cp_status" jdbcType="INTEGER" />
+        <result column="cc_getdate" property="cc_getdate" jdbcType="DATE" />
+        <result column="cc_getchannel" property="cc_getchannel" jdbcType="INTEGER" />
+        <result column="cc_usedate" property="cc_usedate" jdbcType="DATE" />
+        <result column="cc_usebillno" property="cc_usebillno" 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" />
+        <result column="cp_enddate" property="cp_enddate" jdbcType="DATE" />
+        <result column="cp_amount" property="cp_amount" jdbcType="INTEGER" />
+        <result column="cc_quantity" property="cc_quantity" jdbcType="INTEGER" />
+    </resultMap>
+
+    <sql id="Base_Column_List" >
+        id, cm_code,cm_phone,cb_code,cc_code,cp_status,cc_getdate,cc_getchannel,cc_usedate,cc_usebillno
+    </sql>
+
+    <!--获取所有数据-->
+    <select id="getCount" resultType="java.lang.Integer" >
+        select
+        count(1)
+        from customer_coupon
+    </select>
+
+
+    <select id="getAll" resultMap="BaseResultMap" >
+        select
+        id, cm_code,cm_phone,cb_code,cc_code,cp_status,cc_getdate,cc_getchannel,cc_usedate,cc_usebillno
+        from customer_coupon
+        order by id desc
+    </select>
+
+
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from customer_coupon
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+
+
+    <select id="getCouponSum" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.customer.CustomerCouponQuery"  >
+        SELECT
+        cm_phone,
+        count(1) cc_quantity,
+        sum(cp_amount) cp_amount
+        FROM
+        (
+        SELECT
+        ta.cm_phone,
+        ta.cc_code,
+        tb.cb_packages,
+        tb.cb_citys
+        FROM
+        customer_coupon ta
+        LEFT JOIN coupon_batch tb ON ta.cb_code = tb.cb_code
+        where ta.cp_status = 2
+        <if test="cm_phone != null and cm_phone != ''" >
+            and ta.cm_phone = #{cm_phone,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>
+        ) tta,
+        coupon ttb
+        WHERE
+        tta.cc_code = ttb.cp_code
+        group by tta.cm_phone
+    </select>
+
+    <select id="getCustomerCoupons" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.customer.CustomerCouponQuery"  >
+        SELECT
+        ta.cc_code,
+        tb.cb_name,
+        tb.cb_rule,
+        fgetpackages(tb.id) cb_packages,
+        fgetmoretcityname(tb.id) cb_citys,
+        tc.cp_startdate,
+        tc.cp_enddate,
+        tc.cp_amount,
+        cc_getdate,
+        ta.cp_status
+        FROM
+            customer_coupon ta
+        LEFT JOIN coupon_batch tb ON ta.cb_code = tb.cb_code
+        left JOIN coupon tc on ta.cc_code = tc.cp_code
+        where
+        1=1
+        <if test="cm_phone != null and cm_phone != ''" >
+            and ta.cm_phone = #{cm_phone,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>
+        and ta.cp_status = 2
+        order by ta.cb_code ,tc.cp_amount desc
+    </select>
+
+
+
+    <select id="getWXCustomerCoupons" resultMap="BaseResultMap" parameterType="java.lang.String"  >
+        SELECT
+        ta.cc_code,
+        tb.cb_name,
+        tb.cb_rule,
+        fgetpackages(tb.id) cb_packages,
+        fgetmoretcityname(tb.id) cb_citys,
+        DATE_FORMAT(tc.cp_startdate,'%Y-%m-%d') cp_startdate,
+        DATE_FORMAT(tc.cp_enddate,'%Y-%m-%d') cp_enddate,
+        tc.cp_amount,
+        cc_getdate,
+        ta.cp_status
+        FROM
+        customer_coupon ta
+        LEFT JOIN coupon_batch tb ON ta.cb_code = tb.cb_code
+        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>
+
+
+    <select id="getCustomerCouponsCount" resultType="java.lang.Integer"  parameterType="com.ygj.yuemum.domain.customer.CustomerCouponQuery" >
+        SELECT
+        count(1)
+        FROM
+        customer_coupon ta
+        LEFT JOIN coupon_batch tb ON ta.cb_code = tb.cb_code
+        left JOIN coupon tc on ta.cc_code = tc.cp_code
+        where
+        1=1
+        <if test="cm_phone != null and cm_phone != ''" >
+            and ta.cm_phone = #{cm_phone,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>
+        and ta.cp_status = 2
+        order by ta.cb_code ,tc.cp_amount desc
+    </select>
+
+
+    <select id="checkCustomerCoupon" resultType="java.lang.Integer" parameterType="com.ygj.yuemum.domain.customer.CustomerCoupon" >
+        SELECT
+        count(1)
+        FROM
+        customer_coupon
+        WHERE
+        1=1
+        <if test="_parameter != null" >
+            and cm_phone = #{cm_phone,jdbcType=VARCHAR}
+        </if>
+        <if test="cb_code != null" >
+            and cb_code = #{cb_code,jdbcType=VARCHAR}
+        </if>
+    </select>
+
+    <select id="checkSumCustomerCoupon" resultType="java.lang.Integer" parameterType="java.lang.String" >
+        SELECT
+        ifnull(sum(tb.cp_amount), 0)
+        FROM
+        customer_coupon ta,
+        coupon tb
+        WHERE
+        ta.cc_code = tb.cp_code
+        <if test="_parameter != null" >
+            and cm_phone = #{cm_phone,jdbcType=VARCHAR}
+        </if>
+        AND ta.cp_status = 1
+        AND tb.cc_code IN (
+        'PVP2018051297451',
+        'PVP2018051273883',
+        'PVP2018051211608',
+        'PVP2018051263016'
+        )
+
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+        delete from customer_coupon
+        where cb_code = #{cb_code,jdbcType=VARCHAR}
+    </delete>
+
+    <!-- 插入一条培训信息 -->
+    <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.customer.CustomerCoupon" >
+        insert into customer_coupon
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="cm_code != null" >
+                cm_code,
+            </if>
+            <if test="cm_phone != null" >
+                cm_phone,
+            </if>
+            <if test="cb_code != null" >
+                cb_code,
+            </if>
+            <if test="cc_code != null" >
+                cc_code,
+            </if>
+            <if test="cp_status != null" >
+                cp_status,
+            </if>
+            <if test="cc_getdate != null" >
+                cc_getdate,
+            </if>
+            <if test="cc_getchannel != null" >
+                cc_getchannel,
+            </if>
+            <if test="cc_usedate != null" >
+                cc_usedate,
+            </if>
+            <if test="cc_usebillno != null" >
+                cc_usebillno
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="cm_code != null" >
+                #{cm_code,jdbcType=VARCHAR},
+            </if>
+            <if test="cm_phone != null" >
+                #{cm_phone,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_status != null" >
+                #{cp_status,jdbcType=INTEGER},
+            </if>
+            <if test="cc_getdate != null" >
+                #{cc_getdate,jdbcType=DATE},
+            </if>
+            <if test="cc_getchannel != null" >
+                #{cc_getchannel,jdbcType=INTEGER},
+            </if>
+            <if test="cc_usedate != null" >
+                #{cc_usedate,jdbcType=DATE},
+            </if>
+            <if test="cc_usebillno != null" >
+                #{cc_usebillno,jdbcType=VARCHAR}
+            </if>
+        </trim>
+    </insert>
+
+    <!-- 根据id更新一条培训信息 -->
+    <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.customer.CustomerCoupon" >
+        update customer_coupon
+        <set >
+            <if test="cm_code != null" >
+                cm_code = #{cm_code,jdbcType=VARCHAR},
+            </if>
+            <if test="cm_phone != null" >
+                cm_phone = #{cm_phone,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.customer.CustomerCoupon">
+        select
+        count(1)
+        from customer_coupon
+        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.customer.CustomerCoupon">
+        select
+        id, cb_code,cb_name,cb_rule,fgetpackages(id) cb_packages,fgetmoretcityname(id) cb_citys
+        from customer_coupon
+        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>
+
+    <update id="updateCustomerUseCoupon" parameterType="com.ygj.yuemum.domain.customer.CustomerCoupon" >
+        update customer_coupon
+        <set >
+            <if test="cp_status != null" >
+                cp_status = #{cp_status,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where cc_code = #{cc_code,jdbcType=INTEGER}
+    </update>
+
+
 </mapper>

+ 22 - 0
src/main/resources/mybatis/mapper/global/PackageImagesMapper.xml

@@ -0,0 +1,22 @@
+<?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.PackageImagesDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.global.PackageImages" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="p_id" property="p_id" jdbcType="INTEGER" />
+        <result column="pi_path" property="pi_path" jdbcType="VARCHAR" />
+        <result column="pi_seq" property="pi_seq" jdbcType="INTEGER" />
+    </resultMap>
+
+    <!--获取所有数据-->
+    <select id="getPackageImagesByID" resultType="com.ygj.yuemum.domain.global.PackageImages"  parameterType="java.lang.Integer" >
+        select
+        *
+        from package_imgs
+        where p_id  = #{p_id,jdbcType=VARCHAR}
+        order by pi_seq asc
+    </select>
+
+
+</mapper>

+ 16 - 4
src/main/resources/mybatis/mapper/global/PackagesMapper.xml

@@ -26,6 +26,7 @@
         select
         p_code,p_name
         from packages
+        where p_crmCode is not null
     </select>
 
     <select id="getPackageAll" resultType="com.ygj.yuemum.domain.global.Packages" >
@@ -41,10 +42,21 @@
     </select>
 
     <select id="getPackageLists" resultType="com.ygj.yuemum.domain.global.Packages" parameterType="java.lang.String">
-        select *
-        from packages
-        where p_type = '1'
-        and p_branches = #{p_branches,jdbcType=VARCHAR}
+        SELECT
+            *
+        FROM
+            packages
+        WHERE
+            p_show = '1'
+        AND p_branches = #{p_branches,jdbcType=VARCHAR}
+
+        UNION
+        SELECT
+            *
+        FROM
+            packages
+        WHERE
+        p_branches  = 'all'
         order by p_seq asc
     </select>
 

+ 2 - 6
src/main/resources/mybatis/mapper/wxmini/WXContentMapper.xml

@@ -86,12 +86,8 @@
         wx_content
         LEFT JOIN wx_content_type ON wx_content.wc_type = wx_content_type.wct_code
         where 1=1
-        <if test="wc_type != null and wc_type != ''">
-            and wc_type = #{wc_type,jdbcType=VARCHAR}
-        </if>
-        <if test="wc_showtime != null and wc_showtime != ''">
-            and wc_showtime = #{wc_showtime,jdbcType=INTEGER}
-        </if>
+        and wc_type = #{wc_type,jdbcType=VARCHAR}
+        and wc_showtime = #{wc_showtime,jdbcType=INTEGER}
         order by id  desc limit 1
     </select>
 

+ 2 - 0
src/main/resources/mybatis/mapper/wxmini/WXMMUserSearchDetailMapper.xml

@@ -30,6 +30,8 @@
         CASE wx_mm_search_question.wsq_type
     WHEN 2 THEN
         wx_mm_search_answer.wma_desc
+    WHEN 3 THEN
+	    wx_mm_user_search_detail.wmud_value
     WHEN 1 THEN
         CONCAT(wx_mm_search_answer.wma_desc,':',wx_mm_user_search_detail.wmud_value)
     END as returnvalue

+ 8 - 4
src/main/resources/mybatis/mapper/wxmini/WXPublicMapper.xml

@@ -13,10 +13,14 @@
 
     <!--获取所有数据-->
     <select id="getWXPublics" resultType="com.ygj.yuemum.domain.wxmini.WXPublic" >
-        select
-        DISTINCT wp_openid, wp_nickname,wp_issend,fgetbranches_name(wp_issend) wp_cityname
-        from wx_public
-        order by id asc
+        SELECT DISTINCT
+          wp_openid,
+          wp_nickname,
+           wp_issend,
+          if(wp_issend = 999999,'不接收',fgetbranches_name (wp_issend)) wp_cityname
+        FROM
+            wx_public
+        ORDER BY id ASC
     </select>
 
     <update id="updateWXPublic" parameterType="com.ygj.yuemum.domain.wxmini.WXPublic" >