Commit a34a95f8 authored by youc's avatar youc
Browse files

Merge branch 'master' of https://gitee.com/youc-project/litemall

parents f9f41412 a697e696
......@@ -45,9 +45,9 @@
<!--数据库连接信息-->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/litemall?useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=UTC&amp;verifyServerCertificate=false&amp;useSSL=false"
userId="litemall"
password="litemall123456"/>
connectionURL="jdbc:mysql://127.0.0.1:3306/litemall2?useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=UTC&amp;verifyServerCertificate=false&amp;useSSL=false"
userId="root"
password="Menethil.2822"/>
<javaModelGenerator targetPackage="org.linlinjava.litemall.db.domain" targetProject="src/main/java"/>
......@@ -172,5 +172,15 @@
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
<columnOverride javaType="java.time.LocalDateTime" column="expire_time"/>
</table>
<table tableName="litemall_groupon_rules">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
<columnOverride javaType="java.time.LocalDateTime" column="add_time"/>
<columnOverride javaType="java.time.LocalDateTime" column="expire_time"/>
</table>
<table tableName="litemall_groupon">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
<columnOverride javaType="java.time.LocalDateTime" column="add_time"/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 80011
Source Host : localhost:3306
Source Schema : litemall2
Target Server Type : MySQL
Target Server Version : 80011
File Encoding : 65001
Date: 06/08/2018 20:16:26
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for litemall_groupon
-- ----------------------------
DROP TABLE IF EXISTS `litemall_groupon`;
CREATE TABLE `litemall_groupon` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL COMMENT '关联的订单ID',
`groupon_id` int(11) NULL DEFAULT 0 COMMENT '参与的团购ID,仅当user_type不是1',
`rules_id` int(11) NOT NULL COMMENT '团购规则ID,关联litemall_groupon_rules表ID字段',
`user_id` int(11) NOT NULL COMMENT '用户ID',
`creator_user_id` int(11) NOT NULL COMMENT '创建者ID',
`add_time` datetime(0) NOT NULL COMMENT '创建时间',
`share_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '团购分享图片地址',
`payed` tinyint(1) NOT NULL COMMENT '是否已经支付',
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '逻辑删除',
`version` int(11) NULL DEFAULT 0 COMMENT '乐观锁字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 44 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 80011
Source Host : localhost:3306
Source Schema : litemall2
Target Server Type : MySQL
Target Server Version : 80011
File Encoding : 65001
Date: 06/08/2018 20:16:37
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for litemall_groupon_rules
-- ----------------------------
DROP TABLE IF EXISTS `litemall_groupon_rules`;
CREATE TABLE `litemall_groupon_rules` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`goods_id` int(11) NOT NULL COMMENT '商品表的商品ID',
`goods_name` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '商品名称',
`pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商品图片或者商品货品图片',
`discount` decimal(63, 0) NOT NULL COMMENT '优惠金额',
`discount_member` int(11) NOT NULL COMMENT '达到优惠条件的人数',
`add_time` datetime(0) NOT NULL COMMENT '创建时间',
`expire_time` datetime(0) NULL DEFAULT NULL COMMENT '团购过期时间',
`deleted` tinyint(1) NULL DEFAULT NULL COMMENT '逻辑删除',
`version` int(11) NULL DEFAULT NULL COMMENT '乐观锁字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
package org.linlinjava.litemall.db.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.domain.LitemallGroupon;
import org.linlinjava.litemall.db.domain.LitemallGrouponExample;
public interface LitemallGrouponMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
long countByExample(LitemallGrouponExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
int deleteByExample(LitemallGrouponExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
int insert(LitemallGroupon record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
int insertSelective(LitemallGroupon record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallGroupon selectOneByExample(LitemallGrouponExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallGroupon selectOneByExampleSelective(@Param("example") LitemallGrouponExample example, @Param("selective") LitemallGroupon.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<LitemallGroupon> selectByExampleSelective(@Param("example") LitemallGrouponExample example, @Param("selective") LitemallGroupon.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
List<LitemallGroupon> selectByExample(LitemallGrouponExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallGroupon selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") LitemallGroupon.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
LitemallGroupon selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallGroupon selectByPrimaryKeyWithLogicalDelete(@Param("id") Integer id, @Param("andLogicalDeleted") boolean andLogicalDeleted);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") LitemallGroupon record, @Param("example") LitemallGrouponExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
int updateByExample(@Param("record") LitemallGroupon record, @Param("example") LitemallGrouponExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(LitemallGroupon record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
int updateByPrimaryKey(LitemallGroupon record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int logicalDeleteByExample(@Param("example") LitemallGrouponExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int logicalDeleteByPrimaryKey(Integer id);
}
\ No newline at end of file
package org.linlinjava.litemall.db.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.domain.LitemallGrouponRules;
import org.linlinjava.litemall.db.domain.LitemallGrouponRulesExample;
public interface LitemallGrouponRulesMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
long countByExample(LitemallGrouponRulesExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
int deleteByExample(LitemallGrouponRulesExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
int insert(LitemallGrouponRules record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
int insertSelective(LitemallGrouponRules record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallGrouponRules selectOneByExample(LitemallGrouponRulesExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallGrouponRules selectOneByExampleSelective(@Param("example") LitemallGrouponRulesExample example, @Param("selective") LitemallGrouponRules.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<LitemallGrouponRules> selectByExampleSelective(@Param("example") LitemallGrouponRulesExample example, @Param("selective") LitemallGrouponRules.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
List<LitemallGrouponRules> selectByExample(LitemallGrouponRulesExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallGrouponRules selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") LitemallGrouponRules.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
LitemallGrouponRules selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallGrouponRules selectByPrimaryKeyWithLogicalDelete(@Param("id") Integer id, @Param("andLogicalDeleted") boolean andLogicalDeleted);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") LitemallGrouponRules record, @Param("example") LitemallGrouponRulesExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
int updateByExample(@Param("record") LitemallGrouponRules record, @Param("example") LitemallGrouponRulesExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(LitemallGrouponRules record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
int updateByPrimaryKey(LitemallGrouponRules record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int logicalDeleteByExample(@Param("example") LitemallGrouponRulesExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int logicalDeleteByPrimaryKey(Integer id);
}
\ No newline at end of file
package org.linlinjava.litemall.db.domain;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
public class LitemallGroupon {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_groupon
*
* @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_groupon
*
* @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_groupon.id
*
* @mbg.generated
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon.order_id
*
* @mbg.generated
*/
private Integer orderId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon.groupon_id
*
* @mbg.generated
*/
private Integer grouponId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon.rules_id
*
* @mbg.generated
*/
private Integer rulesId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon.user_id
*
* @mbg.generated
*/
private Integer userId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon.creator_user_id
*
* @mbg.generated
*/
private Integer creatorUserId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon.add_time
*
* @mbg.generated
*/
private LocalDateTime addTime;
/**
*
* 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.
* This field corresponds to the database column litemall_groupon.deleted
*
* @mbg.generated
*/
private Boolean deleted;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon.version
*
* @mbg.generated
*/
private Integer version;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon.id
*
* @return the value of litemall_groupon.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_groupon.id
*
* @param id the value for litemall_groupon.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_groupon.order_id
*
* @return the value of litemall_groupon.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_groupon.order_id
*
* @param orderId the value for litemall_groupon.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_groupon.groupon_id
*
* @return the value of litemall_groupon.groupon_id
*
* @mbg.generated
*/
public Integer getGrouponId() {
return grouponId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon.groupon_id
*
* @param grouponId the value for litemall_groupon.groupon_id
*
* @mbg.generated
*/
public void setGrouponId(Integer grouponId) {
this.grouponId = grouponId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon.rules_id
*
* @return the value of litemall_groupon.rules_id
*
* @mbg.generated
*/
public Integer getRulesId() {
return rulesId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon.rules_id
*
* @param rulesId the value for litemall_groupon.rules_id
*
* @mbg.generated
*/
public void setRulesId(Integer rulesId) {
this.rulesId = rulesId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon.user_id
*
* @return the value of litemall_groupon.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_groupon.user_id
*
* @param userId the value for litemall_groupon.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_groupon.creator_user_id
*
* @return the value of litemall_groupon.creator_user_id
*
* @mbg.generated
*/
public Integer getCreatorUserId() {
return creatorUserId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon.creator_user_id
*
* @param creatorUserId the value for litemall_groupon.creator_user_id
*
* @mbg.generated
*/
public void setCreatorUserId(Integer creatorUserId) {
this.creatorUserId = creatorUserId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon.add_time
*
* @return the value of litemall_groupon.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_groupon.add_time
*
* @param addTime the value for litemall_groupon.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_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 returns the value of the database column litemall_groupon.deleted
*
* @return the value of litemall_groupon.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_groupon.deleted
*
* @param deleted the value for litemall_groupon.deleted
*
* @mbg.generated
*/
public void setDeleted(Boolean deleted) {
this.deleted = deleted;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon.version
*
* @return the value of litemall_groupon.version
*
* @mbg.generated
*/
public Integer getVersion() {
return version;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon.version
*
* @param version the value for litemall_groupon.version
*
* @mbg.generated
*/
public void setVersion(Integer version) {
this.version = version;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @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(", orderId=").append(orderId);
sb.append(", grouponId=").append(grouponId);
sb.append(", rulesId=").append(rulesId);
sb.append(", userId=").append(userId);
sb.append(", creatorUserId=").append(creatorUserId);
sb.append(", addTime=").append(addTime);
sb.append(", shareUrl=").append(shareUrl);
sb.append(", payed=").append(payed);
sb.append(", deleted=").append(deleted);
sb.append(", version=").append(version);
sb.append("]");
return sb.toString();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
LitemallGroupon other = (LitemallGroupon) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
&& (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.getCreatorUserId() == null ? other.getCreatorUserId() == null : this.getCreatorUserId().equals(other.getCreatorUserId()))
&& (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
&& (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()))
&& (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
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 + ((getCreatorUserId() == null) ? 0 : getCreatorUserId().hashCode());
result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().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());
result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
return result;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @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_groupon
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER"),
orderId("order_id", "orderId", "INTEGER"),
grouponId("groupon_id", "grouponId", "INTEGER"),
rulesId("rules_id", "rulesId", "INTEGER"),
userId("user_id", "userId", "INTEGER"),
creatorUserId("creator_user_id", "creatorUserId", "INTEGER"),
addTime("add_time", "addTime", "TIMESTAMP"),
shareUrl("share_url", "shareUrl", "VARCHAR"),
payed("payed", "payed", "BIT"),
deleted("deleted", "deleted", "BIT"),
version("version", "version", "INTEGER");
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_groupon
*
* @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_groupon
*
* @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_groupon
*
* @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_groupon
*
* @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_groupon
*
* @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_groupon
*
* @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_groupon
*
* @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_groupon
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.column + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.column + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> 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[]{});
}
}
}
\ No newline at end of file
package org.linlinjava.litemall.db.domain;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
public class LitemallGrouponRules {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_groupon_rules
*
* @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_groupon_rules
*
* @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_groupon_rules.id
*
* @mbg.generated
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon_rules.goods_id
*
* @mbg.generated
*/
private Integer goodsId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon_rules.goods_name
*
* @mbg.generated
*/
private String goodsName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon_rules.pic_url
*
* @mbg.generated
*/
private String picUrl;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon_rules.discount
*
* @mbg.generated
*/
private BigDecimal discount;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon_rules.discount_member
*
* @mbg.generated
*/
private Integer discountMember;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon_rules.add_time
*
* @mbg.generated
*/
private LocalDateTime addTime;
/**
*
* 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.deleted
*
* @mbg.generated
*/
private Boolean deleted;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_groupon_rules.version
*
* @mbg.generated
*/
private Integer version;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon_rules.id
*
* @return the value of litemall_groupon_rules.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_groupon_rules.id
*
* @param id the value for litemall_groupon_rules.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_groupon_rules.goods_id
*
* @return the value of litemall_groupon_rules.goods_id
*
* @mbg.generated
*/
public Integer getGoodsId() {
return goodsId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon_rules.goods_id
*
* @param goodsId the value for litemall_groupon_rules.goods_id
*
* @mbg.generated
*/
public void setGoodsId(Integer goodsId) {
this.goodsId = goodsId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon_rules.goods_name
*
* @return the value of litemall_groupon_rules.goods_name
*
* @mbg.generated
*/
public String getGoodsName() {
return goodsName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon_rules.goods_name
*
* @param goodsName the value for litemall_groupon_rules.goods_name
*
* @mbg.generated
*/
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon_rules.pic_url
*
* @return the value of litemall_groupon_rules.pic_url
*
* @mbg.generated
*/
public String getPicUrl() {
return picUrl;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon_rules.pic_url
*
* @param picUrl the value for litemall_groupon_rules.pic_url
*
* @mbg.generated
*/
public void setPicUrl(String picUrl) {
this.picUrl = picUrl;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon_rules.discount
*
* @return the value of litemall_groupon_rules.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_groupon_rules.discount
*
* @param discount the value for litemall_groupon_rules.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_groupon_rules.discount_member
*
* @return the value of litemall_groupon_rules.discount_member
*
* @mbg.generated
*/
public Integer getDiscountMember() {
return discountMember;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon_rules.discount_member
*
* @param discountMember the value for litemall_groupon_rules.discount_member
*
* @mbg.generated
*/
public void setDiscountMember(Integer discountMember) {
this.discountMember = discountMember;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon_rules.add_time
*
* @return the value of litemall_groupon_rules.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_groupon_rules.add_time
*
* @param addTime the value for litemall_groupon_rules.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_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.deleted
*
* @return the value of litemall_groupon_rules.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_groupon_rules.deleted
*
* @param deleted the value for litemall_groupon_rules.deleted
*
* @mbg.generated
*/
public void setDeleted(Boolean deleted) {
this.deleted = deleted;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_groupon_rules.version
*
* @return the value of litemall_groupon_rules.version
*
* @mbg.generated
*/
public Integer getVersion() {
return version;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_groupon_rules.version
*
* @param version the value for litemall_groupon_rules.version
*
* @mbg.generated
*/
public void setVersion(Integer version) {
this.version = version;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @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(", goodsId=").append(goodsId);
sb.append(", goodsName=").append(goodsName);
sb.append(", picUrl=").append(picUrl);
sb.append(", discount=").append(discount);
sb.append(", discountMember=").append(discountMember);
sb.append(", addTime=").append(addTime);
sb.append(", expireTime=").append(expireTime);
sb.append(", deleted=").append(deleted);
sb.append(", version=").append(version);
sb.append("]");
return sb.toString();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
LitemallGrouponRules other = (LitemallGrouponRules) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId()))
&& (this.getGoodsName() == null ? other.getGoodsName() == null : this.getGoodsName().equals(other.getGoodsName()))
&& (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.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
&& (this.getExpireTime() == null ? other.getExpireTime() == null : this.getExpireTime().equals(other.getExpireTime()))
&& (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
&& (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode());
result = prime * result + ((getGoodsName() == null) ? 0 : getGoodsName().hashCode());
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 + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
result = prime * result + ((getExpireTime() == null) ? 0 : getExpireTime().hashCode());
result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
return result;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @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_groupon_rules
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER"),
goodsId("goods_id", "goodsId", "INTEGER"),
goodsName("goods_name", "goodsName", "VARCHAR"),
picUrl("pic_url", "picUrl", "VARCHAR"),
discount("discount", "discount", "DECIMAL"),
discountMember("discount_member", "discountMember", "INTEGER"),
addTime("add_time", "addTime", "TIMESTAMP"),
expireTime("expire_time", "expireTime", "TIMESTAMP"),
deleted("deleted", "deleted", "BIT"),
version("version", "version", "INTEGER");
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_groupon_rules
*
* @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_groupon_rules
*
* @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_groupon_rules
*
* @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_groupon_rules
*
* @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_groupon_rules
*
* @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_groupon_rules
*
* @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_groupon_rules
*
* @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_groupon_rules
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.column + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.column + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_groupon_rules
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> 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[]{});
}
}
}
\ No newline at end of file
......@@ -123,6 +123,15 @@ public class LitemallOrder {
*/
private BigDecimal integralPrice;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_order.groupon_price
*
* @mbg.generated
*/
private BigDecimal grouponPrice;
/**
*
* This field was generated by MyBatis Generator.
......@@ -495,6 +504,30 @@ public class LitemallOrder {
this.integralPrice = integralPrice;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_order.groupon_price
*
* @return the value of litemall_order.groupon_price
*
* @mbg.generated
*/
public BigDecimal getGrouponPrice() {
return grouponPrice;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_order.groupon_price
*
* @param grouponPrice the value for litemall_order.groupon_price
*
* @mbg.generated
*/
public void setGrouponPrice(BigDecimal grouponPrice) {
this.grouponPrice = grouponPrice;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_order.order_price
......@@ -806,6 +839,7 @@ public class LitemallOrder {
sb.append(", freightPrice=").append(freightPrice);
sb.append(", couponPrice=").append(couponPrice);
sb.append(", integralPrice=").append(integralPrice);
sb.append(", grouponPrice=").append(grouponPrice);
sb.append(", orderPrice=").append(orderPrice);
sb.append(", actualPrice=").append(actualPrice);
sb.append(", payId=").append(payId);
......@@ -851,6 +885,7 @@ public class LitemallOrder {
&& (this.getFreightPrice() == null ? other.getFreightPrice() == null : this.getFreightPrice().equals(other.getFreightPrice()))
&& (this.getCouponPrice() == null ? other.getCouponPrice() == null : this.getCouponPrice().equals(other.getCouponPrice()))
&& (this.getIntegralPrice() == null ? other.getIntegralPrice() == null : this.getIntegralPrice().equals(other.getIntegralPrice()))
&& (this.getGrouponPrice() == null ? other.getGrouponPrice() == null : this.getGrouponPrice().equals(other.getGrouponPrice()))
&& (this.getOrderPrice() == null ? other.getOrderPrice() == null : this.getOrderPrice().equals(other.getOrderPrice()))
&& (this.getActualPrice() == null ? other.getActualPrice() == null : this.getActualPrice().equals(other.getActualPrice()))
&& (this.getPayId() == null ? other.getPayId() == null : this.getPayId().equals(other.getPayId()))
......@@ -886,6 +921,7 @@ public class LitemallOrder {
result = prime * result + ((getFreightPrice() == null) ? 0 : getFreightPrice().hashCode());
result = prime * result + ((getCouponPrice() == null) ? 0 : getCouponPrice().hashCode());
result = prime * result + ((getIntegralPrice() == null) ? 0 : getIntegralPrice().hashCode());
result = prime * result + ((getGrouponPrice() == null) ? 0 : getGrouponPrice().hashCode());
result = prime * result + ((getOrderPrice() == null) ? 0 : getOrderPrice().hashCode());
result = prime * result + ((getActualPrice() == null) ? 0 : getActualPrice().hashCode());
result = prime * result + ((getPayId() == null) ? 0 : getPayId().hashCode());
......@@ -931,6 +967,7 @@ public class LitemallOrder {
freightPrice("freight_price", "freightPrice", "DECIMAL"),
couponPrice("coupon_price", "couponPrice", "DECIMAL"),
integralPrice("integral_price", "integralPrice", "DECIMAL"),
grouponPrice("groupon_price", "grouponPrice", "DECIMAL"),
orderPrice("order_price", "orderPrice", "DECIMAL"),
actualPrice("actual_price", "actualPrice", "DECIMAL"),
payId("pay_id", "payId", "VARCHAR"),
......
......@@ -927,6 +927,66 @@ public class LitemallOrderExample {
return (Criteria) this;
}
public Criteria andGrouponPriceIsNull() {
addCriterion("groupon_price is null");
return (Criteria) this;
}
public Criteria andGrouponPriceIsNotNull() {
addCriterion("groupon_price is not null");
return (Criteria) this;
}
public Criteria andGrouponPriceEqualTo(BigDecimal value) {
addCriterion("groupon_price =", value, "grouponPrice");
return (Criteria) this;
}
public Criteria andGrouponPriceNotEqualTo(BigDecimal value) {
addCriterion("groupon_price <>", value, "grouponPrice");
return (Criteria) this;
}
public Criteria andGrouponPriceGreaterThan(BigDecimal value) {
addCriterion("groupon_price >", value, "grouponPrice");
return (Criteria) this;
}
public Criteria andGrouponPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("groupon_price >=", value, "grouponPrice");
return (Criteria) this;
}
public Criteria andGrouponPriceLessThan(BigDecimal value) {
addCriterion("groupon_price <", value, "grouponPrice");
return (Criteria) this;
}
public Criteria andGrouponPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("groupon_price <=", value, "grouponPrice");
return (Criteria) this;
}
public Criteria andGrouponPriceIn(List<BigDecimal> values) {
addCriterion("groupon_price in", values, "grouponPrice");
return (Criteria) this;
}
public Criteria andGrouponPriceNotIn(List<BigDecimal> values) {
addCriterion("groupon_price not in", values, "grouponPrice");
return (Criteria) this;
}
public Criteria andGrouponPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("groupon_price between", value1, value2, "grouponPrice");
return (Criteria) this;
}
public Criteria andGrouponPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("groupon_price not between", value1, value2, "grouponPrice");
return (Criteria) this;
}
public Criteria andOrderPriceIsNull() {
addCriterion("order_price is null");
return (Criteria) this;
......
package org.linlinjava.litemall.db.service;
import com.alibaba.druid.util.StringUtils;
import com.github.pagehelper.PageHelper;
import org.linlinjava.litemall.db.dao.LitemallGrouponRulesMapper;
import org.linlinjava.litemall.db.domain.LitemallGrouponRules;
import org.linlinjava.litemall.db.domain.LitemallGrouponRulesExample;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class LitemallGrouponRulesService {
@Resource
LitemallGrouponRulesMapper mapper;
public int createRules(LitemallGrouponRules rules) {
return mapper.insertSelective(rules);
}
public LitemallGrouponRules queryById(Integer id) {
return mapper.selectByPrimaryKey(id);
}
/**
* 查询某个商品关联的团购规则
*
* @param goodsId
* @return
*/
public List<LitemallGrouponRules> queryByGoodsId(Integer goodsId) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andGoodsIdEqualTo(goodsId).andDeletedEqualTo(false);
return mapper.selectByExample(example);
}
public List<LitemallGrouponRules> queryByIndex(int offset, int limit) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andDeletedEqualTo(false);
example.orderBy("add_time desc");
PageHelper.startPage(offset, limit);
return mapper.selectByExample(example);
}
public List<LitemallGrouponRules> querySelective(String goodsId, Integer page, Integer size, String sort, String order) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
LitemallGrouponRulesExample.Criteria criteria = example.createCriteria();
if (!StringUtils.isEmpty(goodsId)) {
criteria.andGoodsIdEqualTo(Integer.parseInt(goodsId));
}
criteria.andDeletedEqualTo(false);
PageHelper.startPage(page, size);
return mapper.selectByExample(example);
}
public int countSelective(String goodsId, Integer page, Integer limit, String sort, String order) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
LitemallGrouponRulesExample.Criteria criteria = example.createCriteria();
if (!StringUtils.isEmpty(goodsId)) {
criteria.andGoodsIdEqualTo(Integer.parseInt(goodsId));
}
criteria.andDeletedEqualTo(false);
return (int) mapper.countByExample(example);
}
public void delete(Integer id) {
mapper.logicalDeleteByPrimaryKey(id);
}
public void update(LitemallGrouponRules grouponRules) {
mapper.updateByPrimaryKeySelective(grouponRules);
}
}
package org.linlinjava.litemall.db.service;
import com.alibaba.druid.util.StringUtils;
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.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class LitemallGrouponService {
@Resource
LitemallGrouponMapper mapper;
/**
* 查询用户所有参与的团购
*
* @param userId
* @return
*/
public List<LitemallGroupon> queryByUserId(Integer userId) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andUserIdEqualTo(userId).andDeletedEqualTo(false);
return mapper.selectByExample(example);
}
public List<LitemallGroupon> queryMyGroupon(Integer userId) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andUserIdEqualTo(userId).andCreatorUserIdEqualTo(userId).andGrouponIdEqualTo(0).andDeletedEqualTo(false).andPayedEqualTo(true);
example.orderBy("add_time desc");
return mapper.selectByExample(example);
}
public List<LitemallGroupon> queryMyJoinGroupon(Integer userId) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andUserIdEqualTo(userId).andGrouponIdNotEqualTo(0).andDeletedEqualTo(false).andPayedEqualTo(true);
example.orderBy("add_time desc");
return mapper.selectByExample(example);
}
public LitemallGroupon queryByOrderId(Integer orderId) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andOrderIdEqualTo(orderId).andDeletedEqualTo(false);
return mapper.selectOneByExample(example);
}
public List<LitemallGroupon> queryJoiners(Integer id) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andGrouponIdEqualTo(id).andDeletedEqualTo(false).andPayedEqualTo(true);
example.orderBy("add_time desc");
return mapper.selectByExample(example);
}
/**
* 根据ID查询记录
*
* @param id
* @return
*/
public LitemallGroupon queryById(Integer id) {
return mapper.selectByPrimaryKey(id);
}
/**
* 返回某个发起的团购参与人数
*
* @param grouponId
* @return
*/
public int countGroupon(Integer grouponId) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andGrouponIdEqualTo(grouponId).andDeletedEqualTo(false).andPayedEqualTo(true);
return (int) mapper.countByExample(example);
}
/**
* 返回某个团购活动参与人数
*
* @param rulesId
* @return
*/
public int countRules(Integer rulesId) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andRulesIdEqualTo(rulesId).andDeletedEqualTo(false);
return (int) mapper.countByExample(example);
}
public void update(LitemallGroupon groupon) {
mapper.updateByPrimaryKey(groupon);
}
/**
* 创建或参与一个团购
*
* @param groupon
* @return
*/
public int createGroupon(LitemallGroupon groupon) {
return mapper.insertSelective(groupon);
}
public List<LitemallGroupon> querySelective(String rulesId, Integer page, Integer size, String sort, String order) {
LitemallGrouponExample example = new LitemallGrouponExample();
LitemallGrouponExample.Criteria criteria = example.createCriteria();
if (!StringUtils.isEmpty(rulesId)) {
criteria.andRulesIdEqualTo(Integer.parseInt(rulesId));
}
criteria.andDeletedEqualTo(false);
criteria.andPayedEqualTo(true);
criteria.andGrouponIdEqualTo(0);
PageHelper.startPage(page, size);
return mapper.selectByExample(example);
}
public int countSelective(String rulesId, Integer page, Integer limit, String sort, String order) {
LitemallGrouponExample example = new LitemallGrouponExample();
LitemallGrouponExample.Criteria criteria = example.createCriteria();
if (!StringUtils.isEmpty(rulesId)) {
criteria.andRulesIdEqualTo(Integer.parseInt(rulesId));
}
criteria.andDeletedEqualTo(false);
criteria.andPayedEqualTo(true);
criteria.andGrouponIdEqualTo(0);
return (int) mapper.countByExample(example);
}
}
......@@ -17,6 +17,7 @@
<result column="freight_price" jdbcType="DECIMAL" property="freightPrice" />
<result column="coupon_price" jdbcType="DECIMAL" property="couponPrice" />
<result column="integral_price" jdbcType="DECIMAL" property="integralPrice" />
<result column="groupon_price" jdbcType="DECIMAL" property="grouponPrice" />
<result column="order_price" jdbcType="DECIMAL" property="orderPrice" />
<result column="actual_price" jdbcType="DECIMAL" property="actualPrice" />
<result column="pay_id" jdbcType="VARCHAR" property="payId" />
......@@ -102,8 +103,8 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, user_id, order_sn, order_status, consignee, mobile, address, goods_price, freight_price,
coupon_price, integral_price, order_price, actual_price, pay_id, pay_time, ship_sn,
ship_channel, ship_time, confirm_time, end_time, add_time, deleted, version
coupon_price, integral_price, groupon_price, order_price, actual_price, pay_id, pay_time,
ship_sn, ship_channel, ship_time, confirm_time, end_time, add_time, deleted, version
</sql>
<select id="selectByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallOrderExample" resultMap="BaseResultMap">
<!--
......@@ -141,8 +142,9 @@
</when>
<otherwise>
id, user_id, order_sn, order_status, consignee, mobile, address, goods_price, freight_price,
coupon_price, integral_price, order_price, actual_price, pay_id, pay_time, ship_sn,
ship_channel, ship_time, confirm_time, end_time, add_time, deleted, version
coupon_price, integral_price, groupon_price, order_price, actual_price, pay_id,
pay_time, ship_sn, ship_channel, ship_time, confirm_time, end_time, add_time, deleted,
version
</otherwise>
</choose>
from litemall_order
......@@ -202,8 +204,9 @@
</when>
<otherwise>
id, user_id, order_sn, order_status, consignee, mobile, address, goods_price, freight_price,
coupon_price, integral_price, order_price, actual_price, pay_id, pay_time, ship_sn,
ship_channel, ship_time, confirm_time, end_time, add_time, deleted, version
coupon_price, integral_price, groupon_price, order_price, actual_price, pay_id,
pay_time, ship_sn, ship_channel, ship_time, confirm_time, end_time, add_time, deleted,
version
</otherwise>
</choose>
from litemall_order
......@@ -238,19 +241,19 @@
insert into litemall_order (user_id, order_sn, order_status,
consignee, mobile, address,
goods_price, freight_price, coupon_price,
integral_price, order_price, actual_price,
pay_id, pay_time, ship_sn,
ship_channel, ship_time, confirm_time,
end_time, add_time, deleted,
version)
integral_price, groupon_price, order_price,
actual_price, pay_id, pay_time,
ship_sn, ship_channel, ship_time,
confirm_time, end_time, add_time,
deleted, version)
values (#{userId,jdbcType=INTEGER}, #{orderSn,jdbcType=VARCHAR}, #{orderStatus,jdbcType=SMALLINT},
#{consignee,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{goodsPrice,jdbcType=DECIMAL}, #{freightPrice,jdbcType=DECIMAL}, #{couponPrice,jdbcType=DECIMAL},
#{integralPrice,jdbcType=DECIMAL}, #{orderPrice,jdbcType=DECIMAL}, #{actualPrice,jdbcType=DECIMAL},
#{payId,jdbcType=VARCHAR}, #{payTime,jdbcType=TIMESTAMP}, #{shipSn,jdbcType=VARCHAR},
#{shipChannel,jdbcType=VARCHAR}, #{shipTime,jdbcType=TIMESTAMP}, #{confirmTime,jdbcType=TIMESTAMP},
#{endTime,jdbcType=TIMESTAMP}, #{addTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT},
#{version,jdbcType=INTEGER})
#{integralPrice,jdbcType=DECIMAL}, #{grouponPrice,jdbcType=DECIMAL}, #{orderPrice,jdbcType=DECIMAL},
#{actualPrice,jdbcType=DECIMAL}, #{payId,jdbcType=VARCHAR}, #{payTime,jdbcType=TIMESTAMP},
#{shipSn,jdbcType=VARCHAR}, #{shipChannel,jdbcType=VARCHAR}, #{shipTime,jdbcType=TIMESTAMP},
#{confirmTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{addTime,jdbcType=TIMESTAMP},
#{deleted,jdbcType=BIT}, #{version,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="org.linlinjava.litemall.db.domain.LitemallOrder">
<!--
......@@ -292,6 +295,9 @@
<if test="integralPrice != null">
integral_price,
</if>
<if test="grouponPrice != null">
groupon_price,
</if>
<if test="orderPrice != null">
order_price,
</if>
......@@ -360,6 +366,9 @@
<if test="integralPrice != null">
#{integralPrice,jdbcType=DECIMAL},
</if>
<if test="grouponPrice != null">
#{grouponPrice,jdbcType=DECIMAL},
</if>
<if test="orderPrice != null">
#{orderPrice,jdbcType=DECIMAL},
</if>
......@@ -448,6 +457,9 @@
<if test="record.integralPrice != null">
integral_price = #{record.integralPrice,jdbcType=DECIMAL},
</if>
<if test="record.grouponPrice != null">
groupon_price = #{record.grouponPrice,jdbcType=DECIMAL},
</if>
<if test="record.orderPrice != null">
order_price = #{record.orderPrice,jdbcType=DECIMAL},
</if>
......@@ -506,6 +518,7 @@
freight_price = #{record.freightPrice,jdbcType=DECIMAL},
coupon_price = #{record.couponPrice,jdbcType=DECIMAL},
integral_price = #{record.integralPrice,jdbcType=DECIMAL},
groupon_price = #{record.grouponPrice,jdbcType=DECIMAL},
order_price = #{record.orderPrice,jdbcType=DECIMAL},
actual_price = #{record.actualPrice,jdbcType=DECIMAL},
pay_id = #{record.payId,jdbcType=VARCHAR},
......@@ -559,6 +572,9 @@
<if test="integralPrice != null">
integral_price = #{integralPrice,jdbcType=DECIMAL},
</if>
<if test="grouponPrice != null">
groupon_price = #{grouponPrice,jdbcType=DECIMAL},
</if>
<if test="orderPrice != null">
order_price = #{orderPrice,jdbcType=DECIMAL},
</if>
......@@ -614,6 +630,7 @@
freight_price = #{freightPrice,jdbcType=DECIMAL},
coupon_price = #{couponPrice,jdbcType=DECIMAL},
integral_price = #{integralPrice,jdbcType=DECIMAL},
groupon_price = #{grouponPrice,jdbcType=DECIMAL},
order_price = #{orderPrice,jdbcType=DECIMAL},
actual_price = #{actualPrice,jdbcType=DECIMAL},
pay_id = #{payId,jdbcType=VARCHAR},
......@@ -660,8 +677,9 @@
</when>
<otherwise>
id, user_id, order_sn, order_status, consignee, mobile, address, goods_price, freight_price,
coupon_price, integral_price, order_price, actual_price, pay_id, pay_time, ship_sn,
ship_channel, ship_time, confirm_time, end_time, add_time, deleted, version
coupon_price, integral_price, groupon_price, order_price, actual_price, pay_id,
pay_time, ship_sn, ship_channel, ship_time, confirm_time, end_time, add_time, deleted,
version
</otherwise>
</choose>
from litemall_order
......
package org.linlinjava.litemall.wx.service;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
/**
* 简单缓存的数据
*/
public class HomeCacheManager {
public static final String INDEX = "index";
public static final String CATALOG = "catalog";
public static final String GOODS = "goods";
private static Map<String, Map<String, Object>> cacheDataList = new HashMap<>();
/**
* 缓存首页数据
*
* @param data
*/
public static void loadData(String cacheKey, Map<String, Object> data) {
Map<String, Object> cacheData = cacheDataList.get(cacheKey);
//有记录,则先丢弃
if (cacheData != null) {
cacheData.remove(cacheKey);
}
cacheData = new HashMap<>();
//深拷贝
cacheData.putAll(data);
cacheData.put("isCache", "true");
//设置缓存有效期为10分钟
cacheData.put("expireTime", LocalDateTime.now().plusMinutes(10));
cacheDataList.put(cacheKey, cacheData);
}
public static Map<String, Object> getCacheData(String cacheKey) {
return cacheDataList.get(cacheKey);
}
/**
* 判断缓存中是否有数据
*
* @return
*/
public static boolean hasData(String cacheKey) {
Map<String, Object> cacheData = cacheDataList.get(cacheKey);
if (cacheData == null) {
return false;
} else {
LocalDateTime expire = (LocalDateTime) cacheData.get("expireTime");
if (expire.isBefore(LocalDateTime.now())) {
return false;
} else {
return true;
}
}
}
/**
* 清除所有缓存
*/
public static void clearAll() {
cacheDataList = new HashMap<>();
}
/**
* 清除缓存数据
*/
public static void clear(String cacheKey) {
Map<String, Object> cacheData = cacheDataList.get(cacheKey);
if (cacheData != null) {
cacheDataList.remove(cacheKey);
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment