From ae4eceec34a02e717cab732ea2b5838dfe833f97 Mon Sep 17 00:00:00 2001 From: masterspirit Date: Wed, 8 Aug 2018 15:29:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E6=80=81=E6=B7=BB=E5=8A=A0type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/simple/domain/po/WxBusiness.java | 14 +- .../java/com/simple/domain/po/WxCoupon.java | 122 ++++++++++++------ .../resources/mapper/WxBusinessMapper.xml | 8 +- .../main/resources/mapper/WxCouponMapper.xml | 27 +++- 4 files changed, 123 insertions(+), 48 deletions(-) diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxBusiness.java b/mallinkService/src/main/java/com/simple/domain/po/WxBusiness.java index 4f223f734..7b4cf4f18 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxBusiness.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxBusiness.java @@ -47,6 +47,9 @@ public class WxBusiness implements Serializable { /*业态名**/ @io.swagger.annotations.ApiModelProperty(value="业态名",name="title") private String title; + /*1.优惠券**/ + @io.swagger.annotations.ApiModelProperty(value="1.优惠券",name="type") + private Integer type; /*创建时间**/ @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") private Date createDate; @@ -65,6 +68,12 @@ public class WxBusiness implements Serializable { public void setTitle(String _title) { title = _title; } + public Integer getType() { + return type; + } + public void setType(Integer _type) { + type = _type; + } public Date getCreateDate() { return createDate; } @@ -85,6 +94,7 @@ public class WxBusiness implements Serializable { Id_ASC("`id` ASC"),Id_DESC("`id` DESC") ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") ,Title_ASC("`title` ASC"),Title_DESC("`title` DESC") + ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") ; @@ -104,7 +114,7 @@ public class WxBusiness implements Serializable { } } - public void setSortColumns(WxBusiness.Field... fields) + public void setSortColumns(Field... fields) { if (fields == null || fields.length == 0) { return; @@ -129,7 +139,7 @@ public class WxBusiness implements Serializable { } if (sortColumns.contains(",")) { String[] cols = sortColumns.split(","); - java.util.List fList = new java.util.ArrayList(); + List fList = new ArrayList(); for (int k = 0; k < cols.length; k++) { fList.add(Field.valueOf(cols[k])); } diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java index 01680bd46..e34589201 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java @@ -11,15 +11,15 @@ import java.io.Serializable; @Table(name = "wx_coupon") public class WxCoupon implements Serializable { private static final long serialVersionUID = 1L; - + @Id - protected Long id; - - @Transient - protected List ids; - @Transient - protected String sortColumns; - + protected Long id; + + @Transient + protected List ids; + @Transient + protected String sortColumns; + public Long getId() { return id; } @@ -27,20 +27,20 @@ public class WxCoupon implements Serializable { public void setId(Long id) { this.id = id; } - + public String getSortColumns() { return sortColumns; } - + public List getIds() { return ids; } public void setIds(List ids) { this.ids = ids; } - - - + + + /*租户ID**/ @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") private String tenantId; @@ -68,6 +68,12 @@ public class WxCoupon implements Serializable { /*限领张数**/ @io.swagger.annotations.ApiModelProperty(value="限领张数",name="useLimitQuantity") private Integer useLimitQuantity; + /*投放频道位置(1.banner图,2.限时抢购)**/ + @io.swagger.annotations.ApiModelProperty(value="投放频道位置(1.banner图,2.限时抢购)",name="targetAd") + private Integer targetAd; + /*1.主动领取2.定向投放**/ + @io.swagger.annotations.ApiModelProperty(value="1.主动领取2.定向投放",name="sendType") + private Integer sendType; /*发放开始时间**/ @io.swagger.annotations.ApiModelProperty(value="发放开始时间",name="sendStartDate") private Date sendStartDate; @@ -86,7 +92,6 @@ public class WxCoupon implements Serializable { /*须知**/ @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") private String detail; - /*业态**/ @io.swagger.annotations.ApiModelProperty(value="业态",name="businesses") private String businesses; @@ -99,6 +104,9 @@ public class WxCoupon implements Serializable { /*总数**/ @io.swagger.annotations.ApiModelProperty(value="总数",name="total") private Integer total; + /***/ + @io.swagger.annotations.ApiModelProperty(value="使用须知",name="remark") + private String remark; /*状态(0:草稿,1:待生效,2:已生效,3:已失效,4:已作废)**/ @io.swagger.annotations.ApiModelProperty(value="状态(0:草稿,1:待生效,2:已生效,3:已失效,4:已作废)",name="status") private Integer status; @@ -108,6 +116,9 @@ public class WxCoupon implements Serializable { /*更新时间**/ @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") private Date updateDate; + /*业态**/ + @io.swagger.annotations.ApiModelProperty(value="业态",name="business") + private String business; public String getTenantId() { return tenantId; } @@ -162,6 +173,18 @@ public class WxCoupon implements Serializable { public void setUseLimitQuantity(Integer _useLimitQuantity) { useLimitQuantity = _useLimitQuantity; } + public Integer getTargetAd() { + return targetAd; + } + public void setTargetAd(Integer _targetAd) { + targetAd = _targetAd; + } + public Integer getSendType() { + return sendType; + } + public void setSendType(Integer _sendType) { + sendType = _sendType; + } public Date getSendStartDate() { return sendStartDate; } @@ -198,7 +221,6 @@ public class WxCoupon implements Serializable { public void setDetail(String _detail) { detail = _detail; } - public String getBusinesses() { return businesses; } @@ -223,6 +245,12 @@ public class WxCoupon implements Serializable { public void setTotal(Integer _total) { total = _total; } + public String getRemark() { + return remark; + } + public void setRemark(String _remark) { + remark = _remark; + } public Integer getStatus() { return status; } @@ -241,37 +269,45 @@ public class WxCoupon implements Serializable { public void setUpdateDate(Date _updateDate) { updateDate = _updateDate; } + public String getBusiness() { + return business; + } + public void setBusiness(String _business) { + business = _business; + } public static enum Field { Id_ASC("`id` ASC"),Id_DESC("`id` DESC") - ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") - ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") - ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") - ,CoverImg_ASC("`coverImg` ASC"),CoverImg_DESC("`coverImg` DESC") - ,Title_ASC("`title` ASC"),Title_DESC("`title` DESC") - ,SubTitle_ASC("`subTitle` ASC"),SubTitle_DESC("`subTitle` DESC") - ,SalePrice_ASC("`salePrice` ASC"),SalePrice_DESC("`salePrice` DESC") - ,UsePrice_ASC("`usePrice` ASC"),UsePrice_DESC("`usePrice` DESC") - ,UseLimitQuantity_ASC("`useLimitQuantity` ASC"),UseLimitQuantity_DESC("`useLimitQuantity` DESC") - ,SendStartDate_ASC("`sendStartDate` ASC"),SendStartDate_DESC("`sendStartDate` DESC") - ,SendEndDate_ASC("`sendEndDate` ASC"),SendEndDate_DESC("`sendEndDate` DESC") - ,ValidStartDate_ASC("`validStartDate` ASC"),ValidStartDate_DESC("`validStartDate` DESC") - ,ValidEndDate_ASC("`validEndDate` ASC"),ValidEndDate_DESC("`validEndDate` DESC") - ,ValidDays_ASC("`validDays` ASC"),ValidDays_DESC("`validDays` DESC") - ,Detail_ASC("`detail` ASC"),Detail_DESC("`detail` DESC") - ,SendType_ASC("`sendType` ASC"),SendType_DESC("`sendType` DESC") - ,TargetAd_ASC("`targetAd` ASC"),TargetAd_DESC("`targetAd` DESC") - ,Businesses_ASC("`businesses` ASC"),Businesses_DESC("`businesses` DESC") - ,Price_ASC("`price` ASC"),Price_DESC("`price` DESC") - ,Number_ASC("`number` ASC"),Number_DESC("`number` DESC") - ,Total_ASC("`total` ASC"),Total_DESC("`total` DESC") - ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") - ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") - ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") - ; + ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") + ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") + ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") + ,CoverImg_ASC("`coverImg` ASC"),CoverImg_DESC("`coverImg` DESC") + ,Title_ASC("`title` ASC"),Title_DESC("`title` DESC") + ,SubTitle_ASC("`subTitle` ASC"),SubTitle_DESC("`subTitle` DESC") + ,SalePrice_ASC("`salePrice` ASC"),SalePrice_DESC("`salePrice` DESC") + ,UsePrice_ASC("`usePrice` ASC"),UsePrice_DESC("`usePrice` DESC") + ,UseLimitQuantity_ASC("`useLimitQuantity` ASC"),UseLimitQuantity_DESC("`useLimitQuantity` DESC") + ,TargetAd_ASC("`targetAd` ASC"),TargetAd_DESC("`targetAd` DESC") + ,SendType_ASC("`sendType` ASC"),SendType_DESC("`sendType` DESC") + ,SendStartDate_ASC("`sendStartDate` ASC"),SendStartDate_DESC("`sendStartDate` DESC") + ,SendEndDate_ASC("`sendEndDate` ASC"),SendEndDate_DESC("`sendEndDate` DESC") + ,ValidStartDate_ASC("`validStartDate` ASC"),ValidStartDate_DESC("`validStartDate` DESC") + ,ValidEndDate_ASC("`validEndDate` ASC"),ValidEndDate_DESC("`validEndDate` DESC") + ,ValidDays_ASC("`validDays` ASC"),ValidDays_DESC("`validDays` DESC") + ,Detail_ASC("`detail` ASC"),Detail_DESC("`detail` DESC") + ,Businesses_ASC("`businesses` ASC"),Businesses_DESC("`businesses` DESC") + ,Price_ASC("`price` ASC"),Price_DESC("`price` DESC") + ,Number_ASC("`number` ASC"),Number_DESC("`number` DESC") + ,Total_ASC("`total` ASC"),Total_DESC("`total` DESC") + ,Remark_ASC("`remark` ASC"),Remark_DESC("`remark` DESC") + ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") + ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") + ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") + ,Business_ASC("`business` ASC"),Business_DESC("`business` DESC") + ; private String value; Field(String value){ this.value = value; @@ -287,7 +323,7 @@ public class WxCoupon implements Serializable { return this.getValue(); } } - + public void setSortColumns(WxCoupon.Field... fields) { if (fields == null || fields.length == 0) { @@ -303,9 +339,9 @@ public class WxCoupon implements Serializable { sb.append(","); sb.append(fields[k].toString()); } - + } - + public void setSortColumns(String sortColumns) { if (sortColumns == null || "".equals(sortColumns.trim())) { diff --git a/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml b/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml index 10d581658..12c2e7af7 100644 --- a/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml @@ -5,12 +5,13 @@ + - `id`,`tenant_id`,`title`,`create_date`,`update_date` + `id`,`tenant_id`,`title`,`type`,`create_date`,`update_date` @@ -31,6 +32,11 @@ + + and `type` = #{type} + + + and `create_date` = #{createDate} diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 8d5fc0941..e52ee608b 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -12,6 +12,8 @@ + + @@ -22,13 +24,15 @@ + + - `id`,`tenant_id`,`merchant_id`,`type`,`cover_img`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`send_start_date`,`send_end_date`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`send_type`,`target_ad`,`businesses`,`price`,`number`,`total`,`status`,`create_date`,`update_date` + `id`,`tenant_id`,`merchant_id`,`type`,`cover_img`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`target_ad`,`send_type`,`send_start_date`,`send_end_date`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`businesses`,`price`,`number`,`total`,`remark`,`status`,`create_date`,`update_date`,`business` @@ -84,6 +88,16 @@ + + and `target_ad` = #{targetAd} + + + + + and `send_type` = #{sendType} + + + and `send_start_date` = #{sendStartDate} @@ -113,7 +127,6 @@ and `detail` like concat('%', #{detail},'%') - and `businesses` like concat('%', #{businesses},'%') @@ -135,6 +148,11 @@ + + and `remark` like concat('%', #{remark},'%') + + + and `status` = #{status} @@ -148,6 +166,11 @@ and `update_date` = #{updateDate} + + + + and `business` like concat('%', #{business},'%') + and id in