perf: 团购代码优化

This commit is contained in:
Junling Bu
2019-12-08 19:23:32 +08:00
parent eff4862dc8
commit d6f243d8d8
36 changed files with 1317 additions and 1085 deletions

View File

@@ -66,6 +66,15 @@ public class LitemallGroupon {
*/
private Integer userId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon.share_url
*
* @mbg.generated
*/
private String shareUrl;
/**
*
* This field was generated by MyBatis Generator.
@@ -75,6 +84,24 @@ public class LitemallGroupon {
*/
private Integer creatorUserId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon.creator_user_time
*
* @mbg.generated
*/
private LocalDateTime creatorUserTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon.status
*
* @mbg.generated
*/
private Short status;
/**
*
* This field was generated by MyBatis Generator.
@@ -93,24 +120,6 @@ public class LitemallGroupon {
*/
private LocalDateTime updateTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon.share_url
*
* @mbg.generated
*/
private String shareUrl;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon.payed
*
* @mbg.generated
*/
private Boolean payed;
/**
*
* This field was generated by MyBatis Generator.
@@ -240,6 +249,30 @@ public class LitemallGroupon {
this.userId = userId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon.share_url
*
* @return the value of litemall_groupon.share_url
*
* @mbg.generated
*/
public String getShareUrl() {
return shareUrl;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon.share_url
*
* @param shareUrl the value for litemall_groupon.share_url
*
* @mbg.generated
*/
public void setShareUrl(String shareUrl) {
this.shareUrl = shareUrl;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon.creator_user_id
@@ -264,6 +297,54 @@ public class LitemallGroupon {
this.creatorUserId = creatorUserId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon.creator_user_time
*
* @return the value of litemall_groupon.creator_user_time
*
* @mbg.generated
*/
public LocalDateTime getCreatorUserTime() {
return creatorUserTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon.creator_user_time
*
* @param creatorUserTime the value for litemall_groupon.creator_user_time
*
* @mbg.generated
*/
public void setCreatorUserTime(LocalDateTime creatorUserTime) {
this.creatorUserTime = creatorUserTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon.status
*
* @return the value of litemall_groupon.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_groupon.status
*
* @param status the value for litemall_groupon.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_groupon.add_time
@@ -312,54 +393,6 @@ public class LitemallGroupon {
this.updateTime = updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon.share_url
*
* @return the value of litemall_groupon.share_url
*
* @mbg.generated
*/
public String getShareUrl() {
return shareUrl;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon.share_url
*
* @param shareUrl the value for litemall_groupon.share_url
*
* @mbg.generated
*/
public void setShareUrl(String shareUrl) {
this.shareUrl = shareUrl;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon.payed
*
* @return the value of litemall_groupon.payed
*
* @mbg.generated
*/
public Boolean getPayed() {
return payed;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon.payed
*
* @param payed the value for litemall_groupon.payed
*
* @mbg.generated
*/
public void setPayed(Boolean payed) {
this.payed = payed;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
@@ -413,11 +446,12 @@ public class LitemallGroupon {
sb.append(", grouponId=").append(grouponId);
sb.append(", rulesId=").append(rulesId);
sb.append(", userId=").append(userId);
sb.append(", shareUrl=").append(shareUrl);
sb.append(", creatorUserId=").append(creatorUserId);
sb.append(", creatorUserTime=").append(creatorUserTime);
sb.append(", status=").append(status);
sb.append(", addTime=").append(addTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", shareUrl=").append(shareUrl);
sb.append(", payed=").append(payed);
sb.append(", deleted=").append(deleted);
sb.append("]");
return sb.toString();
@@ -446,11 +480,12 @@ public class LitemallGroupon {
&& (this.getGrouponId() == null ? other.getGrouponId() == null : this.getGrouponId().equals(other.getGrouponId()))
&& (this.getRulesId() == null ? other.getRulesId() == null : this.getRulesId().equals(other.getRulesId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getShareUrl() == null ? other.getShareUrl() == null : this.getShareUrl().equals(other.getShareUrl()))
&& (this.getCreatorUserId() == null ? other.getCreatorUserId() == null : this.getCreatorUserId().equals(other.getCreatorUserId()))
&& (this.getCreatorUserTime() == null ? other.getCreatorUserTime() == null : this.getCreatorUserTime().equals(other.getCreatorUserTime()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getShareUrl() == null ? other.getShareUrl() == null : this.getShareUrl().equals(other.getShareUrl()))
&& (this.getPayed() == null ? other.getPayed() == null : this.getPayed().equals(other.getPayed()))
&& (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()));
}
@@ -469,11 +504,12 @@ public class LitemallGroupon {
result = prime * result + ((getGrouponId() == null) ? 0 : getGrouponId().hashCode());
result = prime * result + ((getRulesId() == null) ? 0 : getRulesId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getShareUrl() == null) ? 0 : getShareUrl().hashCode());
result = prime * result + ((getCreatorUserId() == null) ? 0 : getCreatorUserId().hashCode());
result = prime * result + ((getCreatorUserTime() == null) ? 0 : getCreatorUserTime().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getShareUrl() == null) ? 0 : getShareUrl().hashCode());
result = prime * result + ((getPayed() == null) ? 0 : getPayed().hashCode());
result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
return result;
}
@@ -558,11 +594,12 @@ public class LitemallGroupon {
grouponId("groupon_id", "grouponId", "INTEGER", false),
rulesId("rules_id", "rulesId", "INTEGER", false),
userId("user_id", "userId", "INTEGER", false),
shareUrl("share_url", "shareUrl", "VARCHAR", false),
creatorUserId("creator_user_id", "creatorUserId", "INTEGER", false),
creatorUserTime("creator_user_time", "creatorUserTime", "TIMESTAMP", false),
status("status", "status", "SMALLINT", true),
addTime("add_time", "addTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
shareUrl("share_url", "shareUrl", "VARCHAR", false),
payed("payed", "payed", "BIT", false),
deleted("deleted", "deleted", "BIT", false);
/**

View File

@@ -893,6 +893,142 @@ public class LitemallGrouponExample {
return (Criteria) this;
}
public Criteria andShareUrlIsNull() {
addCriterion("share_url is null");
return (Criteria) this;
}
public Criteria andShareUrlIsNotNull() {
addCriterion("share_url is not null");
return (Criteria) this;
}
public Criteria andShareUrlEqualTo(String value) {
addCriterion("share_url =", value, "shareUrl");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andShareUrlEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("share_url = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareUrlNotEqualTo(String value) {
addCriterion("share_url <>", value, "shareUrl");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andShareUrlNotEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("share_url <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareUrlGreaterThan(String value) {
addCriterion("share_url >", value, "shareUrl");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andShareUrlGreaterThanColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("share_url > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareUrlGreaterThanOrEqualTo(String value) {
addCriterion("share_url >=", value, "shareUrl");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andShareUrlGreaterThanOrEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("share_url >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareUrlLessThan(String value) {
addCriterion("share_url <", value, "shareUrl");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andShareUrlLessThanColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("share_url < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareUrlLessThanOrEqualTo(String value) {
addCriterion("share_url <=", value, "shareUrl");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andShareUrlLessThanOrEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("share_url <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareUrlLike(String value) {
addCriterion("share_url like", value, "shareUrl");
return (Criteria) this;
}
public Criteria andShareUrlNotLike(String value) {
addCriterion("share_url not like", value, "shareUrl");
return (Criteria) this;
}
public Criteria andShareUrlIn(List<String> values) {
addCriterion("share_url in", values, "shareUrl");
return (Criteria) this;
}
public Criteria andShareUrlNotIn(List<String> values) {
addCriterion("share_url not in", values, "shareUrl");
return (Criteria) this;
}
public Criteria andShareUrlBetween(String value1, String value2) {
addCriterion("share_url between", value1, value2, "shareUrl");
return (Criteria) this;
}
public Criteria andShareUrlNotBetween(String value1, String value2) {
addCriterion("share_url not between", value1, value2, "shareUrl");
return (Criteria) this;
}
public Criteria andCreatorUserIdIsNull() {
addCriterion("creator_user_id is null");
return (Criteria) this;
@@ -1019,6 +1155,258 @@ public class LitemallGrouponExample {
return (Criteria) this;
}
public Criteria andCreatorUserTimeIsNull() {
addCriterion("creator_user_time is null");
return (Criteria) this;
}
public Criteria andCreatorUserTimeIsNotNull() {
addCriterion("creator_user_time is not null");
return (Criteria) this;
}
public Criteria andCreatorUserTimeEqualTo(LocalDateTime value) {
addCriterion("creator_user_time =", value, "creatorUserTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andCreatorUserTimeEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("creator_user_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreatorUserTimeNotEqualTo(LocalDateTime value) {
addCriterion("creator_user_time <>", value, "creatorUserTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andCreatorUserTimeNotEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("creator_user_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreatorUserTimeGreaterThan(LocalDateTime value) {
addCriterion("creator_user_time >", value, "creatorUserTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andCreatorUserTimeGreaterThanColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("creator_user_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreatorUserTimeGreaterThanOrEqualTo(LocalDateTime value) {
addCriterion("creator_user_time >=", value, "creatorUserTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andCreatorUserTimeGreaterThanOrEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("creator_user_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreatorUserTimeLessThan(LocalDateTime value) {
addCriterion("creator_user_time <", value, "creatorUserTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andCreatorUserTimeLessThanColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("creator_user_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreatorUserTimeLessThanOrEqualTo(LocalDateTime value) {
addCriterion("creator_user_time <=", value, "creatorUserTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andCreatorUserTimeLessThanOrEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("creator_user_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreatorUserTimeIn(List<LocalDateTime> values) {
addCriterion("creator_user_time in", values, "creatorUserTime");
return (Criteria) this;
}
public Criteria andCreatorUserTimeNotIn(List<LocalDateTime> values) {
addCriterion("creator_user_time not in", values, "creatorUserTime");
return (Criteria) this;
}
public Criteria andCreatorUserTimeBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("creator_user_time between", value1, value2, "creatorUserTime");
return (Criteria) this;
}
public Criteria andCreatorUserTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("creator_user_time not between", value1, value2, "creatorUserTime");
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_groupon
*
* @mbg.generated
*/
public Criteria andStatusEqualToColumn(LitemallGroupon.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_groupon
*
* @mbg.generated
*/
public Criteria andStatusNotEqualToColumn(LitemallGroupon.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_groupon
*
* @mbg.generated
*/
public Criteria andStatusGreaterThanColumn(LitemallGroupon.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_groupon
*
* @mbg.generated
*/
public Criteria andStatusGreaterThanOrEqualToColumn(LitemallGroupon.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_groupon
*
* @mbg.generated
*/
public Criteria andStatusLessThanColumn(LitemallGroupon.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_groupon
*
* @mbg.generated
*/
public Criteria andStatusLessThanOrEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("`status` <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStatusIn(List<Short> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Short> 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 andAddTimeIsNull() {
addCriterion("add_time is null");
return (Criteria) this;
@@ -1271,268 +1659,6 @@ public class LitemallGrouponExample {
return (Criteria) this;
}
public Criteria andShareUrlIsNull() {
addCriterion("share_url is null");
return (Criteria) this;
}
public Criteria andShareUrlIsNotNull() {
addCriterion("share_url is not null");
return (Criteria) this;
}
public Criteria andShareUrlEqualTo(String value) {
addCriterion("share_url =", value, "shareUrl");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andShareUrlEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("share_url = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareUrlNotEqualTo(String value) {
addCriterion("share_url <>", value, "shareUrl");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andShareUrlNotEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("share_url <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareUrlGreaterThan(String value) {
addCriterion("share_url >", value, "shareUrl");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andShareUrlGreaterThanColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("share_url > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareUrlGreaterThanOrEqualTo(String value) {
addCriterion("share_url >=", value, "shareUrl");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andShareUrlGreaterThanOrEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("share_url >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareUrlLessThan(String value) {
addCriterion("share_url <", value, "shareUrl");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andShareUrlLessThanColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("share_url < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareUrlLessThanOrEqualTo(String value) {
addCriterion("share_url <=", value, "shareUrl");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andShareUrlLessThanOrEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("share_url <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareUrlLike(String value) {
addCriterion("share_url like", value, "shareUrl");
return (Criteria) this;
}
public Criteria andShareUrlNotLike(String value) {
addCriterion("share_url not like", value, "shareUrl");
return (Criteria) this;
}
public Criteria andShareUrlIn(List<String> values) {
addCriterion("share_url in", values, "shareUrl");
return (Criteria) this;
}
public Criteria andShareUrlNotIn(List<String> values) {
addCriterion("share_url not in", values, "shareUrl");
return (Criteria) this;
}
public Criteria andShareUrlBetween(String value1, String value2) {
addCriterion("share_url between", value1, value2, "shareUrl");
return (Criteria) this;
}
public Criteria andShareUrlNotBetween(String value1, String value2) {
addCriterion("share_url not between", value1, value2, "shareUrl");
return (Criteria) this;
}
public Criteria andPayedIsNull() {
addCriterion("payed is null");
return (Criteria) this;
}
public Criteria andPayedIsNotNull() {
addCriterion("payed is not null");
return (Criteria) this;
}
public Criteria andPayedEqualTo(Boolean value) {
addCriterion("payed =", value, "payed");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andPayedEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("payed = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPayedNotEqualTo(Boolean value) {
addCriterion("payed <>", value, "payed");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andPayedNotEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("payed <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPayedGreaterThan(Boolean value) {
addCriterion("payed >", value, "payed");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andPayedGreaterThanColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("payed > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPayedGreaterThanOrEqualTo(Boolean value) {
addCriterion("payed >=", value, "payed");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andPayedGreaterThanOrEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("payed >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPayedLessThan(Boolean value) {
addCriterion("payed <", value, "payed");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andPayedLessThanColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("payed < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPayedLessThanOrEqualTo(Boolean value) {
addCriterion("payed <=", value, "payed");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
public Criteria andPayedLessThanOrEqualToColumn(LitemallGroupon.Column column) {
addCriterion(new StringBuilder("payed <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPayedIn(List<Boolean> values) {
addCriterion("payed in", values, "payed");
return (Criteria) this;
}
public Criteria andPayedNotIn(List<Boolean> values) {
addCriterion("payed not in", values, "payed");
return (Criteria) this;
}
public Criteria andPayedBetween(Boolean value1, Boolean value2) {
addCriterion("payed between", value1, value2, "payed");
return (Criteria) this;
}
public Criteria andPayedNotBetween(Boolean value1, Boolean value2) {
addCriterion("payed not between", value1, value2, "payed");
return (Criteria) this;
}
public Criteria andDeletedIsNull() {
addCriterion("deleted is null");
return (Criteria) this;

View File

@@ -76,6 +76,24 @@ public class LitemallGrouponRules {
*/
private Integer discountMember;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon_rules.expire_time
*
* @mbg.generated
*/
private LocalDateTime expireTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon_rules.status
*
* @mbg.generated
*/
private Short status;
/**
*
* This field was generated by MyBatis Generator.
@@ -94,15 +112,6 @@ public class LitemallGrouponRules {
*/
private LocalDateTime updateTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon_rules.expire_time
*
* @mbg.generated
*/
private LocalDateTime expireTime;
/**
*
* This field was generated by MyBatis Generator.
@@ -256,6 +265,54 @@ public class LitemallGrouponRules {
this.discountMember = discountMember;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon_rules.expire_time
*
* @return the value of litemall_groupon_rules.expire_time
*
* @mbg.generated
*/
public LocalDateTime getExpireTime() {
return expireTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon_rules.expire_time
*
* @param expireTime the value for litemall_groupon_rules.expire_time
*
* @mbg.generated
*/
public void setExpireTime(LocalDateTime expireTime) {
this.expireTime = expireTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon_rules.status
*
* @return the value of litemall_groupon_rules.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_groupon_rules.status
*
* @param status the value for litemall_groupon_rules.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_groupon_rules.add_time
@@ -304,30 +361,6 @@ public class LitemallGrouponRules {
this.updateTime = updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon_rules.expire_time
*
* @return the value of litemall_groupon_rules.expire_time
*
* @mbg.generated
*/
public LocalDateTime getExpireTime() {
return expireTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon_rules.expire_time
*
* @param expireTime the value for litemall_groupon_rules.expire_time
*
* @mbg.generated
*/
public void setExpireTime(LocalDateTime expireTime) {
this.expireTime = expireTime;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
@@ -382,9 +415,10 @@ public class LitemallGrouponRules {
sb.append(", picUrl=").append(picUrl);
sb.append(", discount=").append(discount);
sb.append(", discountMember=").append(discountMember);
sb.append(", expireTime=").append(expireTime);
sb.append(", status=").append(status);
sb.append(", addTime=").append(addTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", expireTime=").append(expireTime);
sb.append(", deleted=").append(deleted);
sb.append("]");
return sb.toString();
@@ -414,9 +448,10 @@ public class LitemallGrouponRules {
&& (this.getPicUrl() == null ? other.getPicUrl() == null : this.getPicUrl().equals(other.getPicUrl()))
&& (this.getDiscount() == null ? other.getDiscount() == null : this.getDiscount().equals(other.getDiscount()))
&& (this.getDiscountMember() == null ? other.getDiscountMember() == null : this.getDiscountMember().equals(other.getDiscountMember()))
&& (this.getExpireTime() == null ? other.getExpireTime() == null : this.getExpireTime().equals(other.getExpireTime()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExpireTime() == null ? other.getExpireTime() == null : this.getExpireTime().equals(other.getExpireTime()))
&& (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()));
}
@@ -436,9 +471,10 @@ public class LitemallGrouponRules {
result = prime * result + ((getPicUrl() == null) ? 0 : getPicUrl().hashCode());
result = prime * result + ((getDiscount() == null) ? 0 : getDiscount().hashCode());
result = prime * result + ((getDiscountMember() == null) ? 0 : getDiscountMember().hashCode());
result = prime * result + ((getExpireTime() == null) ? 0 : getExpireTime().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExpireTime() == null) ? 0 : getExpireTime().hashCode());
result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
return result;
}
@@ -524,9 +560,10 @@ public class LitemallGrouponRules {
picUrl("pic_url", "picUrl", "VARCHAR", false),
discount("discount", "discount", "DECIMAL", false),
discountMember("discount_member", "discountMember", "INTEGER", false),
expireTime("expire_time", "expireTime", "TIMESTAMP", false),
status("status", "status", "SMALLINT", true),
addTime("add_time", "addTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
expireTime("expire_time", "expireTime", "TIMESTAMP", false),
deleted("deleted", "deleted", "BIT", false);
/**

View File

@@ -1040,6 +1040,258 @@ public class LitemallGrouponRulesExample {
return (Criteria) this;
}
public Criteria andExpireTimeIsNull() {
addCriterion("expire_time is null");
return (Criteria) this;
}
public Criteria andExpireTimeIsNotNull() {
addCriterion("expire_time is not null");
return (Criteria) this;
}
public Criteria andExpireTimeEqualTo(LocalDateTime value) {
addCriterion("expire_time =", value, "expireTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
public Criteria andExpireTimeEqualToColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("expire_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andExpireTimeNotEqualTo(LocalDateTime value) {
addCriterion("expire_time <>", value, "expireTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
public Criteria andExpireTimeNotEqualToColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("expire_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andExpireTimeGreaterThan(LocalDateTime value) {
addCriterion("expire_time >", value, "expireTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
public Criteria andExpireTimeGreaterThanColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("expire_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andExpireTimeGreaterThanOrEqualTo(LocalDateTime value) {
addCriterion("expire_time >=", value, "expireTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
public Criteria andExpireTimeGreaterThanOrEqualToColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("expire_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andExpireTimeLessThan(LocalDateTime value) {
addCriterion("expire_time <", value, "expireTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
public Criteria andExpireTimeLessThanColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("expire_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andExpireTimeLessThanOrEqualTo(LocalDateTime value) {
addCriterion("expire_time <=", value, "expireTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
public Criteria andExpireTimeLessThanOrEqualToColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("expire_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andExpireTimeIn(List<LocalDateTime> values) {
addCriterion("expire_time in", values, "expireTime");
return (Criteria) this;
}
public Criteria andExpireTimeNotIn(List<LocalDateTime> values) {
addCriterion("expire_time not in", values, "expireTime");
return (Criteria) this;
}
public Criteria andExpireTimeBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("expire_time between", value1, value2, "expireTime");
return (Criteria) this;
}
public Criteria andExpireTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("expire_time not between", value1, value2, "expireTime");
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_groupon_rules
*
* @mbg.generated
*/
public Criteria andStatusEqualToColumn(LitemallGrouponRules.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_groupon_rules
*
* @mbg.generated
*/
public Criteria andStatusNotEqualToColumn(LitemallGrouponRules.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_groupon_rules
*
* @mbg.generated
*/
public Criteria andStatusGreaterThanColumn(LitemallGrouponRules.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_groupon_rules
*
* @mbg.generated
*/
public Criteria andStatusGreaterThanOrEqualToColumn(LitemallGrouponRules.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_groupon_rules
*
* @mbg.generated
*/
public Criteria andStatusLessThanColumn(LitemallGrouponRules.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_groupon_rules
*
* @mbg.generated
*/
public Criteria andStatusLessThanOrEqualToColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("`status` <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStatusIn(List<Short> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Short> 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 andAddTimeIsNull() {
addCriterion("add_time is null");
return (Criteria) this;
@@ -1292,132 +1544,6 @@ public class LitemallGrouponRulesExample {
return (Criteria) this;
}
public Criteria andExpireTimeIsNull() {
addCriterion("expire_time is null");
return (Criteria) this;
}
public Criteria andExpireTimeIsNotNull() {
addCriterion("expire_time is not null");
return (Criteria) this;
}
public Criteria andExpireTimeEqualTo(LocalDateTime value) {
addCriterion("expire_time =", value, "expireTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
public Criteria andExpireTimeEqualToColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("expire_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andExpireTimeNotEqualTo(LocalDateTime value) {
addCriterion("expire_time <>", value, "expireTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
public Criteria andExpireTimeNotEqualToColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("expire_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andExpireTimeGreaterThan(LocalDateTime value) {
addCriterion("expire_time >", value, "expireTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
public Criteria andExpireTimeGreaterThanColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("expire_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andExpireTimeGreaterThanOrEqualTo(LocalDateTime value) {
addCriterion("expire_time >=", value, "expireTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
public Criteria andExpireTimeGreaterThanOrEqualToColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("expire_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andExpireTimeLessThan(LocalDateTime value) {
addCriterion("expire_time <", value, "expireTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
public Criteria andExpireTimeLessThanColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("expire_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andExpireTimeLessThanOrEqualTo(LocalDateTime value) {
addCriterion("expire_time <=", value, "expireTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
public Criteria andExpireTimeLessThanOrEqualToColumn(LitemallGrouponRules.Column column) {
addCriterion(new StringBuilder("expire_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andExpireTimeIn(List<LocalDateTime> values) {
addCriterion("expire_time in", values, "expireTime");
return (Criteria) this;
}
public Criteria andExpireTimeNotIn(List<LocalDateTime> values) {
addCriterion("expire_time not in", values, "expireTime");
return (Criteria) this;
}
public Criteria andExpireTimeBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("expire_time between", value1, value2, "expireTime");
return (Criteria) this;
}
public Criteria andExpireTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("expire_time not between", value1, value2, "expireTime");
return (Criteria) this;
}
public Criteria andDeletedIsNull() {
addCriterion("deleted is null");
return (Criteria) this;

View File

@@ -7,6 +7,7 @@ import org.linlinjava.litemall.db.dao.LitemallGrouponRulesMapper;
import org.linlinjava.litemall.db.domain.LitemallGoods;
import org.linlinjava.litemall.db.domain.LitemallGrouponRules;
import org.linlinjava.litemall.db.domain.LitemallGrouponRulesExample;
import org.linlinjava.litemall.db.util.GrouponConstant;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -36,10 +37,8 @@ public class LitemallGrouponRulesService {
* @param id
* @return
*/
public LitemallGrouponRules queryById(Integer id) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andIdEqualTo(id).andDeletedEqualTo(false);
return mapper.selectOneByExample(example);
public LitemallGrouponRules findById(Integer id) {
return mapper.selectByPrimaryKey(id);
}
/**
@@ -50,12 +49,24 @@ public class LitemallGrouponRulesService {
*/
public List<LitemallGrouponRules> queryByGoodsId(Integer goodsId) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andGoodsIdEqualTo(goodsId).andDeletedEqualTo(false);
example.or().andGoodsIdEqualTo(goodsId).andStatusEqualTo(GrouponConstant.RULE_STATUS_ON).andDeletedEqualTo(false);
return mapper.selectByExample(example);
}
public int countByGoodsId(Integer goodsId) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andGoodsIdEqualTo(goodsId).andStatusEqualTo(GrouponConstant.RULE_STATUS_ON).andDeletedEqualTo(false);
return (int)mapper.countByExample(example);
}
public List<LitemallGrouponRules> queryByStatus(Short status) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andStatusEqualTo(status).andDeletedEqualTo(false);
return mapper.selectByExample(example);
}
/**
* 获取首页团购活动列表
* 获取首页团购规则列表
*
* @param page
* @param limit
@@ -67,14 +78,14 @@ public class LitemallGrouponRulesService {
public List<LitemallGrouponRules> queryList(Integer page, Integer limit, String sort, String order) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andDeletedEqualTo(false);
example.or().andStatusEqualTo(GrouponConstant.RULE_STATUS_ON).andDeletedEqualTo(false);
example.setOrderByClause(sort + " " + order);
PageHelper.startPage(page, limit);
return mapper.selectByExample(example);
}
/**
* 判断某个团购活动是否已经过期
* 判断某个团购规则是否已经过期
*
* @return
*/
@@ -83,7 +94,7 @@ public class LitemallGrouponRulesService {
}
/**
* 获取团购活动列表
* 获取团购规则列表
*
* @param goodsId
* @param page

View File

@@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper;
import org.linlinjava.litemall.db.dao.LitemallGrouponMapper;
import org.linlinjava.litemall.db.domain.LitemallGroupon;
import org.linlinjava.litemall.db.domain.LitemallGrouponExample;
import org.linlinjava.litemall.db.util.GrouponConstant;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -24,7 +25,7 @@ public class LitemallGrouponService {
*/
public List<LitemallGroupon> queryMyGroupon(Integer userId) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andUserIdEqualTo(userId).andCreatorUserIdEqualTo(userId).andGrouponIdEqualTo(0).andDeletedEqualTo(false).andPayedEqualTo(true);
example.or().andUserIdEqualTo(userId).andCreatorUserIdEqualTo(userId).andGrouponIdEqualTo(0).andStatusNotEqualTo(GrouponConstant.STATUS_NONE).andDeletedEqualTo(false);
example.orderBy("add_time desc");
return mapper.selectByExample(example);
}
@@ -37,7 +38,7 @@ public class LitemallGrouponService {
*/
public List<LitemallGroupon> queryMyJoinGroupon(Integer userId) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andUserIdEqualTo(userId).andGrouponIdNotEqualTo(0).andDeletedEqualTo(false).andPayedEqualTo(true);
example.or().andUserIdEqualTo(userId).andGrouponIdNotEqualTo(0).andStatusNotEqualTo(GrouponConstant.STATUS_NONE).andDeletedEqualTo(false);
example.orderBy("add_time desc");
return mapper.selectByExample(example);
}
@@ -62,7 +63,7 @@ public class LitemallGrouponService {
*/
public List<LitemallGroupon> queryJoinRecord(Integer id) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andGrouponIdEqualTo(id).andDeletedEqualTo(false).andPayedEqualTo(true);
example.or().andGrouponIdEqualTo(id).andStatusNotEqualTo(GrouponConstant.STATUS_NONE).andDeletedEqualTo(false);
example.orderBy("add_time desc");
return mapper.selectByExample(example);
}
@@ -75,7 +76,7 @@ public class LitemallGrouponService {
*/
public LitemallGroupon queryById(Integer id) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andIdEqualTo(id).andDeletedEqualTo(false).andPayedEqualTo(true);
example.or().andIdEqualTo(id).andDeletedEqualTo(false);
return mapper.selectOneByExample(example);
}
@@ -87,10 +88,16 @@ public class LitemallGrouponService {
*/
public int countGroupon(Integer grouponId) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andGrouponIdEqualTo(grouponId).andDeletedEqualTo(false).andPayedEqualTo(true);
example.or().andGrouponIdEqualTo(grouponId).andStatusNotEqualTo(GrouponConstant.STATUS_NONE).andDeletedEqualTo(false);
return (int) mapper.countByExample(example);
}
public boolean hasJoin(Integer userId, Integer grouponId) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andUserIdEqualTo(userId).andGrouponIdEqualTo(grouponId).andStatusNotEqualTo(GrouponConstant.STATUS_NONE).andDeletedEqualTo(false);
return mapper.countByExample(example) != 0;
}
public int updateById(LitemallGroupon groupon) {
groupon.setUpdateTime(LocalDateTime.now());
return mapper.updateByPrimaryKeySelective(groupon);
@@ -127,10 +134,16 @@ public class LitemallGrouponService {
criteria.andRulesIdEqualTo(Integer.parseInt(rulesId));
}
criteria.andDeletedEqualTo(false);
criteria.andPayedEqualTo(true);
criteria.andStatusNotEqualTo(GrouponConstant.STATUS_NONE);
criteria.andGrouponIdEqualTo(0);
PageHelper.startPage(page, size);
return mapper.selectByExample(example);
}
public List<LitemallGroupon> queryByRuleId(int grouponRuleId) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andRulesIdEqualTo(grouponRuleId).andDeletedEqualTo(false);
return mapper.selectByExample(example);
}
}

View File

@@ -0,0 +1,15 @@
package org.linlinjava.litemall.db.util;
import org.linlinjava.litemall.db.domain.LitemallOrder;
public class GrouponConstant {
public static final Short RULE_STATUS_ON = 0;
public static final Short RULE_STATUS_DOWN_EXPIRE = 1;
public static final Short RULE_STATUS_DOWN_ADMIN = 2;
public static final Short STATUS_NONE = 0;
public static final Short STATUS_ON = 1;
public static final Short STATUS_SUCCEED = 2;
public static final Short STATUS_FAIL = 3;
}

View File

@@ -27,6 +27,7 @@ public class OrderUtil {
public static final Short STATUS_CONFIRM = 401;
public static final Short STATUS_CANCEL = 102;
public static final Short STATUS_AUTO_CANCEL = 103;
public static final Short STATUS_ADMIN_CANCEL = 104;
public static final Short STATUS_REFUND = 202;
public static final Short STATUS_REFUND_CONFIRM = 203;
public static final Short STATUS_AUTO_CONFIRM = 402;

View File

@@ -11,11 +11,12 @@
<result column="groupon_id" jdbcType="INTEGER" property="grouponId" />
<result column="rules_id" jdbcType="INTEGER" property="rulesId" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="share_url" jdbcType="VARCHAR" property="shareUrl" />
<result column="creator_user_id" jdbcType="INTEGER" property="creatorUserId" />
<result column="creator_user_time" jdbcType="TIMESTAMP" property="creatorUserTime" />
<result column="status" jdbcType="SMALLINT" property="status" />
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="share_url" jdbcType="VARCHAR" property="shareUrl" />
<result column="payed" jdbcType="BIT" property="payed" />
<result column="deleted" jdbcType="BIT" property="deleted" />
</resultMap>
<sql id="Example_Where_Clause">
@@ -89,8 +90,8 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, order_id, groupon_id, rules_id, user_id, creator_user_id, add_time, update_time,
share_url, payed, deleted
id, order_id, groupon_id, rules_id, user_id, share_url, creator_user_id, creator_user_time,
`status`, add_time, update_time, deleted
</sql>
<select id="selectByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallGrouponExample" resultMap="BaseResultMap">
<!--
@@ -212,13 +213,13 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into litemall_groupon (order_id, groupon_id, rules_id,
user_id, creator_user_id, add_time,
update_time, share_url, payed,
deleted)
user_id, share_url, creator_user_id,
creator_user_time, `status`, add_time,
update_time, deleted)
values (#{orderId,jdbcType=INTEGER}, #{grouponId,jdbcType=INTEGER}, #{rulesId,jdbcType=INTEGER},
#{userId,jdbcType=INTEGER}, #{creatorUserId,jdbcType=INTEGER}, #{addTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{shareUrl,jdbcType=VARCHAR}, #{payed,jdbcType=BIT},
#{deleted,jdbcType=BIT})
#{userId,jdbcType=INTEGER}, #{shareUrl,jdbcType=VARCHAR}, #{creatorUserId,jdbcType=INTEGER},
#{creatorUserTime,jdbcType=TIMESTAMP}, #{status,jdbcType=SMALLINT}, #{addTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT})
</insert>
<insert id="insertSelective" parameterType="org.linlinjava.litemall.db.domain.LitemallGroupon">
<!--
@@ -242,21 +243,24 @@
<if test="userId != null">
user_id,
</if>
<if test="shareUrl != null">
share_url,
</if>
<if test="creatorUserId != null">
creator_user_id,
</if>
<if test="creatorUserTime != null">
creator_user_time,
</if>
<if test="status != null">
`status`,
</if>
<if test="addTime != null">
add_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="shareUrl != null">
share_url,
</if>
<if test="payed != null">
payed,
</if>
<if test="deleted != null">
deleted,
</if>
@@ -274,21 +278,24 @@
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="shareUrl != null">
#{shareUrl,jdbcType=VARCHAR},
</if>
<if test="creatorUserId != null">
#{creatorUserId,jdbcType=INTEGER},
</if>
<if test="creatorUserTime != null">
#{creatorUserTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=SMALLINT},
</if>
<if test="addTime != null">
#{addTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="shareUrl != null">
#{shareUrl,jdbcType=VARCHAR},
</if>
<if test="payed != null">
#{payed,jdbcType=BIT},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
@@ -326,21 +333,24 @@
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=INTEGER},
</if>
<if test="record.shareUrl != null">
share_url = #{record.shareUrl,jdbcType=VARCHAR},
</if>
<if test="record.creatorUserId != null">
creator_user_id = #{record.creatorUserId,jdbcType=INTEGER},
</if>
<if test="record.creatorUserTime != null">
creator_user_time = #{record.creatorUserTime,jdbcType=TIMESTAMP},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=SMALLINT},
</if>
<if test="record.addTime != null">
add_time = #{record.addTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.shareUrl != null">
share_url = #{record.shareUrl,jdbcType=VARCHAR},
</if>
<if test="record.payed != null">
payed = #{record.payed,jdbcType=BIT},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted,jdbcType=BIT},
</if>
@@ -360,11 +370,12 @@
groupon_id = #{record.grouponId,jdbcType=INTEGER},
rules_id = #{record.rulesId,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=INTEGER},
share_url = #{record.shareUrl,jdbcType=VARCHAR},
creator_user_id = #{record.creatorUserId,jdbcType=INTEGER},
creator_user_time = #{record.creatorUserTime,jdbcType=TIMESTAMP},
`status` = #{record.status,jdbcType=SMALLINT},
add_time = #{record.addTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
share_url = #{record.shareUrl,jdbcType=VARCHAR},
payed = #{record.payed,jdbcType=BIT},
deleted = #{record.deleted,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@@ -389,21 +400,24 @@
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="shareUrl != null">
share_url = #{shareUrl,jdbcType=VARCHAR},
</if>
<if test="creatorUserId != null">
creator_user_id = #{creatorUserId,jdbcType=INTEGER},
</if>
<if test="creatorUserTime != null">
creator_user_time = #{creatorUserTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
`status` = #{status,jdbcType=SMALLINT},
</if>
<if test="addTime != null">
add_time = #{addTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="shareUrl != null">
share_url = #{shareUrl,jdbcType=VARCHAR},
</if>
<if test="payed != null">
payed = #{payed,jdbcType=BIT},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
@@ -420,11 +434,12 @@
groupon_id = #{grouponId,jdbcType=INTEGER},
rules_id = #{rulesId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER},
share_url = #{shareUrl,jdbcType=VARCHAR},
creator_user_id = #{creatorUserId,jdbcType=INTEGER},
creator_user_time = #{creatorUserTime,jdbcType=TIMESTAMP},
`status` = #{status,jdbcType=SMALLINT},
add_time = #{addTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
share_url = #{shareUrl,jdbcType=VARCHAR},
payed = #{payed,jdbcType=BIT},
deleted = #{deleted,jdbcType=BIT}
where id = #{id,jdbcType=INTEGER}
</update>

View File

@@ -12,9 +12,10 @@
<result column="pic_url" jdbcType="VARCHAR" property="picUrl" />
<result column="discount" jdbcType="DECIMAL" property="discount" />
<result column="discount_member" jdbcType="INTEGER" property="discountMember" />
<result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
<result column="status" jdbcType="SMALLINT" property="status" />
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
<result column="deleted" jdbcType="BIT" property="deleted" />
</resultMap>
<sql id="Example_Where_Clause">
@@ -88,8 +89,8 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, goods_id, goods_name, pic_url, discount, discount_member, add_time, update_time,
expire_time, deleted
id, goods_id, goods_name, pic_url, discount, discount_member, expire_time, `status`,
add_time, update_time, deleted
</sql>
<select id="selectByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallGrouponRulesExample" resultMap="BaseResultMap">
<!--
@@ -211,13 +212,13 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into litemall_groupon_rules (goods_id, goods_name, pic_url,
discount, discount_member, add_time,
update_time, expire_time, deleted
)
discount, discount_member, expire_time,
`status`, add_time, update_time,
deleted)
values (#{goodsId,jdbcType=INTEGER}, #{goodsName,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR},
#{discount,jdbcType=DECIMAL}, #{discountMember,jdbcType=INTEGER}, #{addTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{expireTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}
)
#{discount,jdbcType=DECIMAL}, #{discountMember,jdbcType=INTEGER}, #{expireTime,jdbcType=TIMESTAMP},
#{status,jdbcType=SMALLINT}, #{addTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{deleted,jdbcType=BIT})
</insert>
<insert id="insertSelective" parameterType="org.linlinjava.litemall.db.domain.LitemallGrouponRules">
<!--
@@ -244,15 +245,18 @@
<if test="discountMember != null">
discount_member,
</if>
<if test="expireTime != null">
expire_time,
</if>
<if test="status != null">
`status`,
</if>
<if test="addTime != null">
add_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="expireTime != null">
expire_time,
</if>
<if test="deleted != null">
deleted,
</if>
@@ -273,15 +277,18 @@
<if test="discountMember != null">
#{discountMember,jdbcType=INTEGER},
</if>
<if test="expireTime != null">
#{expireTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=SMALLINT},
</if>
<if test="addTime != null">
#{addTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="expireTime != null">
#{expireTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
@@ -322,15 +329,18 @@
<if test="record.discountMember != null">
discount_member = #{record.discountMember,jdbcType=INTEGER},
</if>
<if test="record.expireTime != null">
expire_time = #{record.expireTime,jdbcType=TIMESTAMP},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=SMALLINT},
</if>
<if test="record.addTime != null">
add_time = #{record.addTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.expireTime != null">
expire_time = #{record.expireTime,jdbcType=TIMESTAMP},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted,jdbcType=BIT},
</if>
@@ -351,9 +361,10 @@
pic_url = #{record.picUrl,jdbcType=VARCHAR},
discount = #{record.discount,jdbcType=DECIMAL},
discount_member = #{record.discountMember,jdbcType=INTEGER},
expire_time = #{record.expireTime,jdbcType=TIMESTAMP},
`status` = #{record.status,jdbcType=SMALLINT},
add_time = #{record.addTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
expire_time = #{record.expireTime,jdbcType=TIMESTAMP},
deleted = #{record.deleted,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@@ -381,15 +392,18 @@
<if test="discountMember != null">
discount_member = #{discountMember,jdbcType=INTEGER},
</if>
<if test="expireTime != null">
expire_time = #{expireTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
`status` = #{status,jdbcType=SMALLINT},
</if>
<if test="addTime != null">
add_time = #{addTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="expireTime != null">
expire_time = #{expireTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
@@ -407,9 +421,10 @@
pic_url = #{picUrl,jdbcType=VARCHAR},
discount = #{discount,jdbcType=DECIMAL},
discount_member = #{discountMember,jdbcType=INTEGER},
expire_time = #{expireTime,jdbcType=TIMESTAMP},
`status` = #{status,jdbcType=SMALLINT},
add_time = #{addTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
expire_time = #{expireTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=BIT}
where id = #{id,jdbcType=INTEGER}
</update>