提交修改

dev-discount
袁野 3 years ago
parent b5eb7f50a5
commit 3a28b9d4dc
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java
  2. 20
      hai-service/src/main/java/com/hai/dao/OutRechargePriceMapper.java
  3. 28
      hai-service/src/main/java/com/hai/dao/OutRechargePriceSqlProvider.java
  4. 47
      hai-service/src/main/java/com/hai/entity/OutRechargePrice.java
  5. 161
      hai-service/src/main/java/com/hai/entity/OutRechargePriceExample.java

@ -79,6 +79,7 @@ public class OutRechargePriceController {
if (outRechargePrice.getType() == null
|| outRechargePrice.getPrice() == null
|| outRechargePrice.getRealPrice() == null
|| outRechargePrice.getGoodsId() == null
) {
log.error("SecOrganizationController -> insertPrice() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
@ -106,6 +107,7 @@ public class OutRechargePriceController {
|| outRechargePrice.getId() == null
|| outRechargePrice.getPrice() == null
|| outRechargePrice.getRealPrice() == null
|| outRechargePrice.getGoodsId() == null
) {
log.error("SecOrganizationController -> updatePrice() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");

@ -40,9 +40,11 @@ public interface OutRechargePriceMapper extends OutRechargePriceMapperExt {
@Insert({
"insert into out_recharge_price (`type`, price, ",
"real_price, create_time)",
"real_price, create_time, ",
"goods_id, discount)",
"values (#{type,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, ",
"#{realPrice,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP})"
"#{realPrice,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{goodsId,jdbcType=BIGINT}, #{discount,jdbcType=REAL})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(OutRechargePrice record);
@ -57,13 +59,15 @@ public interface OutRechargePriceMapper extends OutRechargePriceMapperExt {
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
@Result(column="real_price", property="realPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT),
@Result(column="discount", property="discount", jdbcType=JdbcType.REAL)
})
List<OutRechargePrice> selectByExample(OutRechargePriceExample example);
@Select({
"select",
"id, `type`, price, real_price, create_time",
"id, `type`, price, real_price, create_time, goods_id, discount",
"from out_recharge_price",
"where id = #{id,jdbcType=BIGINT}"
})
@ -72,7 +76,9 @@ public interface OutRechargePriceMapper extends OutRechargePriceMapperExt {
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
@Result(column="real_price", property="realPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT),
@Result(column="discount", property="discount", jdbcType=JdbcType.REAL)
})
OutRechargePrice selectByPrimaryKey(Long id);
@ -90,7 +96,9 @@ public interface OutRechargePriceMapper extends OutRechargePriceMapperExt {
"set `type` = #{type,jdbcType=INTEGER},",
"price = #{price,jdbcType=DECIMAL},",
"real_price = #{realPrice,jdbcType=DECIMAL},",
"create_time = #{createTime,jdbcType=TIMESTAMP}",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"goods_id = #{goodsId,jdbcType=BIGINT},",
"discount = #{discount,jdbcType=REAL}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(OutRechargePrice record);

@ -44,6 +44,14 @@ public class OutRechargePriceSqlProvider {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getGoodsId() != null) {
sql.VALUES("goods_id", "#{goodsId,jdbcType=BIGINT}");
}
if (record.getDiscount() != null) {
sql.VALUES("discount", "#{discount,jdbcType=REAL}");
}
return sql.toString();
}
@ -58,6 +66,8 @@ public class OutRechargePriceSqlProvider {
sql.SELECT("price");
sql.SELECT("real_price");
sql.SELECT("create_time");
sql.SELECT("goods_id");
sql.SELECT("discount");
sql.FROM("out_recharge_price");
applyWhere(sql, example, false);
@ -95,6 +105,14 @@ public class OutRechargePriceSqlProvider {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getGoodsId() != null) {
sql.SET("goods_id = #{record.goodsId,jdbcType=BIGINT}");
}
if (record.getDiscount() != null) {
sql.SET("discount = #{record.discount,jdbcType=REAL}");
}
applyWhere(sql, example, true);
return sql.toString();
}
@ -108,6 +126,8 @@ public class OutRechargePriceSqlProvider {
sql.SET("price = #{record.price,jdbcType=DECIMAL}");
sql.SET("real_price = #{record.realPrice,jdbcType=DECIMAL}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("goods_id = #{record.goodsId,jdbcType=BIGINT}");
sql.SET("discount = #{record.discount,jdbcType=REAL}");
OutRechargePriceExample example = (OutRechargePriceExample) parameter.get("example");
applyWhere(sql, example, true);
@ -134,6 +154,14 @@ public class OutRechargePriceSqlProvider {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getGoodsId() != null) {
sql.SET("goods_id = #{goodsId,jdbcType=BIGINT}");
}
if (record.getDiscount() != null) {
sql.SET("discount = #{discount,jdbcType=REAL}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();

@ -1,6 +1,7 @@
package com.hai.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -26,18 +27,28 @@ public class OutRechargePrice implements Serializable {
/**
* 金额
*/
private Long price;
private BigDecimal price;
/**
* 实际金额
*/
private Long realPrice;
private BigDecimal realPrice;
/**
* 创建时间
*/
private Date createTime;
/**
* 商品ID
*/
private Long goodsId;
/**
* 折扣比例
*/
private Float discount;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -56,19 +67,19 @@ public class OutRechargePrice implements Serializable {
this.type = type;
}
public Long getPrice() {
public BigDecimal getPrice() {
return price;
}
public void setPrice(Long price) {
public void setPrice(BigDecimal price) {
this.price = price;
}
public Long getRealPrice() {
public BigDecimal getRealPrice() {
return realPrice;
}
public void setRealPrice(Long realPrice) {
public void setRealPrice(BigDecimal realPrice) {
this.realPrice = realPrice;
}
@ -80,6 +91,22 @@ public class OutRechargePrice implements Serializable {
this.createTime = createTime;
}
public Long getGoodsId() {
return goodsId;
}
public void setGoodsId(Long goodsId) {
this.goodsId = goodsId;
}
public Float getDiscount() {
return discount;
}
public void setDiscount(Float discount) {
this.discount = discount;
}
@Override
public boolean equals(Object that) {
if (this == that) {
@ -96,7 +123,9 @@ public class OutRechargePrice implements Serializable {
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
&& (this.getRealPrice() == null ? other.getRealPrice() == null : this.getRealPrice().equals(other.getRealPrice()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId()))
&& (this.getDiscount() == null ? other.getDiscount() == null : this.getDiscount().equals(other.getDiscount()));
}
@Override
@ -108,6 +137,8 @@ public class OutRechargePrice implements Serializable {
result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
result = prime * result + ((getRealPrice() == null) ? 0 : getRealPrice().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode());
result = prime * result + ((getDiscount() == null) ? 0 : getDiscount().hashCode());
return result;
}
@ -122,6 +153,8 @@ public class OutRechargePrice implements Serializable {
sb.append(", price=").append(price);
sb.append(", realPrice=").append(realPrice);
sb.append(", createTime=").append(createTime);
sb.append(", goodsId=").append(goodsId);
sb.append(", discount=").append(discount);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

@ -1,5 +1,6 @@
package com.hai.entity;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -255,52 +256,52 @@ public class OutRechargePriceExample {
return (Criteria) this;
}
public Criteria andPriceEqualTo(Long value) {
public Criteria andPriceEqualTo(BigDecimal value) {
addCriterion("price =", value, "price");
return (Criteria) this;
}
public Criteria andPriceNotEqualTo(Long value) {
public Criteria andPriceNotEqualTo(BigDecimal value) {
addCriterion("price <>", value, "price");
return (Criteria) this;
}
public Criteria andPriceGreaterThan(Long value) {
public Criteria andPriceGreaterThan(BigDecimal value) {
addCriterion("price >", value, "price");
return (Criteria) this;
}
public Criteria andPriceGreaterThanOrEqualTo(Long value) {
public Criteria andPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("price >=", value, "price");
return (Criteria) this;
}
public Criteria andPriceLessThan(Long value) {
public Criteria andPriceLessThan(BigDecimal value) {
addCriterion("price <", value, "price");
return (Criteria) this;
}
public Criteria andPriceLessThanOrEqualTo(Long value) {
public Criteria andPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("price <=", value, "price");
return (Criteria) this;
}
public Criteria andPriceIn(List<Long> values) {
public Criteria andPriceIn(List<BigDecimal> values) {
addCriterion("price in", values, "price");
return (Criteria) this;
}
public Criteria andPriceNotIn(List<Long> values) {
public Criteria andPriceNotIn(List<BigDecimal> values) {
addCriterion("price not in", values, "price");
return (Criteria) this;
}
public Criteria andPriceBetween(Long value1, Long value2) {
public Criteria andPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("price between", value1, value2, "price");
return (Criteria) this;
}
public Criteria andPriceNotBetween(Long value1, Long value2) {
public Criteria andPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("price not between", value1, value2, "price");
return (Criteria) this;
}
@ -315,52 +316,52 @@ public class OutRechargePriceExample {
return (Criteria) this;
}
public Criteria andRealPriceEqualTo(Long value) {
public Criteria andRealPriceEqualTo(BigDecimal value) {
addCriterion("real_price =", value, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceNotEqualTo(Long value) {
public Criteria andRealPriceNotEqualTo(BigDecimal value) {
addCriterion("real_price <>", value, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceGreaterThan(Long value) {
public Criteria andRealPriceGreaterThan(BigDecimal value) {
addCriterion("real_price >", value, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceGreaterThanOrEqualTo(Long value) {
public Criteria andRealPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("real_price >=", value, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceLessThan(Long value) {
public Criteria andRealPriceLessThan(BigDecimal value) {
addCriterion("real_price <", value, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceLessThanOrEqualTo(Long value) {
public Criteria andRealPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("real_price <=", value, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceIn(List<Long> values) {
public Criteria andRealPriceIn(List<BigDecimal> values) {
addCriterion("real_price in", values, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceNotIn(List<Long> values) {
public Criteria andRealPriceNotIn(List<BigDecimal> values) {
addCriterion("real_price not in", values, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceBetween(Long value1, Long value2) {
public Criteria andRealPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("real_price between", value1, value2, "realPrice");
return (Criteria) this;
}
public Criteria andRealPriceNotBetween(Long value1, Long value2) {
public Criteria andRealPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("real_price not between", value1, value2, "realPrice");
return (Criteria) this;
}
@ -424,6 +425,126 @@ public class OutRechargePriceExample {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andGoodsIdIsNull() {
addCriterion("goods_id is null");
return (Criteria) this;
}
public Criteria andGoodsIdIsNotNull() {
addCriterion("goods_id is not null");
return (Criteria) this;
}
public Criteria andGoodsIdEqualTo(Long value) {
addCriterion("goods_id =", value, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdNotEqualTo(Long value) {
addCriterion("goods_id <>", value, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdGreaterThan(Long value) {
addCriterion("goods_id >", value, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdGreaterThanOrEqualTo(Long value) {
addCriterion("goods_id >=", value, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdLessThan(Long value) {
addCriterion("goods_id <", value, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdLessThanOrEqualTo(Long value) {
addCriterion("goods_id <=", value, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdIn(List<Long> values) {
addCriterion("goods_id in", values, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdNotIn(List<Long> values) {
addCriterion("goods_id not in", values, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdBetween(Long value1, Long value2) {
addCriterion("goods_id between", value1, value2, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdNotBetween(Long value1, Long value2) {
addCriterion("goods_id not between", value1, value2, "goodsId");
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(Float value) {
addCriterion("discount =", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountNotEqualTo(Float value) {
addCriterion("discount <>", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountGreaterThan(Float value) {
addCriterion("discount >", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountGreaterThanOrEqualTo(Float value) {
addCriterion("discount >=", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountLessThan(Float value) {
addCriterion("discount <", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountLessThanOrEqualTo(Float value) {
addCriterion("discount <=", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountIn(List<Float> values) {
addCriterion("discount in", values, "discount");
return (Criteria) this;
}
public Criteria andDiscountNotIn(List<Float> values) {
addCriterion("discount not in", values, "discount");
return (Criteria) this;
}
public Criteria andDiscountBetween(Float value1, Float value2) {
addCriterion("discount between", value1, value2, "discount");
return (Criteria) this;
}
public Criteria andDiscountNotBetween(Float value1, Float value2) {
addCriterion("discount not between", value1, value2, "discount");
return (Criteria) this;
}
}
/**

Loading…
Cancel
Save