From 80ffb92f7a5ede792d71dd5f758db3b1bd08fb40 Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Mon, 10 Dec 2018 19:07:37 +0800 Subject: [PATCH] =?UTF-8?q?feat[litemall-db,=20litemall-wx-api]:=20?= =?UTF-8?q?=E5=B0=8F=E5=95=86=E5=9F=8E=E5=90=8E=E7=AB=AF=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis-generator/generatorConfig.xml | 6 + .../litemall/db/dao/LitemallCouponMapper.java | 159 + .../db/dao/LitemallCouponUserMapper.java | 159 + .../litemall/db/domain/LitemallCoupon.java | 926 ++++++ .../db/domain/LitemallCouponExample.java | 2833 +++++++++++++++++ .../db/domain/LitemallCouponUser.java | 592 ++++ .../db/domain/LitemallCouponUserExample.java | 1604 ++++++++++ .../db/service/CouponAssignService.java | 50 + .../db/service/CouponVerifyService.java | 68 + .../db/service/LitemallAdminService.java | 1 - .../db/service/LitemallCouponService.java | 65 + .../db/service/LitemallCouponUserService.java | 88 + .../litemall/db/util/CouponConstant.java | 14 + .../litemall/db/util/CouponUserConstant.java | 8 + .../litemall/db/dao/LitemallCouponMapper.xml | 613 ++++ .../db/dao/LitemallCouponUserMapper.xml | 471 +++ .../linlinjava/litemall/wx/dao/CouponVo.java | 79 + .../litemall/wx/util/WxResponseCode.java | 4 + .../litemall/wx/web/WxAuthController.java | 10 + .../litemall/wx/web/WxCartController.java | 55 +- .../litemall/wx/web/WxCouponController.java | 256 ++ .../litemall/wx/web/WxHomeController.java | 6 +- .../litemall/wx/web/WxOrderController.java | 38 +- 23 files changed, 8090 insertions(+), 15 deletions(-) create mode 100644 litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallCouponMapper.java create mode 100644 litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallCouponUserMapper.java create mode 100644 litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCoupon.java create mode 100644 litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponExample.java create mode 100644 litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponUser.java create mode 100644 litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponUserExample.java create mode 100644 litemall-db/src/main/java/org/linlinjava/litemall/db/service/CouponAssignService.java create mode 100644 litemall-db/src/main/java/org/linlinjava/litemall/db/service/CouponVerifyService.java create mode 100644 litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCouponService.java create mode 100644 litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCouponUserService.java create mode 100644 litemall-db/src/main/java/org/linlinjava/litemall/db/util/CouponConstant.java create mode 100644 litemall-db/src/main/java/org/linlinjava/litemall/db/util/CouponUserConstant.java create mode 100644 litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallCouponMapper.xml create mode 100644 litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallCouponUserMapper.xml create mode 100644 litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/dao/CouponVo.java create mode 100644 litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCouponController.java diff --git a/litemall-db/mybatis-generator/generatorConfig.xml b/litemall-db/mybatis-generator/generatorConfig.xml index cc1405df..bfa13bea 100644 --- a/litemall-db/mybatis-generator/generatorConfig.xml +++ b/litemall-db/mybatis-generator/generatorConfig.xml @@ -158,5 +158,11 @@
+ + +
+ + +
\ No newline at end of file diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallCouponMapper.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallCouponMapper.java new file mode 100644 index 00000000..83785c6f --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallCouponMapper.java @@ -0,0 +1,159 @@ +package org.linlinjava.litemall.db.dao; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import org.linlinjava.litemall.db.domain.LitemallCoupon; +import org.linlinjava.litemall.db.domain.LitemallCouponExample; + +public interface LitemallCouponMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + long countByExample(LitemallCouponExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + int deleteByExample(LitemallCouponExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + int deleteByPrimaryKey(Integer id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + int insert(LitemallCoupon record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + int insertSelective(LitemallCoupon record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + LitemallCoupon selectOneByExample(LitemallCouponExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + LitemallCoupon selectOneByExampleSelective(@Param("example") LitemallCouponExample example, @Param("selective") LitemallCoupon.Column ... selective); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + List selectByExampleSelective(@Param("example") LitemallCouponExample example, @Param("selective") LitemallCoupon.Column ... selective); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + List selectByExample(LitemallCouponExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + LitemallCoupon selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") LitemallCoupon.Column ... selective); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + LitemallCoupon selectByPrimaryKey(Integer id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + LitemallCoupon selectByPrimaryKeyWithLogicalDelete(@Param("id") Integer id, @Param("andLogicalDeleted") boolean andLogicalDeleted); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") LitemallCoupon record, @Param("example") LitemallCouponExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + int updateByExample(@Param("record") LitemallCoupon record, @Param("example") LitemallCouponExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(LitemallCoupon record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + int updateByPrimaryKey(LitemallCoupon record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + int logicalDeleteByExample(@Param("example") LitemallCouponExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + int logicalDeleteByPrimaryKey(Integer id); +} \ No newline at end of file diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallCouponUserMapper.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallCouponUserMapper.java new file mode 100644 index 00000000..0fbd64d6 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallCouponUserMapper.java @@ -0,0 +1,159 @@ +package org.linlinjava.litemall.db.dao; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import org.linlinjava.litemall.db.domain.LitemallCouponUser; +import org.linlinjava.litemall.db.domain.LitemallCouponUserExample; + +public interface LitemallCouponUserMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + long countByExample(LitemallCouponUserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + int deleteByExample(LitemallCouponUserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + int deleteByPrimaryKey(Integer id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + int insert(LitemallCouponUser record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + int insertSelective(LitemallCouponUser record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + LitemallCouponUser selectOneByExample(LitemallCouponUserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + LitemallCouponUser selectOneByExampleSelective(@Param("example") LitemallCouponUserExample example, @Param("selective") LitemallCouponUser.Column ... selective); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + List selectByExampleSelective(@Param("example") LitemallCouponUserExample example, @Param("selective") LitemallCouponUser.Column ... selective); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + List selectByExample(LitemallCouponUserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + LitemallCouponUser selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") LitemallCouponUser.Column ... selective); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + LitemallCouponUser selectByPrimaryKey(Integer id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + LitemallCouponUser selectByPrimaryKeyWithLogicalDelete(@Param("id") Integer id, @Param("andLogicalDeleted") boolean andLogicalDeleted); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") LitemallCouponUser record, @Param("example") LitemallCouponUserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + int updateByExample(@Param("record") LitemallCouponUser record, @Param("example") LitemallCouponUserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(LitemallCouponUser record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + int updateByPrimaryKey(LitemallCouponUser record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + int logicalDeleteByExample(@Param("example") LitemallCouponUserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + int logicalDeleteByPrimaryKey(Integer id); +} \ No newline at end of file diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCoupon.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCoupon.java new file mode 100644 index 00000000..8836c5d7 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCoupon.java @@ -0,0 +1,926 @@ +package org.linlinjava.litemall.db.domain; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; + +public class LitemallCoupon { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public static final Boolean NOT_DELETED = false; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public static final Boolean IS_DELETED = true; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.id + * + * @mbg.generated + */ + private Integer id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.name + * + * @mbg.generated + */ + private String name; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.desc + * + * @mbg.generated + */ + private String desc; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.tag + * + * @mbg.generated + */ + private String tag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.total + * + * @mbg.generated + */ + private Integer total; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.discount + * + * @mbg.generated + */ + private BigDecimal discount; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.min + * + * @mbg.generated + */ + private BigDecimal min; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.limit + * + * @mbg.generated + */ + private Short limit; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.type + * + * @mbg.generated + */ + private Short type; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.status + * + * @mbg.generated + */ + private Short status; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.goods_type + * + * @mbg.generated + */ + private Short goodsType; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.goods_value + * + * @mbg.generated + */ + private String goodsValue; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.days + * + * @mbg.generated + */ + private Short days; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.start_time + * + * @mbg.generated + */ + private LocalDateTime startTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.end_time + * + * @mbg.generated + */ + private LocalDateTime endTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.add_time + * + * @mbg.generated + */ + private LocalDateTime addTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.update_time + * + * @mbg.generated + */ + private LocalDateTime updateTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon.deleted + * + * @mbg.generated + */ + private Boolean deleted; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.id + * + * @return the value of litemall_coupon.id + * + * @mbg.generated + */ + public Integer getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.id + * + * @param id the value for litemall_coupon.id + * + * @mbg.generated + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.name + * + * @return the value of litemall_coupon.name + * + * @mbg.generated + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.name + * + * @param name the value for litemall_coupon.name + * + * @mbg.generated + */ + public void setName(String name) { + this.name = name; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.desc + * + * @return the value of litemall_coupon.desc + * + * @mbg.generated + */ + public String getDesc() { + return desc; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.desc + * + * @param desc the value for litemall_coupon.desc + * + * @mbg.generated + */ + public void setDesc(String desc) { + this.desc = desc; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.tag + * + * @return the value of litemall_coupon.tag + * + * @mbg.generated + */ + public String getTag() { + return tag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.tag + * + * @param tag the value for litemall_coupon.tag + * + * @mbg.generated + */ + public void setTag(String tag) { + this.tag = tag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.total + * + * @return the value of litemall_coupon.total + * + * @mbg.generated + */ + public Integer getTotal() { + return total; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.total + * + * @param total the value for litemall_coupon.total + * + * @mbg.generated + */ + public void setTotal(Integer total) { + this.total = total; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.discount + * + * @return the value of litemall_coupon.discount + * + * @mbg.generated + */ + public BigDecimal getDiscount() { + return discount; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.discount + * + * @param discount the value for litemall_coupon.discount + * + * @mbg.generated + */ + public void setDiscount(BigDecimal discount) { + this.discount = discount; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.min + * + * @return the value of litemall_coupon.min + * + * @mbg.generated + */ + public BigDecimal getMin() { + return min; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.min + * + * @param min the value for litemall_coupon.min + * + * @mbg.generated + */ + public void setMin(BigDecimal min) { + this.min = min; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.limit + * + * @return the value of litemall_coupon.limit + * + * @mbg.generated + */ + public Short getLimit() { + return limit; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.limit + * + * @param limit the value for litemall_coupon.limit + * + * @mbg.generated + */ + public void setLimit(Short limit) { + this.limit = limit; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.type + * + * @return the value of litemall_coupon.type + * + * @mbg.generated + */ + public Short getType() { + return type; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.type + * + * @param type the value for litemall_coupon.type + * + * @mbg.generated + */ + public void setType(Short type) { + this.type = type; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.status + * + * @return the value of litemall_coupon.status + * + * @mbg.generated + */ + public Short getStatus() { + return status; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.status + * + * @param status the value for litemall_coupon.status + * + * @mbg.generated + */ + public void setStatus(Short status) { + this.status = status; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.goods_type + * + * @return the value of litemall_coupon.goods_type + * + * @mbg.generated + */ + public Short getGoodsType() { + return goodsType; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.goods_type + * + * @param goodsType the value for litemall_coupon.goods_type + * + * @mbg.generated + */ + public void setGoodsType(Short goodsType) { + this.goodsType = goodsType; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.goods_value + * + * @return the value of litemall_coupon.goods_value + * + * @mbg.generated + */ + public String getGoodsValue() { + return goodsValue; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.goods_value + * + * @param goodsValue the value for litemall_coupon.goods_value + * + * @mbg.generated + */ + public void setGoodsValue(String goodsValue) { + this.goodsValue = goodsValue; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.days + * + * @return the value of litemall_coupon.days + * + * @mbg.generated + */ + public Short getDays() { + return days; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.days + * + * @param days the value for litemall_coupon.days + * + * @mbg.generated + */ + public void setDays(Short days) { + this.days = days; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.start_time + * + * @return the value of litemall_coupon.start_time + * + * @mbg.generated + */ + public LocalDateTime getStartTime() { + return startTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.start_time + * + * @param startTime the value for litemall_coupon.start_time + * + * @mbg.generated + */ + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.end_time + * + * @return the value of litemall_coupon.end_time + * + * @mbg.generated + */ + public LocalDateTime getEndTime() { + return endTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.end_time + * + * @param endTime the value for litemall_coupon.end_time + * + * @mbg.generated + */ + public void setEndTime(LocalDateTime endTime) { + this.endTime = endTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.add_time + * + * @return the value of litemall_coupon.add_time + * + * @mbg.generated + */ + public LocalDateTime getAddTime() { + return addTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.add_time + * + * @param addTime the value for litemall_coupon.add_time + * + * @mbg.generated + */ + public void setAddTime(LocalDateTime addTime) { + this.addTime = addTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.update_time + * + * @return the value of litemall_coupon.update_time + * + * @mbg.generated + */ + public LocalDateTime getUpdateTime() { + return updateTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.update_time + * + * @param updateTime the value for litemall_coupon.update_time + * + * @mbg.generated + */ + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon.deleted + * + * @return the value of litemall_coupon.deleted + * + * @mbg.generated + */ + public Boolean getDeleted() { + return deleted; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon.deleted + * + * @param deleted the value for litemall_coupon.deleted + * + * @mbg.generated + */ + public void setDeleted(Boolean deleted) { + this.deleted = deleted; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", name=").append(name); + sb.append(", desc=").append(desc); + sb.append(", tag=").append(tag); + sb.append(", total=").append(total); + sb.append(", discount=").append(discount); + sb.append(", min=").append(min); + sb.append(", limit=").append(limit); + sb.append(", type=").append(type); + sb.append(", status=").append(status); + sb.append(", goodsType=").append(goodsType); + sb.append(", goodsValue=").append(goodsValue); + sb.append(", days=").append(days); + sb.append(", startTime=").append(startTime); + sb.append(", endTime=").append(endTime); + sb.append(", addTime=").append(addTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", deleted=").append(deleted); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + LitemallCoupon other = (LitemallCoupon) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getDesc() == null ? other.getDesc() == null : this.getDesc().equals(other.getDesc())) + && (this.getTag() == null ? other.getTag() == null : this.getTag().equals(other.getTag())) + && (this.getTotal() == null ? other.getTotal() == null : this.getTotal().equals(other.getTotal())) + && (this.getDiscount() == null ? other.getDiscount() == null : this.getDiscount().equals(other.getDiscount())) + && (this.getMin() == null ? other.getMin() == null : this.getMin().equals(other.getMin())) + && (this.getLimit() == null ? other.getLimit() == null : this.getLimit().equals(other.getLimit())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getGoodsType() == null ? other.getGoodsType() == null : this.getGoodsType().equals(other.getGoodsType())) + && (this.getGoodsValue() == null ? other.getGoodsValue() == null : this.getGoodsValue().equals(other.getGoodsValue())) + && (this.getDays() == null ? other.getDays() == null : this.getDays().equals(other.getDays())) + && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime())) + && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime())) + && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getDesc() == null) ? 0 : getDesc().hashCode()); + result = prime * result + ((getTag() == null) ? 0 : getTag().hashCode()); + result = prime * result + ((getTotal() == null) ? 0 : getTotal().hashCode()); + result = prime * result + ((getDiscount() == null) ? 0 : getDiscount().hashCode()); + result = prime * result + ((getMin() == null) ? 0 : getMin().hashCode()); + result = prime * result + ((getLimit() == null) ? 0 : getLimit().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getGoodsType() == null) ? 0 : getGoodsType().hashCode()); + result = prime * result + ((getGoodsValue() == null) ? 0 : getGoodsValue().hashCode()); + result = prime * result + ((getDays() == null) ? 0 : getDays().hashCode()); + result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); + result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); + result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode()); + return result; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public void andLogicalDeleted(boolean deleted) { + setDeleted(deleted ? IS_DELETED : NOT_DELETED); + } + + /** + * This enum was generated by MyBatis Generator. + * This enum corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public enum Column { + id("id", "id", "INTEGER", false), + name("name", "name", "VARCHAR", true), + desc("desc", "desc", "VARCHAR", true), + tag("tag", "tag", "VARCHAR", false), + total("total", "total", "INTEGER", false), + discount("discount", "discount", "DECIMAL", false), + min("min", "min", "DECIMAL", true), + limit("limit", "limit", "SMALLINT", true), + type("type", "type", "SMALLINT", true), + status("status", "status", "SMALLINT", true), + goodsType("goods_type", "goodsType", "SMALLINT", false), + goodsValue("goods_value", "goodsValue", "VARCHAR", false), + days("days", "days", "SMALLINT", true), + startTime("start_time", "startTime", "TIMESTAMP", false), + endTime("end_time", "endTime", "TIMESTAMP", false), + addTime("add_time", "addTime", "TIMESTAMP", false), + updateTime("update_time", "updateTime", "TIMESTAMP", false), + deleted("deleted", "deleted", "BIT", false); + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private static final String BEGINNING_DELIMITER = "`"; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private static final String ENDING_DELIMITER = "`"; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private final String column; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private final boolean isColumnNameDelimited; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private final String javaProperty; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private final String jdbcType; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String value() { + return this.column; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String getValue() { + return this.column; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String getJavaProperty() { + return this.javaProperty; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String getJdbcType() { + return this.jdbcType; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + } +} \ No newline at end of file diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponExample.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponExample.java new file mode 100644 index 00000000..ed8a48e9 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponExample.java @@ -0,0 +1,2833 @@ +package org.linlinjava.litemall.db.domain; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +public class LitemallCouponExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + public LitemallCouponExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public LitemallCouponExample orderBy(String orderByClause) { + this.setOrderByClause(orderByClause); + return this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public LitemallCouponExample orderBy(String ... orderByClauses) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < orderByClauses.length; i++) { + sb.append(orderByClauses[i]); + if (i < orderByClauses.length - 1) { + sb.append(" , "); + } + } + this.setOrderByClause(sb.toString()); + return this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(this); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public static Criteria newAndCreateCriteria() { + LitemallCouponExample example = new LitemallCouponExample(); + return example.createCriteria(); + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andNameEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`name` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andNameNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`name` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andNameGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`name` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andNameGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`name` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andNameLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`name` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andNameLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`name` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andDescIsNull() { + addCriterion("`desc` is null"); + return (Criteria) this; + } + + public Criteria andDescIsNotNull() { + addCriterion("`desc` is not null"); + return (Criteria) this; + } + + public Criteria andDescEqualTo(String value) { + addCriterion("`desc` =", value, "desc"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDescEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`desc` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDescNotEqualTo(String value) { + addCriterion("`desc` <>", value, "desc"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDescNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`desc` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDescGreaterThan(String value) { + addCriterion("`desc` >", value, "desc"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDescGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`desc` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDescGreaterThanOrEqualTo(String value) { + addCriterion("`desc` >=", value, "desc"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDescGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`desc` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDescLessThan(String value) { + addCriterion("`desc` <", value, "desc"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDescLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`desc` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDescLessThanOrEqualTo(String value) { + addCriterion("`desc` <=", value, "desc"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDescLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`desc` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDescLike(String value) { + addCriterion("`desc` like", value, "desc"); + return (Criteria) this; + } + + public Criteria andDescNotLike(String value) { + addCriterion("`desc` not like", value, "desc"); + return (Criteria) this; + } + + public Criteria andDescIn(List values) { + addCriterion("`desc` in", values, "desc"); + return (Criteria) this; + } + + public Criteria andDescNotIn(List values) { + addCriterion("`desc` not in", values, "desc"); + return (Criteria) this; + } + + public Criteria andDescBetween(String value1, String value2) { + addCriterion("`desc` between", value1, value2, "desc"); + return (Criteria) this; + } + + public Criteria andDescNotBetween(String value1, String value2) { + addCriterion("`desc` not between", value1, value2, "desc"); + return (Criteria) this; + } + + public Criteria andTagIsNull() { + addCriterion("tag is null"); + return (Criteria) this; + } + + public Criteria andTagIsNotNull() { + addCriterion("tag is not null"); + return (Criteria) this; + } + + public Criteria andTagEqualTo(String value) { + addCriterion("tag =", value, "tag"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTagEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("tag = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTagNotEqualTo(String value) { + addCriterion("tag <>", value, "tag"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTagNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("tag <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTagGreaterThan(String value) { + addCriterion("tag >", value, "tag"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTagGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("tag > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTagGreaterThanOrEqualTo(String value) { + addCriterion("tag >=", value, "tag"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTagGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("tag >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTagLessThan(String value) { + addCriterion("tag <", value, "tag"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTagLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("tag < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTagLessThanOrEqualTo(String value) { + addCriterion("tag <=", value, "tag"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTagLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("tag <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTagLike(String value) { + addCriterion("tag like", value, "tag"); + return (Criteria) this; + } + + public Criteria andTagNotLike(String value) { + addCriterion("tag not like", value, "tag"); + return (Criteria) this; + } + + public Criteria andTagIn(List values) { + addCriterion("tag in", values, "tag"); + return (Criteria) this; + } + + public Criteria andTagNotIn(List values) { + addCriterion("tag not in", values, "tag"); + return (Criteria) this; + } + + public Criteria andTagBetween(String value1, String value2) { + addCriterion("tag between", value1, value2, "tag"); + return (Criteria) this; + } + + public Criteria andTagNotBetween(String value1, String value2) { + addCriterion("tag not between", value1, value2, "tag"); + return (Criteria) this; + } + + public Criteria andTotalIsNull() { + addCriterion("total is null"); + return (Criteria) this; + } + + public Criteria andTotalIsNotNull() { + addCriterion("total is not null"); + return (Criteria) this; + } + + public Criteria andTotalEqualTo(Integer value) { + addCriterion("total =", value, "total"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTotalEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("total = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTotalNotEqualTo(Integer value) { + addCriterion("total <>", value, "total"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTotalNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("total <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTotalGreaterThan(Integer value) { + addCriterion("total >", value, "total"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTotalGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("total > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTotalGreaterThanOrEqualTo(Integer value) { + addCriterion("total >=", value, "total"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTotalGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("total >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTotalLessThan(Integer value) { + addCriterion("total <", value, "total"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTotalLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("total < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTotalLessThanOrEqualTo(Integer value) { + addCriterion("total <=", value, "total"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTotalLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("total <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTotalIn(List values) { + addCriterion("total in", values, "total"); + return (Criteria) this; + } + + public Criteria andTotalNotIn(List values) { + addCriterion("total not in", values, "total"); + return (Criteria) this; + } + + public Criteria andTotalBetween(Integer value1, Integer value2) { + addCriterion("total between", value1, value2, "total"); + return (Criteria) this; + } + + public Criteria andTotalNotBetween(Integer value1, Integer value2) { + addCriterion("total not between", value1, value2, "total"); + return (Criteria) this; + } + + public Criteria andDiscountIsNull() { + addCriterion("discount is null"); + return (Criteria) this; + } + + public Criteria andDiscountIsNotNull() { + addCriterion("discount is not null"); + return (Criteria) this; + } + + public Criteria andDiscountEqualTo(BigDecimal value) { + addCriterion("discount =", value, "discount"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDiscountEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("discount = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDiscountNotEqualTo(BigDecimal value) { + addCriterion("discount <>", value, "discount"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDiscountNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("discount <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDiscountGreaterThan(BigDecimal value) { + addCriterion("discount >", value, "discount"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDiscountGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("discount > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDiscountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount >=", value, "discount"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDiscountGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("discount >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDiscountLessThan(BigDecimal value) { + addCriterion("discount <", value, "discount"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDiscountLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("discount < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDiscountLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount <=", value, "discount"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDiscountLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("discount <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDiscountIn(List values) { + addCriterion("discount in", values, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountNotIn(List values) { + addCriterion("discount not in", values, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount between", value1, value2, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount not between", value1, value2, "discount"); + return (Criteria) this; + } + + public Criteria andMinIsNull() { + addCriterion("`min` is null"); + return (Criteria) this; + } + + public Criteria andMinIsNotNull() { + addCriterion("`min` is not null"); + return (Criteria) this; + } + + public Criteria andMinEqualTo(BigDecimal value) { + addCriterion("`min` =", value, "min"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andMinEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`min` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andMinNotEqualTo(BigDecimal value) { + addCriterion("`min` <>", value, "min"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andMinNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`min` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andMinGreaterThan(BigDecimal value) { + addCriterion("`min` >", value, "min"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andMinGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`min` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andMinGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("`min` >=", value, "min"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andMinGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`min` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andMinLessThan(BigDecimal value) { + addCriterion("`min` <", value, "min"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andMinLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`min` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andMinLessThanOrEqualTo(BigDecimal value) { + addCriterion("`min` <=", value, "min"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andMinLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`min` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andMinIn(List values) { + addCriterion("`min` in", values, "min"); + return (Criteria) this; + } + + public Criteria andMinNotIn(List values) { + addCriterion("`min` not in", values, "min"); + return (Criteria) this; + } + + public Criteria andMinBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("`min` between", value1, value2, "min"); + return (Criteria) this; + } + + public Criteria andMinNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("`min` not between", value1, value2, "min"); + return (Criteria) this; + } + + public Criteria andLimitIsNull() { + addCriterion("`limit` is null"); + return (Criteria) this; + } + + public Criteria andLimitIsNotNull() { + addCriterion("`limit` is not null"); + return (Criteria) this; + } + + public Criteria andLimitEqualTo(Short value) { + addCriterion("`limit` =", value, "limit"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andLimitEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`limit` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andLimitNotEqualTo(Short value) { + addCriterion("`limit` <>", value, "limit"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andLimitNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`limit` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andLimitGreaterThan(Short value) { + addCriterion("`limit` >", value, "limit"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andLimitGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`limit` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andLimitGreaterThanOrEqualTo(Short value) { + addCriterion("`limit` >=", value, "limit"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andLimitGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`limit` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andLimitLessThan(Short value) { + addCriterion("`limit` <", value, "limit"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andLimitLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`limit` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andLimitLessThanOrEqualTo(Short value) { + addCriterion("`limit` <=", value, "limit"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andLimitLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`limit` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andLimitIn(List values) { + addCriterion("`limit` in", values, "limit"); + return (Criteria) this; + } + + public Criteria andLimitNotIn(List values) { + addCriterion("`limit` not in", values, "limit"); + return (Criteria) this; + } + + public Criteria andLimitBetween(Short value1, Short value2) { + addCriterion("`limit` between", value1, value2, "limit"); + return (Criteria) this; + } + + public Criteria andLimitNotBetween(Short value1, Short value2) { + addCriterion("`limit` not between", value1, value2, "limit"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Short value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTypeEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`type` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Short value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTypeNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`type` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Short value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTypeGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`type` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Short value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTypeGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`type` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Short value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTypeLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`type` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Short value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTypeLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`type` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Short value1, Short value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Short value1, Short value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Short value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`status` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Short value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`status` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Short value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`status` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Short value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`status` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Short value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`status` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Short value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`status` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Short value1, Short value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Short value1, Short value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andGoodsTypeIsNull() { + addCriterion("goods_type is null"); + return (Criteria) this; + } + + public Criteria andGoodsTypeIsNotNull() { + addCriterion("goods_type is not null"); + return (Criteria) this; + } + + public Criteria andGoodsTypeEqualTo(Short value) { + addCriterion("goods_type =", value, "goodsType"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andGoodsTypeEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("goods_type = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andGoodsTypeNotEqualTo(Short value) { + addCriterion("goods_type <>", value, "goodsType"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andGoodsTypeNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("goods_type <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andGoodsTypeGreaterThan(Short value) { + addCriterion("goods_type >", value, "goodsType"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andGoodsTypeGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("goods_type > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andGoodsTypeGreaterThanOrEqualTo(Short value) { + addCriterion("goods_type >=", value, "goodsType"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andGoodsTypeGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("goods_type >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andGoodsTypeLessThan(Short value) { + addCriterion("goods_type <", value, "goodsType"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andGoodsTypeLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("goods_type < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andGoodsTypeLessThanOrEqualTo(Short value) { + addCriterion("goods_type <=", value, "goodsType"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andGoodsTypeLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("goods_type <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andGoodsTypeIn(List values) { + addCriterion("goods_type in", values, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeNotIn(List values) { + addCriterion("goods_type not in", values, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeBetween(Short value1, Short value2) { + addCriterion("goods_type between", value1, value2, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsTypeNotBetween(Short value1, Short value2) { + addCriterion("goods_type not between", value1, value2, "goodsType"); + return (Criteria) this; + } + + public Criteria andGoodsValueIsNull() { + addCriterion("goods_value is null"); + return (Criteria) this; + } + + public Criteria andGoodsValueIsNotNull() { + addCriterion("goods_value is not null"); + return (Criteria) this; + } + + public Criteria andGoodsValueEqualTo(String value) { + addCriterion("goods_value =", value, "goodsValue"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andGoodsValueEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("goods_value = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andGoodsValueNotEqualTo(String value) { + addCriterion("goods_value <>", value, "goodsValue"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andGoodsValueNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("goods_value <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andGoodsValueGreaterThan(String value) { + addCriterion("goods_value >", value, "goodsValue"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andGoodsValueGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("goods_value > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andGoodsValueGreaterThanOrEqualTo(String value) { + addCriterion("goods_value >=", value, "goodsValue"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andGoodsValueGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("goods_value >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andGoodsValueLessThan(String value) { + addCriterion("goods_value <", value, "goodsValue"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andGoodsValueLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("goods_value < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andGoodsValueLessThanOrEqualTo(String value) { + addCriterion("goods_value <=", value, "goodsValue"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andGoodsValueLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("goods_value <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andGoodsValueLike(String value) { + addCriterion("goods_value like", value, "goodsValue"); + return (Criteria) this; + } + + public Criteria andGoodsValueNotLike(String value) { + addCriterion("goods_value not like", value, "goodsValue"); + return (Criteria) this; + } + + public Criteria andGoodsValueIn(List values) { + addCriterion("goods_value in", values, "goodsValue"); + return (Criteria) this; + } + + public Criteria andGoodsValueNotIn(List values) { + addCriterion("goods_value not in", values, "goodsValue"); + return (Criteria) this; + } + + public Criteria andGoodsValueBetween(String value1, String value2) { + addCriterion("goods_value between", value1, value2, "goodsValue"); + return (Criteria) this; + } + + public Criteria andGoodsValueNotBetween(String value1, String value2) { + addCriterion("goods_value not between", value1, value2, "goodsValue"); + return (Criteria) this; + } + + public Criteria andDaysIsNull() { + addCriterion("`days` is null"); + return (Criteria) this; + } + + public Criteria andDaysIsNotNull() { + addCriterion("`days` is not null"); + return (Criteria) this; + } + + public Criteria andDaysEqualTo(Short value) { + addCriterion("`days` =", value, "days"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDaysEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`days` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDaysNotEqualTo(Short value) { + addCriterion("`days` <>", value, "days"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDaysNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`days` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDaysGreaterThan(Short value) { + addCriterion("`days` >", value, "days"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDaysGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`days` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDaysGreaterThanOrEqualTo(Short value) { + addCriterion("`days` >=", value, "days"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDaysGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`days` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDaysLessThan(Short value) { + addCriterion("`days` <", value, "days"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDaysLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`days` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDaysLessThanOrEqualTo(Short value) { + addCriterion("`days` <=", value, "days"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDaysLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("`days` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDaysIn(List values) { + addCriterion("`days` in", values, "days"); + return (Criteria) this; + } + + public Criteria andDaysNotIn(List values) { + addCriterion("`days` not in", values, "days"); + return (Criteria) this; + } + + public Criteria andDaysBetween(Short value1, Short value2) { + addCriterion("`days` between", value1, value2, "days"); + return (Criteria) this; + } + + public Criteria andDaysNotBetween(Short value1, Short value2) { + addCriterion("`days` not between", value1, value2, "days"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(LocalDateTime value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStartTimeEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("start_time = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(LocalDateTime value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStartTimeNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("start_time <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(LocalDateTime value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStartTimeGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("start_time > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStartTimeGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("start_time >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(LocalDateTime value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStartTimeLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("start_time < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStartTimeLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("start_time <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNull() { + addCriterion("end_time is null"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNotNull() { + addCriterion("end_time is not null"); + return (Criteria) this; + } + + public Criteria andEndTimeEqualTo(LocalDateTime value) { + addCriterion("end_time =", value, "endTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andEndTimeEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("end_time = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andEndTimeNotEqualTo(LocalDateTime value) { + addCriterion("end_time <>", value, "endTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andEndTimeNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("end_time <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThan(LocalDateTime value) { + addCriterion("end_time >", value, "endTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andEndTimeGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("end_time > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("end_time >=", value, "endTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andEndTimeGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("end_time >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andEndTimeLessThan(LocalDateTime value) { + addCriterion("end_time <", value, "endTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andEndTimeLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("end_time < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andEndTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("end_time <=", value, "endTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andEndTimeLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("end_time <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andEndTimeIn(List values) { + addCriterion("end_time in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotIn(List values) { + addCriterion("end_time not in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("end_time between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("end_time not between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andAddTimeIsNull() { + addCriterion("add_time is null"); + return (Criteria) this; + } + + public Criteria andAddTimeIsNotNull() { + addCriterion("add_time is not null"); + return (Criteria) this; + } + + public Criteria andAddTimeEqualTo(LocalDateTime value) { + addCriterion("add_time =", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("add_time = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeNotEqualTo(LocalDateTime value) { + addCriterion("add_time <>", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("add_time <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeGreaterThan(LocalDateTime value) { + addCriterion("add_time >", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("add_time > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("add_time >=", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("add_time >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeLessThan(LocalDateTime value) { + addCriterion("add_time <", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("add_time < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("add_time <=", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("add_time <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeIn(List values) { + addCriterion("add_time in", values, "addTime"); + return (Criteria) this; + } + + public Criteria andAddTimeNotIn(List values) { + addCriterion("add_time not in", values, "addTime"); + return (Criteria) this; + } + + public Criteria andAddTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("add_time between", value1, value2, "addTime"); + return (Criteria) this; + } + + public Criteria andAddTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("add_time not between", value1, value2, "addTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(LocalDateTime value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("update_time = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(LocalDateTime value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("update_time <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(LocalDateTime value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("update_time > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("update_time >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(LocalDateTime value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("update_time < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("update_time <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andDeletedIsNull() { + addCriterion("deleted is null"); + return (Criteria) this; + } + + public Criteria andDeletedIsNotNull() { + addCriterion("deleted is not null"); + return (Criteria) this; + } + + public Criteria andDeletedEqualTo(Boolean value) { + addCriterion("deleted =", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("deleted = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedNotEqualTo(Boolean value) { + addCriterion("deleted <>", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedNotEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("deleted <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedGreaterThan(Boolean value) { + addCriterion("deleted >", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedGreaterThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("deleted > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedGreaterThanOrEqualTo(Boolean value) { + addCriterion("deleted >=", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedGreaterThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("deleted >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedLessThan(Boolean value) { + addCriterion("deleted <", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedLessThanColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("deleted < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedLessThanOrEqualTo(Boolean value) { + addCriterion("deleted <=", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedLessThanOrEqualToColumn(LitemallCoupon.Column column) { + addCriterion(new StringBuilder("deleted <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedIn(List values) { + addCriterion("deleted in", values, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotIn(List values) { + addCriterion("deleted not in", values, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedBetween(Boolean value1, Boolean value2) { + addCriterion("deleted between", value1, value2, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotBetween(Boolean value1, Boolean value2) { + addCriterion("deleted not between", value1, value2, "deleted"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table litemall_coupon + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private LitemallCouponExample example; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + protected Criteria(LitemallCouponExample example) { + super(); + this.example = example; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public LitemallCouponExample example() { + return this.example; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIf(boolean ifAdd, ICriteriaAdd add) { + if (ifAdd) { + add.add(this); + } + return this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andLogicalDeleted(boolean deleted) { + return deleted ? andDeletedEqualTo(LitemallCoupon.IS_DELETED) : andDeletedNotEqualTo(LitemallCoupon.IS_DELETED); + } + + /** + * This interface was generated by MyBatis Generator. + * This interface corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public interface ICriteriaAdd { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + Criteria add(Criteria add); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table litemall_coupon + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponUser.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponUser.java new file mode 100644 index 00000000..5fb0d076 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponUser.java @@ -0,0 +1,592 @@ +package org.linlinjava.litemall.db.domain; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; + +public class LitemallCouponUser { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public static final Boolean NOT_DELETED = false; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public static final Boolean IS_DELETED = true; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon_user.id + * + * @mbg.generated + */ + private Integer id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon_user.user_id + * + * @mbg.generated + */ + private Integer userId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon_user.coupon_id + * + * @mbg.generated + */ + private Integer couponId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon_user.status + * + * @mbg.generated + */ + private Short status; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon_user.used_time + * + * @mbg.generated + */ + private LocalDateTime usedTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon_user.order_id + * + * @mbg.generated + */ + private Integer orderId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon_user.add_time + * + * @mbg.generated + */ + private LocalDateTime addTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon_user.update_time + * + * @mbg.generated + */ + private LocalDateTime updateTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_coupon_user.deleted + * + * @mbg.generated + */ + private Boolean deleted; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon_user.id + * + * @return the value of litemall_coupon_user.id + * + * @mbg.generated + */ + public Integer getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon_user.id + * + * @param id the value for litemall_coupon_user.id + * + * @mbg.generated + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon_user.user_id + * + * @return the value of litemall_coupon_user.user_id + * + * @mbg.generated + */ + public Integer getUserId() { + return userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon_user.user_id + * + * @param userId the value for litemall_coupon_user.user_id + * + * @mbg.generated + */ + public void setUserId(Integer userId) { + this.userId = userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon_user.coupon_id + * + * @return the value of litemall_coupon_user.coupon_id + * + * @mbg.generated + */ + public Integer getCouponId() { + return couponId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon_user.coupon_id + * + * @param couponId the value for litemall_coupon_user.coupon_id + * + * @mbg.generated + */ + public void setCouponId(Integer couponId) { + this.couponId = couponId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon_user.status + * + * @return the value of litemall_coupon_user.status + * + * @mbg.generated + */ + public Short getStatus() { + return status; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon_user.status + * + * @param status the value for litemall_coupon_user.status + * + * @mbg.generated + */ + public void setStatus(Short status) { + this.status = status; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon_user.used_time + * + * @return the value of litemall_coupon_user.used_time + * + * @mbg.generated + */ + public LocalDateTime getUsedTime() { + return usedTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon_user.used_time + * + * @param usedTime the value for litemall_coupon_user.used_time + * + * @mbg.generated + */ + public void setUsedTime(LocalDateTime usedTime) { + this.usedTime = usedTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon_user.order_id + * + * @return the value of litemall_coupon_user.order_id + * + * @mbg.generated + */ + public Integer getOrderId() { + return orderId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon_user.order_id + * + * @param orderId the value for litemall_coupon_user.order_id + * + * @mbg.generated + */ + public void setOrderId(Integer orderId) { + this.orderId = orderId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon_user.add_time + * + * @return the value of litemall_coupon_user.add_time + * + * @mbg.generated + */ + public LocalDateTime getAddTime() { + return addTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon_user.add_time + * + * @param addTime the value for litemall_coupon_user.add_time + * + * @mbg.generated + */ + public void setAddTime(LocalDateTime addTime) { + this.addTime = addTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon_user.update_time + * + * @return the value of litemall_coupon_user.update_time + * + * @mbg.generated + */ + public LocalDateTime getUpdateTime() { + return updateTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon_user.update_time + * + * @param updateTime the value for litemall_coupon_user.update_time + * + * @mbg.generated + */ + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_coupon_user.deleted + * + * @return the value of litemall_coupon_user.deleted + * + * @mbg.generated + */ + public Boolean getDeleted() { + return deleted; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_coupon_user.deleted + * + * @param deleted the value for litemall_coupon_user.deleted + * + * @mbg.generated + */ + public void setDeleted(Boolean deleted) { + this.deleted = deleted; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", userId=").append(userId); + sb.append(", couponId=").append(couponId); + sb.append(", status=").append(status); + sb.append(", usedTime=").append(usedTime); + sb.append(", orderId=").append(orderId); + sb.append(", addTime=").append(addTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", deleted=").append(deleted); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + LitemallCouponUser other = (LitemallCouponUser) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) + && (this.getCouponId() == null ? other.getCouponId() == null : this.getCouponId().equals(other.getCouponId())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getUsedTime() == null ? other.getUsedTime() == null : this.getUsedTime().equals(other.getUsedTime())) + && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId())) + && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getUsedTime() == null) ? 0 : getUsedTime().hashCode()); + result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode()); + result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode()); + return result; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public void andLogicalDeleted(boolean deleted) { + setDeleted(deleted ? IS_DELETED : NOT_DELETED); + } + + /** + * This enum was generated by MyBatis Generator. + * This enum corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public enum Column { + id("id", "id", "INTEGER", false), + userId("user_id", "userId", "INTEGER", false), + couponId("coupon_id", "couponId", "INTEGER", false), + status("status", "status", "SMALLINT", true), + usedTime("used_time", "usedTime", "TIMESTAMP", false), + orderId("order_id", "orderId", "INTEGER", false), + addTime("add_time", "addTime", "TIMESTAMP", false), + updateTime("update_time", "updateTime", "TIMESTAMP", false), + deleted("deleted", "deleted", "BIT", false); + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private static final String BEGINNING_DELIMITER = "`"; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private static final String ENDING_DELIMITER = "`"; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private final String column; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private final boolean isColumnNameDelimited; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private final String javaProperty; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private final String jdbcType; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String value() { + return this.column; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String getValue() { + return this.column; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String getJavaProperty() { + return this.javaProperty; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String getJdbcType() { + return this.jdbcType; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + } +} \ No newline at end of file diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponUserExample.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponUserExample.java new file mode 100644 index 00000000..760e3ea1 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponUserExample.java @@ -0,0 +1,1604 @@ +package org.linlinjava.litemall.db.domain; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +public class LitemallCouponUserExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + public LitemallCouponUserExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public LitemallCouponUserExample orderBy(String orderByClause) { + this.setOrderByClause(orderByClause); + return this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public LitemallCouponUserExample orderBy(String ... orderByClauses) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < orderByClauses.length; i++) { + sb.append(orderByClauses[i]); + if (i < orderByClauses.length - 1) { + sb.append(" , "); + } + } + this.setOrderByClause(sb.toString()); + return this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(this); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public static Criteria newAndCreateCriteria() { + LitemallCouponUserExample example = new LitemallCouponUserExample(); + return example.createCriteria(); + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdNotEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdGreaterThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdGreaterThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdLessThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdLessThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Integer value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUserIdEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("user_id = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUserIdNotEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("user_id <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Integer value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUserIdGreaterThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("user_id > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUserIdGreaterThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("user_id >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Integer value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUserIdLessThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("user_id < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUserIdLessThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("user_id <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andCouponIdIsNull() { + addCriterion("coupon_id is null"); + return (Criteria) this; + } + + public Criteria andCouponIdIsNotNull() { + addCriterion("coupon_id is not null"); + return (Criteria) this; + } + + public Criteria andCouponIdEqualTo(Integer value) { + addCriterion("coupon_id =", value, "couponId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andCouponIdEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("coupon_id = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCouponIdNotEqualTo(Integer value) { + addCriterion("coupon_id <>", value, "couponId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andCouponIdNotEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("coupon_id <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCouponIdGreaterThan(Integer value) { + addCriterion("coupon_id >", value, "couponId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andCouponIdGreaterThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("coupon_id > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCouponIdGreaterThanOrEqualTo(Integer value) { + addCriterion("coupon_id >=", value, "couponId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andCouponIdGreaterThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("coupon_id >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCouponIdLessThan(Integer value) { + addCriterion("coupon_id <", value, "couponId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andCouponIdLessThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("coupon_id < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCouponIdLessThanOrEqualTo(Integer value) { + addCriterion("coupon_id <=", value, "couponId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andCouponIdLessThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("coupon_id <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCouponIdIn(List values) { + addCriterion("coupon_id in", values, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponIdNotIn(List values) { + addCriterion("coupon_id not in", values, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponIdBetween(Integer value1, Integer value2) { + addCriterion("coupon_id between", value1, value2, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponIdNotBetween(Integer value1, Integer value2) { + addCriterion("coupon_id not between", value1, value2, "couponId"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Short value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("`status` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Short value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusNotEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("`status` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Short value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusGreaterThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("`status` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Short value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusGreaterThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("`status` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Short value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusLessThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("`status` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Short value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusLessThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("`status` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Short value1, Short value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Short value1, Short value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andUsedTimeIsNull() { + addCriterion("used_time is null"); + return (Criteria) this; + } + + public Criteria andUsedTimeIsNotNull() { + addCriterion("used_time is not null"); + return (Criteria) this; + } + + public Criteria andUsedTimeEqualTo(LocalDateTime value) { + addCriterion("used_time =", value, "usedTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUsedTimeEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("used_time = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUsedTimeNotEqualTo(LocalDateTime value) { + addCriterion("used_time <>", value, "usedTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUsedTimeNotEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("used_time <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUsedTimeGreaterThan(LocalDateTime value) { + addCriterion("used_time >", value, "usedTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUsedTimeGreaterThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("used_time > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUsedTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("used_time >=", value, "usedTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUsedTimeGreaterThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("used_time >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUsedTimeLessThan(LocalDateTime value) { + addCriterion("used_time <", value, "usedTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUsedTimeLessThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("used_time < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUsedTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("used_time <=", value, "usedTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUsedTimeLessThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("used_time <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUsedTimeIn(List values) { + addCriterion("used_time in", values, "usedTime"); + return (Criteria) this; + } + + public Criteria andUsedTimeNotIn(List values) { + addCriterion("used_time not in", values, "usedTime"); + return (Criteria) this; + } + + public Criteria andUsedTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("used_time between", value1, value2, "usedTime"); + return (Criteria) this; + } + + public Criteria andUsedTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("used_time not between", value1, value2, "usedTime"); + return (Criteria) this; + } + + public Criteria andOrderIdIsNull() { + addCriterion("order_id is null"); + return (Criteria) this; + } + + public Criteria andOrderIdIsNotNull() { + addCriterion("order_id is not null"); + return (Criteria) this; + } + + public Criteria andOrderIdEqualTo(Integer value) { + addCriterion("order_id =", value, "orderId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andOrderIdEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("order_id = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andOrderIdNotEqualTo(Integer value) { + addCriterion("order_id <>", value, "orderId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andOrderIdNotEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("order_id <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andOrderIdGreaterThan(Integer value) { + addCriterion("order_id >", value, "orderId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andOrderIdGreaterThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("order_id > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andOrderIdGreaterThanOrEqualTo(Integer value) { + addCriterion("order_id >=", value, "orderId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andOrderIdGreaterThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("order_id >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andOrderIdLessThan(Integer value) { + addCriterion("order_id <", value, "orderId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andOrderIdLessThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("order_id < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andOrderIdLessThanOrEqualTo(Integer value) { + addCriterion("order_id <=", value, "orderId"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andOrderIdLessThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("order_id <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andOrderIdIn(List values) { + addCriterion("order_id in", values, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdNotIn(List values) { + addCriterion("order_id not in", values, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdBetween(Integer value1, Integer value2) { + addCriterion("order_id between", value1, value2, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdNotBetween(Integer value1, Integer value2) { + addCriterion("order_id not between", value1, value2, "orderId"); + return (Criteria) this; + } + + public Criteria andAddTimeIsNull() { + addCriterion("add_time is null"); + return (Criteria) this; + } + + public Criteria andAddTimeIsNotNull() { + addCriterion("add_time is not null"); + return (Criteria) this; + } + + public Criteria andAddTimeEqualTo(LocalDateTime value) { + addCriterion("add_time =", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("add_time = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeNotEqualTo(LocalDateTime value) { + addCriterion("add_time <>", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeNotEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("add_time <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeGreaterThan(LocalDateTime value) { + addCriterion("add_time >", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeGreaterThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("add_time > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("add_time >=", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeGreaterThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("add_time >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeLessThan(LocalDateTime value) { + addCriterion("add_time <", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeLessThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("add_time < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("add_time <=", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeLessThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("add_time <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeIn(List values) { + addCriterion("add_time in", values, "addTime"); + return (Criteria) this; + } + + public Criteria andAddTimeNotIn(List values) { + addCriterion("add_time not in", values, "addTime"); + return (Criteria) this; + } + + public Criteria andAddTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("add_time between", value1, value2, "addTime"); + return (Criteria) this; + } + + public Criteria andAddTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("add_time not between", value1, value2, "addTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(LocalDateTime value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("update_time = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(LocalDateTime value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeNotEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("update_time <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(LocalDateTime value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeGreaterThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("update_time > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeGreaterThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("update_time >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(LocalDateTime value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeLessThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("update_time < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeLessThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("update_time <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andDeletedIsNull() { + addCriterion("deleted is null"); + return (Criteria) this; + } + + public Criteria andDeletedIsNotNull() { + addCriterion("deleted is not null"); + return (Criteria) this; + } + + public Criteria andDeletedEqualTo(Boolean value) { + addCriterion("deleted =", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("deleted = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedNotEqualTo(Boolean value) { + addCriterion("deleted <>", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedNotEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("deleted <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedGreaterThan(Boolean value) { + addCriterion("deleted >", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedGreaterThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("deleted > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedGreaterThanOrEqualTo(Boolean value) { + addCriterion("deleted >=", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedGreaterThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("deleted >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedLessThan(Boolean value) { + addCriterion("deleted <", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedLessThanColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("deleted < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedLessThanOrEqualTo(Boolean value) { + addCriterion("deleted <=", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedLessThanOrEqualToColumn(LitemallCouponUser.Column column) { + addCriterion(new StringBuilder("deleted <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedIn(List values) { + addCriterion("deleted in", values, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotIn(List values) { + addCriterion("deleted not in", values, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedBetween(Boolean value1, Boolean value2) { + addCriterion("deleted between", value1, value2, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotBetween(Boolean value1, Boolean value2) { + addCriterion("deleted not between", value1, value2, "deleted"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table litemall_coupon_user + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private LitemallCouponUserExample example; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + protected Criteria(LitemallCouponUserExample example) { + super(); + this.example = example; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public LitemallCouponUserExample example() { + return this.example; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIf(boolean ifAdd, ICriteriaAdd add) { + if (ifAdd) { + add.add(this); + } + return this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andLogicalDeleted(boolean deleted) { + return deleted ? andDeletedEqualTo(LitemallCouponUser.IS_DELETED) : andDeletedNotEqualTo(LitemallCouponUser.IS_DELETED); + } + + /** + * This interface was generated by MyBatis Generator. + * This interface corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public interface ICriteriaAdd { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_coupon_user + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + Criteria add(Criteria add); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table litemall_coupon_user + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/service/CouponAssignService.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/CouponAssignService.java new file mode 100644 index 00000000..2c51ad66 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/CouponAssignService.java @@ -0,0 +1,50 @@ +package org.linlinjava.litemall.db.service; + +import org.linlinjava.litemall.db.domain.LitemallCoupon; +import org.linlinjava.litemall.db.domain.LitemallCouponUser; +import org.linlinjava.litemall.db.util.CouponConstant; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +@Service +public class CouponAssignService { + + @Autowired + private LitemallCouponUserService couponUserService; + @Autowired + private LitemallCouponService couponService; + + /** + * 分发注册优惠券 + * + * @param userId + * @return + */ + public void assignForRegister(Integer userId) { + List couponList = couponService.queryRegister(); + for(LitemallCoupon coupon : couponList){ + Integer couponId = coupon.getId(); + + Integer count = couponUserService.countUserAndCoupon(userId, couponId); + if (count > 0) { + continue; + } + + Short limit = coupon.getLimit(); + while(limit > 0){ + LitemallCouponUser couponUser = new LitemallCouponUser(); + couponUser.setCouponId(couponId); + couponUser.setUserId(userId); + couponUserService.add(couponUser); + + limit--; + } + } + + } + +} \ No newline at end of file diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/service/CouponVerifyService.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/CouponVerifyService.java new file mode 100644 index 00000000..3644d977 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/CouponVerifyService.java @@ -0,0 +1,68 @@ +package org.linlinjava.litemall.db.service; + +import org.linlinjava.litemall.db.domain.LitemallCoupon; +import org.linlinjava.litemall.db.domain.LitemallCouponUser; +import org.linlinjava.litemall.db.util.CouponConstant; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Service +public class CouponVerifyService { + + @Autowired + private LitemallCouponUserService couponUserService; + @Autowired + private LitemallCouponService couponService; + + /** + * 检测优惠券是否适合 + * + * @param userId + * @param couponId + * @param checkedGoodsPrice + * @return + */ + public LitemallCoupon checkCoupon(Integer userId, Integer couponId, BigDecimal checkedGoodsPrice) { + LitemallCoupon coupon = couponService.findById(couponId); + LitemallCouponUser couponUser = couponUserService.queryOne(userId, couponId); + if (coupon == null || couponUser == null) { + return null; + } + + // 检查是否超期 + Short days = coupon.getDays(); + LocalDateTime now = LocalDateTime.now(); + if (days == 0) { + if (now.isBefore(coupon.getStartTime()) || now.isAfter(coupon.getEndTime())) { + return null; + } + } else { + LocalDateTime expired = couponUser.getAddTime().plusDays(days); + if (now.isAfter(expired)) { + return null; + } + } + // 检测商品是否符合 + // TODO 目前仅支持全平台商品,所以不需要检测 + Short goodType = coupon.getGoodsType(); + if (!goodType.equals(CouponConstant.GOODS_TYPE_ALL)) { + return null; + } + + // 检测订单状态 + Short status = coupon.getStatus(); + if (!status.equals(CouponConstant.STATUS_NORMAL)) { + return null; + } + // 检测是否满足最低消费 + if (checkedGoodsPrice.compareTo(coupon.getMin()) == -1) { + return null; + } + + return coupon; + } + +} \ No newline at end of file diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallAdminService.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallAdminService.java index 317c25fb..99eb5628 100644 --- a/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallAdminService.java +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallAdminService.java @@ -75,5 +75,4 @@ public class LitemallAdminService { public LitemallAdmin findById(Integer id) { return adminMapper.selectByPrimaryKeySelective(id, result); } - } diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCouponService.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCouponService.java new file mode 100644 index 00000000..a3201d57 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCouponService.java @@ -0,0 +1,65 @@ +package org.linlinjava.litemall.db.service; + +import com.github.pagehelper.PageHelper; +import org.linlinjava.litemall.db.dao.LitemallCouponMapper; +import org.linlinjava.litemall.db.domain.LitemallCoupon; +import org.linlinjava.litemall.db.domain.LitemallCoupon.Column; +import org.linlinjava.litemall.db.domain.LitemallCouponExample; +import org.linlinjava.litemall.db.domain.LitemallCouponUser; +import org.linlinjava.litemall.db.util.CouponConstant; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class LitemallCouponService { + @Resource + private LitemallCouponMapper couponMapper; + + private Column[] result = new Column[]{Column.id, Column.name, Column.desc, Column.tag, + Column.days, Column.startTime, Column.endTime, + Column.discount, Column.min}; + + /** + * 查询 + * + * @param offset + * @param limit + * @param sort + * @param order + * @return + */ + public List queryList(int offset, int limit, String sort, String order) { + LitemallCouponExample example = new LitemallCouponExample(); + example.or().andTypeEqualTo(CouponConstant.TYPE_COMMON).andStatusEqualTo(CouponConstant.STATUS_NORMAL).andDeletedEqualTo(false); + example.setOrderByClause(sort + " " + order); + PageHelper.startPage(offset, limit); + return couponMapper.selectByExampleSelective(example, result); + } + + public int queryTotal() { + LitemallCouponExample example = new LitemallCouponExample(); + example.or().andTypeEqualTo(CouponConstant.TYPE_COMMON).andStatusEqualTo(CouponConstant.STATUS_NORMAL).andDeletedEqualTo(false); + return (int) couponMapper.countByExample(example); + } + + public List queryList(int offset, int limit) { + return queryList(offset, limit, "add_time", "desc"); + } + + public LitemallCoupon findById(Integer id) { + return couponMapper.selectByPrimaryKey(id); + } + + /** + * 查询新用户注册优惠券 + * + * @return + */ + public List queryRegister() { + LitemallCouponExample example = new LitemallCouponExample(); + example.or().andTypeEqualTo(CouponConstant.TYPE_REGISTER).andStatusEqualTo(CouponConstant.STATUS_NORMAL).andDeletedEqualTo(false); + return couponMapper.selectByExample(example); + } +} diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCouponUserService.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCouponUserService.java new file mode 100644 index 00000000..179d33b8 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCouponUserService.java @@ -0,0 +1,88 @@ +package org.linlinjava.litemall.db.service; + +import com.github.pagehelper.PageHelper; +import org.linlinjava.litemall.db.dao.LitemallCouponUserMapper; +import org.linlinjava.litemall.db.domain.LitemallCouponUser; +import org.linlinjava.litemall.db.domain.LitemallCouponUserExample; +import org.linlinjava.litemall.db.util.CouponUserConstant; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + +@Service +public class LitemallCouponUserService { + @Resource + private LitemallCouponUserMapper couponUserMapper; + + public Integer countCoupon(Integer couponId) { + LitemallCouponUserExample example = new LitemallCouponUserExample(); + example.or().andCouponIdEqualTo(couponId).andDeletedEqualTo(false); + return (int)couponUserMapper.countByExample(example); + } + + public Integer countUserAndCoupon(Integer userId, Integer couponId) { + LitemallCouponUserExample example = new LitemallCouponUserExample(); + example.or().andUserIdEqualTo(userId).andCouponIdEqualTo(couponId).andDeletedEqualTo(false); + return (int)couponUserMapper.countByExample(example); + } + + public void add(LitemallCouponUser couponUser) { + couponUser.setAddTime(LocalDateTime.now()); + couponUser.setUpdateTime(LocalDateTime.now()); + couponUserMapper.insertSelective(couponUser); + } + + public List queryList(Integer userId, Integer couponId, Short status, Integer page, Integer size, String sort, String order) { + LitemallCouponUserExample example = new LitemallCouponUserExample(); + LitemallCouponUserExample.Criteria criteria = example.createCriteria(); + if (userId != null) { + criteria.andUserIdEqualTo(userId); + } + if(couponId != null){ + criteria.andCouponIdEqualTo(couponId); + } + if (status != null) { + criteria.andStatusEqualTo(status); + } + criteria.andDeletedEqualTo(false); + + if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) { + example.setOrderByClause(sort + " " + order); + } + + if (!StringUtils.isEmpty(page) && !StringUtils.isEmpty(size)) { + PageHelper.startPage(page, size); + } + + return couponUserMapper.selectByExample(example); + } + + public List queryAll(Integer userId, Integer couponId) { + return queryList(userId, couponId, CouponUserConstant.STATUS_USABLE, null, null, "add_time", "desc"); + } + + public List queryAll(Integer userId) { + return queryList(userId, null, CouponUserConstant.STATUS_USABLE, null, null, "add_time", "desc"); + } + + public LitemallCouponUser queryOne(Integer userId, Integer couponId) { + List couponUserList = queryList(userId, couponId, CouponUserConstant.STATUS_USABLE, 1, 1, "add_time", "desc"); + if(couponUserList.size() == 0){ + return null; + } + return couponUserList.get(0); + } + + public LitemallCouponUser findById(Integer id) { + return couponUserMapper.selectByPrimaryKey(id); + } + + + public int update(LitemallCouponUser couponUser) { + couponUser.setUpdateTime(LocalDateTime.now()); + return couponUserMapper.updateByPrimaryKeySelective(couponUser); + } +} diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/util/CouponConstant.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/util/CouponConstant.java new file mode 100644 index 00000000..e481abe4 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/util/CouponConstant.java @@ -0,0 +1,14 @@ +package org.linlinjava.litemall.db.util; + +public class CouponConstant { + public static final Short TYPE_COMMON = 0; + public static final Short TYPE_REGISTER = 1; + + public static final Short GOODS_TYPE_ALL = 0; + public static final Short GOODS_TYPE_CATEGORY = 1; + public static final Short GOODS_TYPE_ARRAY = 2; + + public static final Short STATUS_NORMAL = 0; + public static final Short STATUS_EXPIRED = 1; + public static final Short STATUS_OUT = 2; +} diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/util/CouponUserConstant.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/util/CouponUserConstant.java new file mode 100644 index 00000000..abe5c720 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/util/CouponUserConstant.java @@ -0,0 +1,8 @@ +package org.linlinjava.litemall.db.util; + +public class CouponUserConstant { + public static final Short STATUS_USABLE = 0; + public static final Short STATUS_USED = 1; + public static final Short STATUS_EXPIRED = 2; + public static final Short STATUS_OUT = 3; +} diff --git a/litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallCouponMapper.xml b/litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallCouponMapper.xml new file mode 100644 index 00000000..6e251b3c --- /dev/null +++ b/litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallCouponMapper.xml @@ -0,0 +1,613 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, `name`, `desc`, tag, total, discount, `min`, `limit`, `type`, `status`, goods_type, + goods_value, `days`, start_time, end_time, add_time, update_time, deleted + + + + + + + + + delete from litemall_coupon + where id = #{id,jdbcType=INTEGER} + + + + delete from litemall_coupon + + + + + + + + SELECT LAST_INSERT_ID() + + insert into litemall_coupon (`name`, `desc`, tag, + total, discount, `min`, + `limit`, `type`, `status`, + goods_type, goods_value, `days`, + start_time, end_time, add_time, + update_time, deleted) + values (#{name,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, #{tag,jdbcType=VARCHAR}, + #{total,jdbcType=INTEGER}, #{discount,jdbcType=DECIMAL}, #{min,jdbcType=DECIMAL}, + #{limit,jdbcType=SMALLINT}, #{type,jdbcType=SMALLINT}, #{status,jdbcType=SMALLINT}, + #{goodsType,jdbcType=SMALLINT}, #{goodsValue,jdbcType=VARCHAR}, #{days,jdbcType=SMALLINT}, + #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{addTime,jdbcType=TIMESTAMP}, + #{updateTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}) + + + + + SELECT LAST_INSERT_ID() + + insert into litemall_coupon + + + `name`, + + + `desc`, + + + tag, + + + total, + + + discount, + + + `min`, + + + `limit`, + + + `type`, + + + `status`, + + + goods_type, + + + goods_value, + + + `days`, + + + start_time, + + + end_time, + + + add_time, + + + update_time, + + + deleted, + + + + + #{name,jdbcType=VARCHAR}, + + + #{desc,jdbcType=VARCHAR}, + + + #{tag,jdbcType=VARCHAR}, + + + #{total,jdbcType=INTEGER}, + + + #{discount,jdbcType=DECIMAL}, + + + #{min,jdbcType=DECIMAL}, + + + #{limit,jdbcType=SMALLINT}, + + + #{type,jdbcType=SMALLINT}, + + + #{status,jdbcType=SMALLINT}, + + + #{goodsType,jdbcType=SMALLINT}, + + + #{goodsValue,jdbcType=VARCHAR}, + + + #{days,jdbcType=SMALLINT}, + + + #{startTime,jdbcType=TIMESTAMP}, + + + #{endTime,jdbcType=TIMESTAMP}, + + + #{addTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{deleted,jdbcType=BIT}, + + + + + + + update litemall_coupon + + + id = #{record.id,jdbcType=INTEGER}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + `desc` = #{record.desc,jdbcType=VARCHAR}, + + + tag = #{record.tag,jdbcType=VARCHAR}, + + + total = #{record.total,jdbcType=INTEGER}, + + + discount = #{record.discount,jdbcType=DECIMAL}, + + + `min` = #{record.min,jdbcType=DECIMAL}, + + + `limit` = #{record.limit,jdbcType=SMALLINT}, + + + `type` = #{record.type,jdbcType=SMALLINT}, + + + `status` = #{record.status,jdbcType=SMALLINT}, + + + goods_type = #{record.goodsType,jdbcType=SMALLINT}, + + + goods_value = #{record.goodsValue,jdbcType=VARCHAR}, + + + `days` = #{record.days,jdbcType=SMALLINT}, + + + start_time = #{record.startTime,jdbcType=TIMESTAMP}, + + + end_time = #{record.endTime,jdbcType=TIMESTAMP}, + + + add_time = #{record.addTime,jdbcType=TIMESTAMP}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + deleted = #{record.deleted,jdbcType=BIT}, + + + + + + + + + update litemall_coupon + set id = #{record.id,jdbcType=INTEGER}, + `name` = #{record.name,jdbcType=VARCHAR}, + `desc` = #{record.desc,jdbcType=VARCHAR}, + tag = #{record.tag,jdbcType=VARCHAR}, + total = #{record.total,jdbcType=INTEGER}, + discount = #{record.discount,jdbcType=DECIMAL}, + `min` = #{record.min,jdbcType=DECIMAL}, + `limit` = #{record.limit,jdbcType=SMALLINT}, + `type` = #{record.type,jdbcType=SMALLINT}, + `status` = #{record.status,jdbcType=SMALLINT}, + goods_type = #{record.goodsType,jdbcType=SMALLINT}, + goods_value = #{record.goodsValue,jdbcType=VARCHAR}, + `days` = #{record.days,jdbcType=SMALLINT}, + start_time = #{record.startTime,jdbcType=TIMESTAMP}, + end_time = #{record.endTime,jdbcType=TIMESTAMP}, + add_time = #{record.addTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + deleted = #{record.deleted,jdbcType=BIT} + + + + + + + update litemall_coupon + + + `name` = #{name,jdbcType=VARCHAR}, + + + `desc` = #{desc,jdbcType=VARCHAR}, + + + tag = #{tag,jdbcType=VARCHAR}, + + + total = #{total,jdbcType=INTEGER}, + + + discount = #{discount,jdbcType=DECIMAL}, + + + `min` = #{min,jdbcType=DECIMAL}, + + + `limit` = #{limit,jdbcType=SMALLINT}, + + + `type` = #{type,jdbcType=SMALLINT}, + + + `status` = #{status,jdbcType=SMALLINT}, + + + goods_type = #{goodsType,jdbcType=SMALLINT}, + + + goods_value = #{goodsValue,jdbcType=VARCHAR}, + + + `days` = #{days,jdbcType=SMALLINT}, + + + start_time = #{startTime,jdbcType=TIMESTAMP}, + + + end_time = #{endTime,jdbcType=TIMESTAMP}, + + + add_time = #{addTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + deleted = #{deleted,jdbcType=BIT}, + + + where id = #{id,jdbcType=INTEGER} + + + + update litemall_coupon + set `name` = #{name,jdbcType=VARCHAR}, + `desc` = #{desc,jdbcType=VARCHAR}, + tag = #{tag,jdbcType=VARCHAR}, + total = #{total,jdbcType=INTEGER}, + discount = #{discount,jdbcType=DECIMAL}, + `min` = #{min,jdbcType=DECIMAL}, + `limit` = #{limit,jdbcType=SMALLINT}, + `type` = #{type,jdbcType=SMALLINT}, + `status` = #{status,jdbcType=SMALLINT}, + goods_type = #{goodsType,jdbcType=SMALLINT}, + goods_value = #{goodsValue,jdbcType=VARCHAR}, + `days` = #{days,jdbcType=SMALLINT}, + start_time = #{startTime,jdbcType=TIMESTAMP}, + end_time = #{endTime,jdbcType=TIMESTAMP}, + add_time = #{addTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + deleted = #{deleted,jdbcType=BIT} + where id = #{id,jdbcType=INTEGER} + + + + + + update litemall_coupon set deleted = 1 + + + + + + + update litemall_coupon set deleted = 1 + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallCouponUserMapper.xml b/litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallCouponUserMapper.xml new file mode 100644 index 00000000..10fb3209 --- /dev/null +++ b/litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallCouponUserMapper.xml @@ -0,0 +1,471 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, user_id, coupon_id, `status`, used_time, order_id, add_time, update_time, deleted + + + + + + + + + delete from litemall_coupon_user + where id = #{id,jdbcType=INTEGER} + + + + delete from litemall_coupon_user + + + + + + + + SELECT LAST_INSERT_ID() + + insert into litemall_coupon_user (user_id, coupon_id, `status`, + used_time, order_id, add_time, + update_time, deleted) + values (#{userId,jdbcType=INTEGER}, #{couponId,jdbcType=INTEGER}, #{status,jdbcType=SMALLINT}, + #{usedTime,jdbcType=TIMESTAMP}, #{orderId,jdbcType=INTEGER}, #{addTime,jdbcType=TIMESTAMP}, + #{updateTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}) + + + + + SELECT LAST_INSERT_ID() + + insert into litemall_coupon_user + + + user_id, + + + coupon_id, + + + `status`, + + + used_time, + + + order_id, + + + add_time, + + + update_time, + + + deleted, + + + + + #{userId,jdbcType=INTEGER}, + + + #{couponId,jdbcType=INTEGER}, + + + #{status,jdbcType=SMALLINT}, + + + #{usedTime,jdbcType=TIMESTAMP}, + + + #{orderId,jdbcType=INTEGER}, + + + #{addTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{deleted,jdbcType=BIT}, + + + + + + + update litemall_coupon_user + + + id = #{record.id,jdbcType=INTEGER}, + + + user_id = #{record.userId,jdbcType=INTEGER}, + + + coupon_id = #{record.couponId,jdbcType=INTEGER}, + + + `status` = #{record.status,jdbcType=SMALLINT}, + + + used_time = #{record.usedTime,jdbcType=TIMESTAMP}, + + + order_id = #{record.orderId,jdbcType=INTEGER}, + + + add_time = #{record.addTime,jdbcType=TIMESTAMP}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + deleted = #{record.deleted,jdbcType=BIT}, + + + + + + + + + update litemall_coupon_user + set id = #{record.id,jdbcType=INTEGER}, + user_id = #{record.userId,jdbcType=INTEGER}, + coupon_id = #{record.couponId,jdbcType=INTEGER}, + `status` = #{record.status,jdbcType=SMALLINT}, + used_time = #{record.usedTime,jdbcType=TIMESTAMP}, + order_id = #{record.orderId,jdbcType=INTEGER}, + add_time = #{record.addTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + deleted = #{record.deleted,jdbcType=BIT} + + + + + + + update litemall_coupon_user + + + user_id = #{userId,jdbcType=INTEGER}, + + + coupon_id = #{couponId,jdbcType=INTEGER}, + + + `status` = #{status,jdbcType=SMALLINT}, + + + used_time = #{usedTime,jdbcType=TIMESTAMP}, + + + order_id = #{orderId,jdbcType=INTEGER}, + + + add_time = #{addTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + deleted = #{deleted,jdbcType=BIT}, + + + where id = #{id,jdbcType=INTEGER} + + + + update litemall_coupon_user + set user_id = #{userId,jdbcType=INTEGER}, + coupon_id = #{couponId,jdbcType=INTEGER}, + `status` = #{status,jdbcType=SMALLINT}, + used_time = #{usedTime,jdbcType=TIMESTAMP}, + order_id = #{orderId,jdbcType=INTEGER}, + add_time = #{addTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + deleted = #{deleted,jdbcType=BIT} + where id = #{id,jdbcType=INTEGER} + + + + + + update litemall_coupon_user set deleted = 1 + + + + + + + update litemall_coupon_user set deleted = 1 + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/dao/CouponVo.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/dao/CouponVo.java new file mode 100644 index 00000000..5b8150b0 --- /dev/null +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/dao/CouponVo.java @@ -0,0 +1,79 @@ +package org.linlinjava.litemall.wx.dao; + +import java.time.LocalDateTime; + +public class CouponVo { + private Integer id; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + private String name; + private String desc; + private String tag; + private String min; + private String discount; + private LocalDateTime startTime; + private LocalDateTime endTime; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getMin() { + return min; + } + + public void setMin(String min) { + this.min = min; + } + + public String getDiscount() { + return discount; + } + + public void setDiscount(String discount) { + this.discount = discount; + } + + public LocalDateTime getStartTime() { + return startTime; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } + + public LocalDateTime getEndTime() { + return endTime; + } + + public void setEndTime(LocalDateTime endTime) { + this.endTime = endTime; + } +} diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/util/WxResponseCode.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/util/WxResponseCode.java index dfc566f0..65ad1e72 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/util/WxResponseCode.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/util/WxResponseCode.java @@ -28,4 +28,8 @@ public class WxResponseCode { public static final Integer ORDER_COMMENT_EXPIRED = 727; public static final Integer GROUPON_EXPIRED = 730; + + public static final int COUPON_EXCEED_LIMIT = 740; + public static final int COUPON_RECEIVE_FAIL= 741; + } diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java index b2754a39..bfd50167 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java @@ -13,6 +13,7 @@ import org.linlinjava.litemall.core.util.RegexUtil; import org.linlinjava.litemall.core.util.ResponseUtil; import org.linlinjava.litemall.core.util.bcrypt.BCryptPasswordEncoder; import org.linlinjava.litemall.db.domain.LitemallUser; +import org.linlinjava.litemall.db.service.CouponAssignService; import org.linlinjava.litemall.db.service.LitemallUserService; import org.linlinjava.litemall.wx.annotation.LoginUser; import org.linlinjava.litemall.wx.dao.UserInfo; @@ -55,6 +56,9 @@ public class WxAuthController { @Autowired private NotifyService notifyService; + @Autowired + private CouponAssignService couponAssignService; + /** * 账号登录 * @@ -144,6 +148,9 @@ public class WxAuthController { user.setLastLoginIp(IpUtil.client(request)); userService.add(user); + + // 新用户发送注册优惠券 + couponAssignService.assignForRegister(user.getId()); } else { user.setLastLoginTime(LocalDateTime.now()); user.setLastLoginIp(IpUtil.client(request)); @@ -289,6 +296,9 @@ public class WxAuthController { user.setLastLoginIp(IpUtil.client(request)); userService.add(user); + // 给新用户发送注册优惠券 + couponAssignService.assignForRegister(user.getId()); + // userInfo UserInfo userInfo = new UserInfo(); userInfo.setNickName(username); diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java index 66d3bb46..c8d75425 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java @@ -41,6 +41,12 @@ public class WxCartController { private LitemallAddressService addressService; @Autowired private LitemallGrouponRulesService grouponRulesService; + @Autowired + private LitemallCouponService couponService; + @Autowired + private LitemallCouponUserService couponUserService; + @Autowired + private CouponVerifyService couponVerifyService; /** * 用户购物车信息 @@ -367,7 +373,7 @@ public class WxCartController { * @param addressId 收货地址ID: * 如果收货地址ID是空,则查询当前用户的默认地址。 * @param couponId 优惠券ID: - * 目前不支持 + * 如果优惠券ID是空,则自动选择合适的优惠券。 * @return 购物车操作结果 */ @GetMapping("checkout") @@ -398,10 +404,6 @@ public class WxCartController { } } - // 获取可用的优惠券信息 - // 使用优惠券减免的金额 - BigDecimal couponPrice = new BigDecimal(0.00); - // 团购优惠 BigDecimal grouponPrice = new BigDecimal(0.00); LitemallGrouponRules grouponRules = grouponRulesService.queryById(grouponRulesId); @@ -431,6 +433,46 @@ public class WxCartController { } } + // 计算优惠券可用情况 + BigDecimal tmpCouponPrice = new BigDecimal(0.00); + Integer tmpCouponId = 0; + int tmpCouponLength = 0; + List couponUserList = couponUserService.queryAll(userId); + for(LitemallCouponUser couponUser : couponUserList){ + LitemallCoupon coupon = couponVerifyService.checkCoupon(userId, couponUser.getCouponId(), checkedGoodsPrice); + if(coupon == null){ + continue; + } + + tmpCouponLength++; + if(tmpCouponPrice.compareTo(coupon.getDiscount()) == -1){ + tmpCouponPrice = coupon.getDiscount(); + tmpCouponId = coupon.getId(); + } + } + // 获取优惠券减免金额,优惠券可用数量 + int availableCouponLength = tmpCouponLength; + BigDecimal couponPrice = new BigDecimal(0); + // 这里存在三种情况 + // 1. 用户不想使用优惠券,则不处理 + // 2. 用户想自动使用优惠券,则选择合适优惠券 + // 3. 用户已选择优惠券,则测试优惠券是否合适 + if (couponId == null || couponId.equals(-1)){ + couponId = -1; + } + else if (couponId.equals(0)) { + couponPrice = tmpCouponPrice; + couponId = tmpCouponId; + } + else { + LitemallCoupon coupon = couponVerifyService.checkCoupon(userId, couponId, checkedGoodsPrice); + // 用户选择的优惠券有问题 + if(coupon == null){ + return ResponseUtil.badArgumentValue(); + } + couponPrice = coupon.getDiscount(); + } + // 根据订单商品总价计算运费,满88则免运费,否则8元; BigDecimal freightPrice = new BigDecimal(0.00); if (checkedGoodsPrice.compareTo(SystemConfig.getFreightLimit()) < 0) { @@ -450,8 +492,7 @@ public class WxCartController { data.put("grouponPrice", grouponPrice); data.put("checkedAddress", checkedAddress); data.put("couponId", couponId); - data.put("checkedCoupon", 0); - data.put("couponList", ""); + data.put("availableCouponLength", availableCouponLength); data.put("goodsTotalPrice", checkedGoodsPrice); data.put("freightPrice", freightPrice); data.put("couponPrice", couponPrice); diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCouponController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCouponController.java new file mode 100644 index 00000000..56d2a30b --- /dev/null +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCouponController.java @@ -0,0 +1,256 @@ +package org.linlinjava.litemall.wx.web; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.linlinjava.litemall.core.util.JacksonUtil; +import org.linlinjava.litemall.core.util.ResponseUtil; +import org.linlinjava.litemall.core.validator.Order; +import org.linlinjava.litemall.core.validator.Sort; +import org.linlinjava.litemall.db.domain.LitemallCart; +import org.linlinjava.litemall.db.domain.LitemallCoupon; +import org.linlinjava.litemall.db.domain.LitemallCouponUser; +import org.linlinjava.litemall.db.domain.LitemallGrouponRules; +import org.linlinjava.litemall.db.service.*; +import org.linlinjava.litemall.db.util.CouponConstant; +import org.linlinjava.litemall.wx.annotation.LoginUser; +import org.linlinjava.litemall.wx.dao.CouponVo; +import org.linlinjava.litemall.wx.util.WxResponseCode; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 优惠券服务 + */ +@RestController +@RequestMapping("/wx/coupon") +@Validated +public class WxCouponController { + private final Log logger = LogFactory.getLog(WxCouponController.class); + + @Autowired + private LitemallCouponService couponService; + @Autowired + private LitemallCouponUserService couponUserService; + @Autowired + private LitemallGrouponRulesService grouponRulesService; + @Autowired + private LitemallCartService cartService; + @Autowired + private CouponVerifyService couponVerifyService; + + /** + * 优惠券列表 + * + * @param page + * @param size + * @param sort + * @param order + * @return + */ + @GetMapping("list") + public Object list(@RequestParam(defaultValue = "1") Integer page, + @RequestParam(defaultValue = "10") Integer size, + @Sort @RequestParam(defaultValue = "add_time") String sort, + @Order @RequestParam(defaultValue = "desc") String order) { + + List couponList = couponService.queryList(page, size, sort, order); + int total = couponService.queryTotal(); + Map data = new HashMap(); + data.put("data", couponList); + data.put("count", total); + return ResponseUtil.ok(data); + } + + /** + * 个人优惠券列表 + * + * @param userId + * @param status + * @param page + * @param size + * @param sort + * @param order + * @return + */ + @GetMapping("mylist") + public Object mylist(@LoginUser Integer userId, + @NotNull Short status, + @RequestParam(defaultValue = "1") Integer page, + @RequestParam(defaultValue = "10") Integer size, + @Sort @RequestParam(defaultValue = "add_time") String sort, + @Order @RequestParam(defaultValue = "desc") String order) { + if (userId == null) { + return ResponseUtil.unlogin(); + } + + List couponUserList = couponUserService.queryList(userId, null, status, page, size, sort, order); + List couponVoList = change(couponUserList); + int total = couponService.queryTotal(); + Map data = new HashMap(); + data.put("data", couponVoList); + data.put("count", total); + return ResponseUtil.ok(data); + } + + private List change(List couponList) { + List couponVoList = new ArrayList<>(couponList.size()); + for(LitemallCouponUser couponUser : couponList){ + Integer couponId = couponUser.getCouponId(); + LitemallCoupon coupon = couponService.findById(couponId); + CouponVo couponVo = new CouponVo(); + couponVo.setId(coupon.getId()); + couponVo.setName(coupon.getName()); + couponVo.setDesc(coupon.getDesc()); + couponVo.setTag(coupon.getTag()); + couponVo.setMin(coupon.getMin().toPlainString()); + couponVo.setDiscount(coupon.getDiscount().toPlainString()); + + Short days = coupon.getDays(); + if (days == 0) { + couponVo.setStartTime(coupon.getStartTime()); + couponVo.setEndTime(coupon.getEndTime()); + } + else{ + couponVo.setStartTime(coupon.getAddTime()); + couponVo.setEndTime(coupon.getAddTime().plusDays(days)); + } + couponVoList.add(couponVo); + } + + return couponVoList; + } + + + /** + * 当前购物车下单商品订单可用优惠券 + * + * @param userId + * @param cartId + * @param grouponRulesId + * @return + */ + @GetMapping("selectlist") + public Object selectlist(@LoginUser Integer userId, Integer cartId, Integer grouponRulesId) { + if (userId == null) { + return ResponseUtil.unlogin(); + } + + // 团购优惠 + BigDecimal grouponPrice = new BigDecimal(0.00); + LitemallGrouponRules grouponRules = grouponRulesService.queryById(grouponRulesId); + if (grouponRules != null) { + grouponPrice = grouponRules.getDiscount(); + } + + // 商品价格 + List checkedGoodsList = null; + if (cartId == null || cartId.equals(0)) { + checkedGoodsList = cartService.queryByUidAndChecked(userId); + } else { + LitemallCart cart = cartService.findById(cartId); + if (cart == null) { + return ResponseUtil.badArgumentValue(); + } + checkedGoodsList = new ArrayList<>(1); + checkedGoodsList.add(cart); + } + BigDecimal checkedGoodsPrice = new BigDecimal(0.00); + for (LitemallCart cart : checkedGoodsList) { + // 只有当团购规格商品ID符合才进行团购优惠 + if (grouponRules != null && grouponRules.getGoodsId().equals(cart.getGoodsId())) { + checkedGoodsPrice = checkedGoodsPrice.add(cart.getPrice().subtract(grouponPrice).multiply(new BigDecimal(cart.getNumber()))); + } else { + checkedGoodsPrice = checkedGoodsPrice.add(cart.getPrice().multiply(new BigDecimal(cart.getNumber()))); + } + } + + // 计算优惠券可用情况 + List couponUserList = couponUserService.queryAll(userId); + List availableCouponUserList = new ArrayList<>(couponUserList.size()); + for (LitemallCouponUser couponUser : couponUserList) { + LitemallCoupon coupon = couponVerifyService.checkCoupon(userId, couponUser.getCouponId(), checkedGoodsPrice); + if (coupon == null) { + continue; + } + availableCouponUserList.add(couponUser); + } + + List couponVoList = change(availableCouponUserList); + + return ResponseUtil.ok(couponVoList); + } + + /** + * 优惠券领取 + * + * @param userId 用户ID + * @param body 请求内容, { couponId: xxx } + * @return 操作结果 + */ + @PostMapping("receive") + public Object receive(@LoginUser Integer userId, @RequestBody String body) { + if (userId == null) { + return ResponseUtil.unlogin(); + } + + Integer couponId = JacksonUtil.parseInteger(body, "couponId"); + if(couponId == null){ + return ResponseUtil.badArgument(); + } + + LitemallCoupon coupon = couponService.findById(couponId); + if(coupon == null){ + return ResponseUtil.badArgumentValue(); + } + + // 当前已领取数量和总数量比较 + Integer total = coupon.getTotal(); + Integer totalCoupons = couponUserService.countCoupon(couponId); + if((total != 0) && (totalCoupons >= total)){ + return ResponseUtil.fail(WxResponseCode.COUPON_EXCEED_LIMIT, "优惠券已领完"); + } + + // 当前用户已领取数量和用户限领数量比较 + Integer limit = coupon.getLimit().intValue(); + Integer userCounpons = couponUserService.countUserAndCoupon(userId, couponId); + if((limit != 0) && (userCounpons >= limit)){ + return ResponseUtil.fail(WxResponseCode.COUPON_EXCEED_LIMIT, "优惠券已经领取过"); + } + + // 优惠券分发类型 + // 例如注册赠券类型的优惠券不能领取 + Short type = coupon.getType(); + if(type.equals(CouponConstant.TYPE_REGISTER)){ + return ResponseUtil.fail(WxResponseCode.COUPON_RECEIVE_FAIL, "新用户优惠券自动发送"); + } + else if(!type.equals(CouponConstant.TYPE_COMMON)){ + return ResponseUtil.fail(WxResponseCode.COUPON_RECEIVE_FAIL, "优惠券类型不支持"); + } + + // 优惠券状态,已下架或者过期不能领取 + Short status = coupon.getStatus(); + if(status.equals(CouponConstant.STATUS_OUT)){ + return ResponseUtil.fail(WxResponseCode.COUPON_EXCEED_LIMIT, "优惠券已领完"); + } + if(status.equals(CouponConstant.STATUS_EXPIRED)){ + return ResponseUtil.fail(WxResponseCode.COUPON_RECEIVE_FAIL, "优惠券已经过期"); + } + + // 用户领券记录 + LitemallCouponUser couponUser = new LitemallCouponUser(); + couponUser.setCouponId(couponId); + couponUser.setUserId(userId); + + couponUserService.add(couponUser); + + return ResponseUtil.ok(); + } +} \ No newline at end of file diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxHomeController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxHomeController.java index 0de7263f..6e26fd2a 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxHomeController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxHomeController.java @@ -40,7 +40,8 @@ public class WxHomeController { private LitemallCategoryService categoryService; @Autowired private LitemallGrouponRulesService grouponRulesService; - + @Autowired + private LitemallCouponService couponService; @GetMapping("/cache") public Object cache(@NotNull String key) { @@ -74,6 +75,9 @@ public class WxHomeController { List channel = categoryService.queryChannel(); data.put("channel", channel); + List couponList = couponService.queryList(0, 3); + data.put("couponList", couponList); + List newGoods = goodsService.queryByNew(0, SystemConfig.getNewLimit()); data.put("newGoodsList", newGoods); diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxOrderController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxOrderController.java index b3fdef80..c0c21833 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxOrderController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxOrderController.java @@ -21,6 +21,7 @@ import org.linlinjava.litemall.core.util.JacksonUtil; import org.linlinjava.litemall.core.util.ResponseUtil; import org.linlinjava.litemall.db.domain.*; import org.linlinjava.litemall.db.service.*; +import org.linlinjava.litemall.db.util.CouponUserConstant; import org.linlinjava.litemall.db.util.OrderHandleOption; import org.linlinjava.litemall.db.util.OrderUtil; import org.linlinjava.litemall.wx.annotation.LoginUser; @@ -106,6 +107,12 @@ public class WxOrderController { private ExpressService expressService; @Autowired private LitemallCommentService commentService; + @Autowired + private LitemallCouponService couponService; + @Autowired + private LitemallCouponUserService couponUserService; + @Autowired + private CouponVerifyService couponVerifyService; private String detailedAddress(LitemallAddress litemallAddress) { Integer provinceId = litemallAddress.getProvinceId(); @@ -241,7 +248,7 @@ public class WxOrderController { *

* 1. 创建订单表项和订单商品表项; * 2. 购物车清空; - * 3. TODO 优惠券设置已用; + * 3. 优惠券设置已用; * 4. 商品货品库存减少; * 5. 如果是团购商品,则创建团购活动表项。 * @@ -287,10 +294,6 @@ public class WxOrderController { return ResponseUtil.badArgument(); } - // 获取可用的优惠券信息 - // 使用优惠券减免的金额 - BigDecimal couponPrice = new BigDecimal(0.00); - // 团购优惠 BigDecimal grouponPrice = new BigDecimal(0.00); LitemallGrouponRules grouponRules = grouponRulesService.queryById(grouponRulesId); @@ -320,6 +323,19 @@ public class WxOrderController { } } + // 获取可用的优惠券信息 + // 使用优惠券减免的金额 + BigDecimal couponPrice = new BigDecimal(0.00); + // 如果couponId=0则没有优惠券,couponId=-1则不使用优惠券 + if(couponId != 0 && couponId != -1){ + LitemallCoupon coupon = couponVerifyService.checkCoupon(userId, couponId, checkedGoodsPrice); + if(coupon == null){ + return ResponseUtil.badArgumentValue(); + } + couponPrice = coupon.getDiscount(); + } + + // 根据订单商品总价计算运费,满足条件(例如88元)则免运费,否则需要支付运费(例如8元); BigDecimal freightPrice = new BigDecimal(0.00); if (checkedGoodsPrice.compareTo(SystemConfig.getFreightLimit()) < 0) { @@ -331,6 +347,7 @@ public class WxOrderController { // 订单费用 BigDecimal orderTotalPrice = checkedGoodsPrice.add(freightPrice).subtract(couponPrice); + // 最终支付费用 BigDecimal actualPrice = orderTotalPrice.subtract(integralPrice); // 开启事务管理 @@ -368,6 +385,7 @@ public class WxOrderController { orderService.add(order); orderId = order.getId(); + // 添加订单商品表项 for (LitemallCart cartGoods : checkedGoodsList) { // 订单商品 LitemallOrderGoods orderGoods = new LitemallOrderGoods(); @@ -382,7 +400,6 @@ public class WxOrderController { orderGoods.setSpecifications(cartGoods.getSpecifications()); orderGoods.setAddTime(LocalDateTime.now()); - // 添加订单商品表项 orderGoodsService.add(orderGoods); } @@ -403,6 +420,15 @@ public class WxOrderController { } } + // 如果使用了优惠券,设置优惠券使用状态 + if(couponId != 0 && couponId != -1){ + LitemallCouponUser couponUser = couponUserService.queryOne(userId, couponId); + couponUser.setStatus(CouponUserConstant.STATUS_USED); + couponUser.setUsedTime(LocalDateTime.now()); + couponUser.setOrderId(orderId); + couponUserService.update(couponUser); + } + //如果是团购项目,添加团购信息 if (grouponRulesId != null && grouponRulesId > 0) { LitemallGroupon groupon = new LitemallGroupon();