袁野 2 years ago
parent c9d7ef36e8
commit fe51cf5bdb
  1. 27
      hai-service/src/main/java/com/hai/dao/ApiMemberProductMapper.java
  2. 14
      hai-service/src/main/java/com/hai/dao/ApiMemberProductSqlProvider.java
  3. 16
      hai-service/src/main/java/com/hai/entity/ApiMemberProduct.java
  4. 60
      hai-service/src/main/java/com/hai/entity/ApiMemberProductExample.java

@ -41,18 +41,18 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt {
@Insert({
"insert into api_member_product (`name`, type_id, ",
"brand_id, price, ",
"product_id, sort, ",
"operator_id, operator_name, ",
"create_time, update_time, ",
"`status`, ext_1, ext_2, ",
"ext_3)",
"cost_price, product_id, ",
"sort, operator_id, ",
"operator_name, create_time, ",
"update_time, `status`, ",
"ext_1, ext_2, ext_3)",
"values (#{name,jdbcType=VARCHAR}, #{typeId,jdbcType=INTEGER}, ",
"#{brandId,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, ",
"#{productId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, ",
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
"#{costPrice,jdbcType=DECIMAL}, #{productId,jdbcType=VARCHAR}, ",
"#{sort,jdbcType=INTEGER}, #{operatorId,jdbcType=BIGINT}, ",
"#{operatorName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(ApiMemberProduct record);
@ -68,6 +68,7 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt {
@Result(column="type_id", property="typeId", jdbcType=JdbcType.INTEGER),
@Result(column="brand_id", property="brandId", jdbcType=JdbcType.INTEGER),
@Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
@Result(column="cost_price", property="costPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="product_id", property="productId", jdbcType=JdbcType.VARCHAR),
@Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
@ -83,8 +84,8 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt {
@Select({
"select",
"id, `name`, type_id, brand_id, price, product_id, sort, operator_id, operator_name, ",
"create_time, update_time, `status`, ext_1, ext_2, ext_3",
"id, `name`, type_id, brand_id, price, cost_price, product_id, sort, operator_id, ",
"operator_name, create_time, update_time, `status`, ext_1, ext_2, ext_3",
"from api_member_product",
"where id = #{id,jdbcType=BIGINT}"
})
@ -94,6 +95,7 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt {
@Result(column="type_id", property="typeId", jdbcType=JdbcType.INTEGER),
@Result(column="brand_id", property="brandId", jdbcType=JdbcType.INTEGER),
@Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
@Result(column="cost_price", property="costPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="product_id", property="productId", jdbcType=JdbcType.VARCHAR),
@Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
@ -122,6 +124,7 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt {
"type_id = #{typeId,jdbcType=INTEGER},",
"brand_id = #{brandId,jdbcType=INTEGER},",
"price = #{price,jdbcType=DECIMAL},",
"cost_price = #{costPrice,jdbcType=DECIMAL},",
"product_id = #{productId,jdbcType=VARCHAR},",
"sort = #{sort,jdbcType=INTEGER},",
"operator_id = #{operatorId,jdbcType=BIGINT},",

@ -44,6 +44,10 @@ public class ApiMemberProductSqlProvider {
sql.VALUES("price", "#{price,jdbcType=DECIMAL}");
}
if (record.getCostPrice() != null) {
sql.VALUES("cost_price", "#{costPrice,jdbcType=DECIMAL}");
}
if (record.getProductId() != null) {
sql.VALUES("product_id", "#{productId,jdbcType=VARCHAR}");
}
@ -98,6 +102,7 @@ public class ApiMemberProductSqlProvider {
sql.SELECT("type_id");
sql.SELECT("brand_id");
sql.SELECT("price");
sql.SELECT("cost_price");
sql.SELECT("product_id");
sql.SELECT("sort");
sql.SELECT("operator_id");
@ -145,6 +150,10 @@ public class ApiMemberProductSqlProvider {
sql.SET("price = #{record.price,jdbcType=DECIMAL}");
}
if (record.getCostPrice() != null) {
sql.SET("cost_price = #{record.costPrice,jdbcType=DECIMAL}");
}
if (record.getProductId() != null) {
sql.SET("product_id = #{record.productId,jdbcType=VARCHAR}");
}
@ -198,6 +207,7 @@ public class ApiMemberProductSqlProvider {
sql.SET("type_id = #{record.typeId,jdbcType=INTEGER}");
sql.SET("brand_id = #{record.brandId,jdbcType=INTEGER}");
sql.SET("price = #{record.price,jdbcType=DECIMAL}");
sql.SET("cost_price = #{record.costPrice,jdbcType=DECIMAL}");
sql.SET("product_id = #{record.productId,jdbcType=VARCHAR}");
sql.SET("sort = #{record.sort,jdbcType=INTEGER}");
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}");
@ -234,6 +244,10 @@ public class ApiMemberProductSqlProvider {
sql.SET("price = #{price,jdbcType=DECIMAL}");
}
if (record.getCostPrice() != null) {
sql.SET("cost_price = #{costPrice,jdbcType=DECIMAL}");
}
if (record.getProductId() != null) {
sql.SET("product_id = #{productId,jdbcType=VARCHAR}");
}

@ -39,6 +39,11 @@ public class ApiMemberProduct implements Serializable {
*/
private BigDecimal price;
/**
* 成本价
*/
private BigDecimal costPrice;
/**
* 产品id
*/
@ -131,6 +136,14 @@ public class ApiMemberProduct implements Serializable {
this.price = price;
}
public BigDecimal getCostPrice() {
return costPrice;
}
public void setCostPrice(BigDecimal costPrice) {
this.costPrice = costPrice;
}
public String getProductId() {
return productId;
}
@ -228,6 +241,7 @@ public class ApiMemberProduct implements Serializable {
&& (this.getTypeId() == null ? other.getTypeId() == null : this.getTypeId().equals(other.getTypeId()))
&& (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId()))
&& (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
&& (this.getCostPrice() == null ? other.getCostPrice() == null : this.getCostPrice().equals(other.getCostPrice()))
&& (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
&& (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort()))
&& (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId()))
@ -249,6 +263,7 @@ public class ApiMemberProduct implements Serializable {
result = prime * result + ((getTypeId() == null) ? 0 : getTypeId().hashCode());
result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode());
result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
result = prime * result + ((getCostPrice() == null) ? 0 : getCostPrice().hashCode());
result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode());
result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode());
@ -273,6 +288,7 @@ public class ApiMemberProduct implements Serializable {
sb.append(", typeId=").append(typeId);
sb.append(", brandId=").append(brandId);
sb.append(", price=").append(price);
sb.append(", costPrice=").append(costPrice);
sb.append(", productId=").append(productId);
sb.append(", sort=").append(sort);
sb.append(", operatorId=").append(operatorId);

@ -436,6 +436,66 @@ public class ApiMemberProductExample {
return (Criteria) this;
}
public Criteria andCostPriceIsNull() {
addCriterion("cost_price is null");
return (Criteria) this;
}
public Criteria andCostPriceIsNotNull() {
addCriterion("cost_price is not null");
return (Criteria) this;
}
public Criteria andCostPriceEqualTo(BigDecimal value) {
addCriterion("cost_price =", value, "costPrice");
return (Criteria) this;
}
public Criteria andCostPriceNotEqualTo(BigDecimal value) {
addCriterion("cost_price <>", value, "costPrice");
return (Criteria) this;
}
public Criteria andCostPriceGreaterThan(BigDecimal value) {
addCriterion("cost_price >", value, "costPrice");
return (Criteria) this;
}
public Criteria andCostPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("cost_price >=", value, "costPrice");
return (Criteria) this;
}
public Criteria andCostPriceLessThan(BigDecimal value) {
addCriterion("cost_price <", value, "costPrice");
return (Criteria) this;
}
public Criteria andCostPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("cost_price <=", value, "costPrice");
return (Criteria) this;
}
public Criteria andCostPriceIn(List<BigDecimal> values) {
addCriterion("cost_price in", values, "costPrice");
return (Criteria) this;
}
public Criteria andCostPriceNotIn(List<BigDecimal> values) {
addCriterion("cost_price not in", values, "costPrice");
return (Criteria) this;
}
public Criteria andCostPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("cost_price between", value1, value2, "costPrice");
return (Criteria) this;
}
public Criteria andCostPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("cost_price not between", value1, value2, "costPrice");
return (Criteria) this;
}
public Criteria andProductIdIsNull() {
addCriterion("product_id is null");
return (Criteria) this;

Loading…
Cancel
Save