Browse Source

销售单明细表加字段

Signed-off-by: fengb <fengbin1989@aliyun.com>
cangku
fengb 3 years ago
parent
commit
6de89213f1
  1. 37
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/SaleDetail.java
  2. 180
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/SaleDetailExample.java
  3. 57
      hiver-modules/hiver-mall/src/main/resources/mapper/SaleDetailMapper.xml

37
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/SaleDetail.java

@ -8,7 +8,6 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@ApiModel(value = "销售单明细表")
@TableName(value = "t_sale_detail", autoResultMap = true)
public class SaleDetail implements Serializable {
@ -57,6 +56,15 @@ public class SaleDetail implements Serializable {
@ApiModelProperty(value = "销售数量")
private Integer productCount;
@ApiModelProperty(value = "折扣")
private BigDecimal discount;
@ApiModelProperty(value = "优惠金额")
private BigDecimal discountAmount;
@ApiModelProperty(value = "实际价格")
private BigDecimal realPrice;
private static final long serialVersionUID = 1L;
public String getId() {
@ -195,6 +203,30 @@ public class SaleDetail implements Serializable {
this.productCount = productCount;
}
public BigDecimal getDiscount() {
return discount;
}
public void setDiscount(BigDecimal discount) {
this.discount = discount;
}
public BigDecimal getDiscountAmount() {
return discountAmount;
}
public void setDiscountAmount(BigDecimal discountAmount) {
this.discountAmount = discountAmount;
}
public BigDecimal getRealPrice() {
return realPrice;
}
public void setRealPrice(BigDecimal realPrice) {
this.realPrice = realPrice;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -218,6 +250,9 @@ public class SaleDetail implements Serializable {
sb.append(", purchasePrice=").append(purchasePrice);
sb.append(", wholesalePrice=").append(wholesalePrice);
sb.append(", productCount=").append(productCount);
sb.append(", discount=").append(discount);
sb.append(", discountAmount=").append(discountAmount);
sb.append(", realPrice=").append(realPrice);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

180
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/SaleDetailExample.java

@ -1225,6 +1225,186 @@ public class SaleDetailExample {
addCriterion("product_count not between", value1, value2, "productCount");
return (Criteria) this;
}
public Criteria andDiscountIsNull() {
addCriterion("discount is null");
return (Criteria) this;
}
public Criteria andDiscountIsNotNull() {
addCriterion("discount is not null");
return (Criteria) this;
}
public Criteria andDiscountEqualTo(BigDecimal value) {
addCriterion("discount =", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountNotEqualTo(BigDecimal value) {
addCriterion("discount <>", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountGreaterThan(BigDecimal value) {
addCriterion("discount >", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("discount >=", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountLessThan(BigDecimal value) {
addCriterion("discount <", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountLessThanOrEqualTo(BigDecimal value) {
addCriterion("discount <=", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountIn(List<BigDecimal> values) {
addCriterion("discount in", values, "discount");
return (Criteria) this;
}
public Criteria andDiscountNotIn(List<BigDecimal> values) {
addCriterion("discount not in", values, "discount");
return (Criteria) this;
}
public Criteria andDiscountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount between", value1, value2, "discount");
return (Criteria) this;
}
public Criteria andDiscountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount not between", value1, value2, "discount");
return (Criteria) this;
}
public Criteria andDiscountAmountIsNull() {
addCriterion("discount_amount is null");
return (Criteria) this;
}
public Criteria andDiscountAmountIsNotNull() {
addCriterion("discount_amount is not null");
return (Criteria) this;
}
public Criteria andDiscountAmountEqualTo(BigDecimal value) {
addCriterion("discount_amount =", value, "discountAmount");
return (Criteria) this;
}
public Criteria andDiscountAmountNotEqualTo(BigDecimal value) {
addCriterion("discount_amount <>", value, "discountAmount");
return (Criteria) this;
}
public Criteria andDiscountAmountGreaterThan(BigDecimal value) {
addCriterion("discount_amount >", value, "discountAmount");
return (Criteria) this;
}
public Criteria andDiscountAmountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("discount_amount >=", value, "discountAmount");
return (Criteria) this;
}
public Criteria andDiscountAmountLessThan(BigDecimal value) {
addCriterion("discount_amount <", value, "discountAmount");
return (Criteria) this;
}
public Criteria andDiscountAmountLessThanOrEqualTo(BigDecimal value) {
addCriterion("discount_amount <=", value, "discountAmount");
return (Criteria) this;
}
public Criteria andDiscountAmountIn(List<BigDecimal> values) {
addCriterion("discount_amount in", values, "discountAmount");
return (Criteria) this;
}
public Criteria andDiscountAmountNotIn(List<BigDecimal> values) {
addCriterion("discount_amount not in", values, "discountAmount");
return (Criteria) this;
}
public Criteria andDiscountAmountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_amount between", value1, value2, "discountAmount");
return (Criteria) this;
}
public Criteria andDiscountAmountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_amount not between", value1, value2, "discountAmount");
return (Criteria) this;
}
public Criteria andRealPriceIsNull() {
addCriterion("real_price is null");
return (Criteria) this;
}
public Criteria andRealPriceIsNotNull() {
addCriterion("real_price is not null");
return (Criteria) this;
}
public Criteria andRealPriceEqualTo(BigDecimal value) {
addCriterion("real_price =", value, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceNotEqualTo(BigDecimal value) {
addCriterion("real_price <>", value, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceGreaterThan(BigDecimal value) {
addCriterion("real_price >", value, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("real_price >=", value, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceLessThan(BigDecimal value) {
addCriterion("real_price <", value, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("real_price <=", value, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceIn(List<BigDecimal> values) {
addCriterion("real_price in", values, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceNotIn(List<BigDecimal> values) {
addCriterion("real_price not in", values, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("real_price between", value1, value2, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("real_price not between", value1, value2, "realPrice");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

57
hiver-modules/hiver-mall/src/main/resources/mapper/SaleDetailMapper.xml

@ -19,6 +19,9 @@
<result column="purchase_price" jdbcType="DECIMAL" property="purchasePrice" />
<result column="wholesale_price" jdbcType="DECIMAL" property="wholesalePrice" />
<result column="product_count" jdbcType="INTEGER" property="productCount" />
<result column="discount" jdbcType="DECIMAL" property="discount" />
<result column="discount_amount" jdbcType="DECIMAL" property="discountAmount" />
<result column="real_price" jdbcType="DECIMAL" property="realPrice" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -81,7 +84,7 @@
<sql id="Base_Column_List">
id, create_by, create_time, del_flag, update_by, update_time, sale_id, product_id,
product_name, unit, shop_id, category_id, attribute_list, price, purchase_price,
wholesale_price, product_count
wholesale_price, product_count, discount, discount_amount, real_price
</sql>
<select id="selectByExample" parameterType="cc.hiver.mall.entity.SaleDetailExample" resultMap="BaseResultMap">
select
@ -119,13 +122,15 @@
sale_id, product_id, product_name,
unit, shop_id, category_id,
attribute_list, price, purchase_price,
wholesale_price, product_count)
wholesale_price, product_count, discount,
discount_amount, real_price)
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{saleId,jdbcType=VARCHAR}, #{productId,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR},
#{unit,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR},
#{attributeList,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, #{purchasePrice,jdbcType=DECIMAL},
#{wholesalePrice,jdbcType=DECIMAL}, #{productCount,jdbcType=INTEGER})
#{wholesalePrice,jdbcType=DECIMAL}, #{productCount,jdbcType=INTEGER}, #{discount,jdbcType=DECIMAL},
#{discountAmount,jdbcType=DECIMAL}, #{realPrice,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.SaleDetail">
insert into t_sale_detail
@ -181,6 +186,15 @@
<if test="productCount != null">
product_count,
</if>
<if test="discount != null">
discount,
</if>
<if test="discountAmount != null">
discount_amount,
</if>
<if test="realPrice != null">
real_price,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -234,6 +248,15 @@
<if test="productCount != null">
#{productCount,jdbcType=INTEGER},
</if>
<if test="discount != null">
#{discount,jdbcType=DECIMAL},
</if>
<if test="discountAmount != null">
#{discountAmount,jdbcType=DECIMAL},
</if>
<if test="realPrice != null">
#{realPrice,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="cc.hiver.mall.entity.SaleDetailExample" resultType="java.lang.Long">
@ -296,6 +319,15 @@
<if test="record.productCount != null">
product_count = #{record.productCount,jdbcType=INTEGER},
</if>
<if test="record.discount != null">
discount = #{record.discount,jdbcType=DECIMAL},
</if>
<if test="record.discountAmount != null">
discount_amount = #{record.discountAmount,jdbcType=DECIMAL},
</if>
<if test="record.realPrice != null">
real_price = #{record.realPrice,jdbcType=DECIMAL},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -319,7 +351,10 @@
price = #{record.price,jdbcType=DECIMAL},
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL},
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL},
product_count = #{record.productCount,jdbcType=INTEGER}
product_count = #{record.productCount,jdbcType=INTEGER},
discount = #{record.discount,jdbcType=DECIMAL},
discount_amount = #{record.discountAmount,jdbcType=DECIMAL},
real_price = #{record.realPrice,jdbcType=DECIMAL}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -375,6 +410,15 @@
<if test="productCount != null">
product_count = #{productCount,jdbcType=INTEGER},
</if>
<if test="discount != null">
discount = #{discount,jdbcType=DECIMAL},
</if>
<if test="discountAmount != null">
discount_amount = #{discountAmount,jdbcType=DECIMAL},
</if>
<if test="realPrice != null">
real_price = #{realPrice,jdbcType=DECIMAL},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
@ -395,7 +439,10 @@
price = #{price,jdbcType=DECIMAL},
purchase_price = #{purchasePrice,jdbcType=DECIMAL},
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL},
product_count = #{productCount,jdbcType=INTEGER}
product_count = #{productCount,jdbcType=INTEGER},
discount = #{discount,jdbcType=DECIMAL},
discount_amount = #{discountAmount,jdbcType=DECIMAL},
real_price = #{realPrice,jdbcType=DECIMAL}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save