袁野 2 years ago
parent 8cfcbf7e5e
commit 41b9b90fea
  1. 33
      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. 70
      hai-service/src/main/java/com/hai/entity/ApiMemberProductExample.java

@ -39,18 +39,20 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into api_member_product (type_id, brand_id, ",
"price, product_id, ",
"sort, operator_id, ",
"operator_name, create_time, ",
"update_time, `status`, ",
"ext_1, ext_2, ext_3)",
"values (#{typeId,jdbcType=INTEGER}, #{brandId,jdbcType=INTEGER}, ",
"#{price,jdbcType=DECIMAL}, #{productId,jdbcType=BIGINT}, ",
"#{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})"
"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)",
"values (#{name,jdbcType=VARCHAR}, #{typeId,jdbcType=INTEGER}, ",
"#{brandId,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, ",
"#{productId,jdbcType=BIGINT}, #{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);
@ -62,6 +64,7 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt {
@SelectProvider(type=ApiMemberProductSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@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),
@ -80,13 +83,14 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt {
@Select({
"select",
"id, type_id, brand_id, price, product_id, sort, operator_id, operator_name, ",
"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",
"from api_member_product",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@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),
@ -114,7 +118,8 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt {
@Update({
"update api_member_product",
"set type_id = #{typeId,jdbcType=INTEGER},",
"set `name` = #{name,jdbcType=VARCHAR},",
"type_id = #{typeId,jdbcType=INTEGER},",
"brand_id = #{brandId,jdbcType=INTEGER},",
"price = #{price,jdbcType=DECIMAL},",
"product_id = #{productId,jdbcType=BIGINT},",

@ -28,6 +28,10 @@ public class ApiMemberProductSqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("api_member_product");
if (record.getName() != null) {
sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}");
}
if (record.getTypeId() != null) {
sql.VALUES("type_id", "#{typeId,jdbcType=INTEGER}");
}
@ -90,6 +94,7 @@ public class ApiMemberProductSqlProvider {
} else {
sql.SELECT("id");
}
sql.SELECT("`name`");
sql.SELECT("type_id");
sql.SELECT("brand_id");
sql.SELECT("price");
@ -124,6 +129,10 @@ public class ApiMemberProductSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getName() != null) {
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
}
if (record.getTypeId() != null) {
sql.SET("type_id = #{record.typeId,jdbcType=INTEGER}");
}
@ -185,6 +194,7 @@ public class ApiMemberProductSqlProvider {
sql.UPDATE("api_member_product");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
sql.SET("type_id = #{record.typeId,jdbcType=INTEGER}");
sql.SET("brand_id = #{record.brandId,jdbcType=INTEGER}");
sql.SET("price = #{record.price,jdbcType=DECIMAL}");
@ -208,6 +218,10 @@ public class ApiMemberProductSqlProvider {
SQL sql = new SQL();
sql.UPDATE("api_member_product");
if (record.getName() != null) {
sql.SET("`name` = #{name,jdbcType=VARCHAR}");
}
if (record.getTypeId() != null) {
sql.SET("type_id = #{typeId,jdbcType=INTEGER}");
}

@ -19,6 +19,11 @@ public class ApiMemberProduct implements Serializable {
*/
private Long id;
/**
* 名称
*/
private String name;
/**
* 类别id
*/
@ -94,6 +99,14 @@ public class ApiMemberProduct implements Serializable {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getTypeId() {
return typeId;
}
@ -211,6 +224,7 @@ public class ApiMemberProduct implements Serializable {
}
ApiMemberProduct other = (ApiMemberProduct) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (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()))
@ -231,6 +245,7 @@ public class ApiMemberProduct implements Serializable {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getTypeId() == null) ? 0 : getTypeId().hashCode());
result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode());
result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
@ -254,6 +269,7 @@ public class ApiMemberProduct implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", typeId=").append(typeId);
sb.append(", brandId=").append(brandId);
sb.append(", price=").append(price);

@ -186,6 +186,76 @@ public class ApiMemberProductExample {
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andTypeIdIsNull() {
addCriterion("type_id is null");
return (Criteria) this;

Loading…
Cancel
Save