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 010f5a16b..c8ce07284 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java @@ -11,7 +11,7 @@ import java.io.Serializable; @Table(name = "wx_coupon") public class WxCoupon implements Serializable { private static final long serialVersionUID = 1L; - + @Id protected Long id; @@ -27,11 +27,11 @@ public class WxCoupon implements Serializable { public void setId(Long id) { this.id = id; } - + public String getSortColumns() { return sortColumns; } - + public List getIds() { return ids; } @@ -39,9 +39,9 @@ public class WxCoupon implements Serializable { public void setIds(List ids) { this.ids = ids; } - - - + + + /*租户ID**/ @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") private String tenantId; @@ -282,33 +282,33 @@ public class WxCoupon implements Serializable { 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") - ,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") - ,ValidType_ASC("`validType` ASC"),ValidType_DESC("`validType` 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") - ,Price_ASC("`price` ASC"),Price_DESC("`price` DESC") - ,RemainInventory_ASC("`remainInventory` ASC"),RemainInventory_DESC("`remainInventory` DESC") - ,Inventory_ASC("`inventory` ASC"),Inventory_DESC("`inventory` 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") - ; + ,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") + ,ValidType_ASC("`validType` ASC"),ValidType_DESC("`validType` 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") + ,Price_ASC("`price` ASC"),Price_DESC("`price` DESC") + ,RemainInventory_ASC("`remainInventory` ASC"),RemainInventory_DESC("`remainInventory` DESC") + ,Inventory_ASC("`inventory` ASC"),Inventory_DESC("`inventory` 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; @@ -324,7 +324,7 @@ public class WxCoupon implements Serializable { return this.getValue(); } } - + public void setSortColumns(WxCoupon.Field... fields) { if (fields == null || fields.length == 0) { @@ -340,9 +340,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/java/com/simple/domain/po/WxCouponOrder.java b/mallinkService/src/main/java/com/simple/domain/po/WxCouponOrder.java index a30cec926..5a923c713 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxCouponOrder.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxCouponOrder.java @@ -32,17 +32,18 @@ public class WxCouponOrder implements Serializable { return sortColumns; } - public List getIds() { + public List getIds() { return ids; } - public void setIds(List ids) { + public void setIds(List ids) { this.ids = ids; } + /***/ @io.swagger.annotations.ApiModelProperty(value = "", name = "tenantId") - private Long tenantId; + private String tenantId; /*单张券ID**/ @io.swagger.annotations.ApiModelProperty(value = "单张券ID", name = "couponId") private Long couponId; @@ -56,7 +57,7 @@ public class WxCouponOrder implements Serializable { @io.swagger.annotations.ApiModelProperty(value = "用户订单ID", name = "orderId") private Long orderId; /*该订单对应券的实际过期时间**/ - @io.swagger.annotations.ApiModelProperty(value = "该订单对应券的实际过期时间", name = "expiredTime") + @io.swagger.annotations.ApiModelProperty(value = "该订单对应券的实际过期时间 ", name = "expiredTime") private Date expiredTime; /*状态:0,待使用 1,已核销 2,已过期 3,已作废 **/ @io.swagger.annotations.ApiModelProperty(value = "状态:0,待使用 1,已核销 2,已过期 3,已作废 ", name = "couponOrderStatus") @@ -69,13 +70,13 @@ public class WxCouponOrder implements Serializable { private Date updateDate; /*单券实际购买价格**/ @io.swagger.annotations.ApiModelProperty(value = "单券实际购买价格", name = "couponPrice") - private Integer couponPrice; + private Integer couponPrice; - public Long getTenantId() { + public String getTenantId() { return tenantId; } - public void setTenantId(Long _tenantId) { + public void setTenantId(String _tenantId) { tenantId = _tenantId; } @@ -143,78 +144,86 @@ public class WxCouponOrder implements Serializable { updateDate = _updateDate; } - public Integer getCouponPrice() { + public Integer getCouponPrice() { return couponPrice; } - public void setCouponPrice(Integer _couponPrice) { + public void setCouponPrice(Integer _couponPrice) { couponPrice = _couponPrice; } - - - public static enum Field - { - Id_ASC("`id` ASC"),Id_DESC("`id` DESC") - ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") - ,CouponId_ASC("`couponId` ASC"),CouponId_DESC("`couponId` DESC") - ,CUserId_ASC("`cUserId` ASC"),CUserId_DESC("`cUserId` DESC") - ,BUserId_ASC("`bUserId` ASC"),BUserId_DESC("`bUserId` DESC") - ,OrderId_ASC("`orderId` ASC"),OrderId_DESC("`orderId` DESC") - ,ExpiredTime_ASC("`expiredTime` ASC"),ExpiredTime_DESC("`expiredTime` DESC") - ,CouponOrderStatus_ASC("`couponOrderStatus` ASC"),CouponOrderStatus_DESC("`couponOrderStatus` DESC") - ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") - ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") - ,CouponPrice_ASC("`couponPrice` ASC"),CouponPrice_DESC("`couponPrice` DESC") - ; - private String value; - Field(String value){ - this.value = value; - } - public String getValue() { - return value; - } - public void setCol(String value) { - this.value = value; - } - @Override - public String toString() { - return this.getValue(); - } - } - - public void setSortColumns(WxCouponOrder.Field... fields) - { - if (fields == null || fields.length == 0) { - return; - } - for (int k = 0; k < fields.length; k++) { - if (fields[k] == null) { - return; - } - } - StringBuilder sb = new StringBuilder(fields[0].toString()); - for (int k = 1; k < fields.length; k++) { - sb.append(","); - sb.append(fields[k].toString()); - } - - } - - public void setSortColumns(String sortColumns) - { - if (sortColumns == null || "".equals(sortColumns.trim())) { - return; - } - if (sortColumns.contains(",")) { - String[] cols = sortColumns.split(","); - java.util.List fList = new java.util.ArrayList(); - for (int k = 0; k < cols.length; k++) { - fList.add(Field.valueOf(cols[k])); - } - this.setSortColumns(fList.toArray(new Field[fList.size()])); - } else { - this.setSortColumns(Field.valueOf(sortColumns)); - } - } + public static enum Field { + Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), + TenantId_ASC("`tenantId` ASC"), + TenantId_DESC("`tenantId` DESC"), + CouponId_ASC("`couponId` ASC"), + CouponId_DESC("`couponId` DESC"), + CUserId_ASC("`cUserId` ASC"), + CUserId_DESC("`cUserId` DESC"), + BUserId_ASC("`bUserId` ASC"), + BUserId_DESC("`bUserId` DESC"), + OrderId_ASC("`orderId` ASC"), + OrderId_DESC("`orderId` DESC"), + ExpiredTime_ASC("`expiredTime` ASC"), + ExpiredTime_DESC("`expiredTime` DESC"), + CouponOrderStatus_ASC("`couponOrderStatus` ASC"), + CouponOrderStatus_DESC("`couponOrderStatus` DESC"), + CreateDate_ASC("`createDate` ASC"), + CreateDate_DESC("`createDate` DESC"), + UpdateDate_ASC("`updateDate` ASC"), + UpdateDate_DESC("`updateDate` DESC"), + CouponPrice_ASC("`couponPrice` ASC"), + CouponPrice_DESC("`couponPrice` DESC"); + private String value; + + Field(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public void setCol(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.getValue(); + } + } + + public void setSortColumns(WxCouponOrder.Field... fields) { + if (fields == null || fields.length == 0) { + return; + } + for (int k = 0; k < fields.length; k++) { + if (fields[k] == null) { + return; + } + } + StringBuilder sb = new StringBuilder(fields[0].toString()); + for (int k = 1; k < fields.length; k++) { + sb.append(","); + sb.append(fields[k].toString()); + } + + } + + public void setSortColumns(String sortColumns) { + if (sortColumns == null || "".equals(sortColumns.trim())) { + return; + } + if (sortColumns.contains(",")) { + String[] cols = sortColumns.split(","); + java.util.List fList = new java.util.ArrayList(); + for (int k = 0; k < cols.length; k++) { + fList.add(Field.valueOf(cols[k])); + } + this.setSortColumns(fList.toArray(new Field[fList.size()])); + } else { + this.setSortColumns(Field.valueOf(sortColumns)); + } + } } diff --git a/mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java index 6bef8144c..a0c8168d1 100644 --- a/mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java @@ -6,7 +6,7 @@ import com.simple.domain.vo.CouponListReq; import org.apache.ibatis.annotations.Param; import com.simple.domain.po.WxCoupon; -public interface WxCouponMapper extends CommonMapper { +public interface WxCouponMapper extends CommonMapper { List findList(WxCoupon wxCoupon); diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxUserCouponServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxUserCouponServiceImpl.java index 28a8fdd7c..817f6956c 100644 --- a/mallinkService/src/main/java/com/simple/service/impl/WxUserCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/simple/service/impl/WxUserCouponServiceImpl.java @@ -3,6 +3,7 @@ import com.simple.domain.dto.WxUserCouponDto; import com.simple.domain.po.WxCoupon; import com.simple.domain.po.WxOrder; import com.simple.mapper.WxCouponMapper; +import com.simple.mapper.WxCouponOrderMapper; import com.simple.service.WxOrderService; import com.simple.service.WxUserCouponService; import org.springframework.beans.factory.annotation.Autowired; @@ -20,7 +21,7 @@ import java.util.stream.Collectors; public class WxUserCouponServiceImpl implements WxUserCouponService { @Autowired - private WxOrderService wxOrderService; + private WxCouponOrderMapper wxCouponOrderMapper; @Autowired private WxCouponMapper wxCouponMapper; diff --git a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml index c645f5ded..3d7ba0907 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml @@ -14,85 +14,85 @@ - + `id`,`tenant_id`,`coupon_id`,`c_user_id`,`b_user_id`,`order_id`,`expired_time`,`coupon_order_status`,`create_date`,`update_date`,`coupon_price` - where 1 = 1 - - - and `id` = #{id} - - - - - and `tenant_id` = #{tenantId} - - - - - and `coupon_id` = #{couponId} - - - - - and `c_user_id` = #{cUserId} - - - - - and `b_user_id` = #{bUserId} - - - - - and `order_id` = #{orderId} - - - - - and `expired_time` = #{expiredTime} - - - - - and `coupon_order_status` = #{couponOrderStatus} - - - - - and `create_date` = #{createDate} - - - - - and `update_date` = #{updateDate} - - - - - and `coupon_price` = #{couponPrice} - - + where 1 = 1 + + + and `id` = #{id} + + + + + and `tenant_id` = #{tenantId} + + + + + and `coupon_id` = #{couponId} + + + + + and `c_user_id` = #{cUserId} + + + + + and `b_user_id` = #{bUserId} + + + + + and `order_id` = #{orderId} + + + + + and `expired_time` = #{expiredTime} + + + + + and `coupon_order_status` = #{couponOrderStatus} + + + + + and `create_date` = #{createDate} + + + + + and `update_date` = #{updateDate} + + + + + and `coupon_price` = #{couponPrice} + + - and id in + and id in - #{idItem} + #{idItem} - + order by ${sortColumns} - + - - - - - - + + + + + +