From e4154b53cb4f696b1d36d94a4abe872157313301 Mon Sep 17 00:00:00 2001 From: YuanYe <418471657@qq.com> Date: Tue, 24 Dec 2024 18:21:37 +0800 Subject: [PATCH] 1 --- .../main/java/com/hfkj/dao/BsOrderMapper.java | 17 ++++-- .../java/com/hfkj/dao/BsOrderSqlProvider.java | 14 +++++ .../main/java/com/hfkj/entity/BsOrder.java | 20 ++++++- .../java/com/hfkj/entity/BsOrderExample.java | 60 +++++++++++++++++++ 4 files changed, 103 insertions(+), 8 deletions(-) diff --git a/service/src/main/java/com/hfkj/dao/BsOrderMapper.java b/service/src/main/java/com/hfkj/dao/BsOrderMapper.java index 9e6377a..58e2f84 100644 --- a/service/src/main/java/com/hfkj/dao/BsOrderMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsOrderMapper.java @@ -49,7 +49,8 @@ public interface BsOrderMapper extends BsOrderMapperExt { "pay_time, finish_time, ", "cancel_time, refund_time, ", "order_status, remarks, ", - "ext_1, ext_2, ext_3)", + "ext_1, ext_2, ext_3, ", + "freight_price)", "values (#{userId,jdbcType=BIGINT}, #{userName,jdbcType=VARCHAR}, ", "#{userPhone,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ", "#{payChannel,jdbcType=INTEGER}, #{payChannelOrderNo,jdbcType=VARCHAR}, ", @@ -60,7 +61,8 @@ public interface BsOrderMapper extends BsOrderMapperExt { "#{payTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, ", "#{cancelTime,jdbcType=TIMESTAMP}, #{refundTime,jdbcType=TIMESTAMP}, ", "#{orderStatus,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ", + "#{freightPrice,jdbcType=DECIMAL})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(BsOrder record); @@ -94,7 +96,8 @@ public interface BsOrderMapper extends BsOrderMapperExt { @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), - @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR), + @Result(column="freight_price", property="freightPrice", jdbcType=JdbcType.DECIMAL) }) List selectByExample(BsOrderExample example); @@ -103,7 +106,7 @@ public interface BsOrderMapper extends BsOrderMapperExt { "id, user_id, user_name, user_phone, order_no, pay_channel, pay_channel_order_no, ", "pay_serial_no, pay_type, total_price, pay_real_price, payment, product_total_price, ", "create_time, update_time, pay_time, finish_time, cancel_time, refund_time, order_status, ", - "remarks, ext_1, ext_2, ext_3", + "remarks, ext_1, ext_2, ext_3, freight_price", "from bs_order", "where id = #{id,jdbcType=BIGINT}" }) @@ -131,7 +134,8 @@ public interface BsOrderMapper extends BsOrderMapperExt { @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), - @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR), + @Result(column="freight_price", property="freightPrice", jdbcType=JdbcType.DECIMAL) }) BsOrder selectByPrimaryKey(Long id); @@ -168,7 +172,8 @@ public interface BsOrderMapper extends BsOrderMapperExt { "remarks = #{remarks,jdbcType=VARCHAR},", "ext_1 = #{ext1,jdbcType=VARCHAR},", "ext_2 = #{ext2,jdbcType=VARCHAR},", - "ext_3 = #{ext3,jdbcType=VARCHAR}", + "ext_3 = #{ext3,jdbcType=VARCHAR},", + "freight_price = #{freightPrice,jdbcType=DECIMAL}", "where id = #{id,jdbcType=BIGINT}" }) int updateByPrimaryKey(BsOrder record); diff --git a/service/src/main/java/com/hfkj/dao/BsOrderSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsOrderSqlProvider.java index aa3e5b8..480dc0a 100644 --- a/service/src/main/java/com/hfkj/dao/BsOrderSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsOrderSqlProvider.java @@ -120,6 +120,10 @@ public class BsOrderSqlProvider { sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); } + if (record.getFreightPrice() != null) { + sql.VALUES("freight_price", "#{freightPrice,jdbcType=DECIMAL}"); + } + return sql.toString(); } @@ -153,6 +157,7 @@ public class BsOrderSqlProvider { sql.SELECT("ext_1"); sql.SELECT("ext_2"); sql.SELECT("ext_3"); + sql.SELECT("freight_price"); sql.FROM("bs_order"); applyWhere(sql, example, false); @@ -266,6 +271,10 @@ public class BsOrderSqlProvider { sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); } + if (record.getFreightPrice() != null) { + sql.SET("freight_price = #{record.freightPrice,jdbcType=DECIMAL}"); + } + applyWhere(sql, example, true); return sql.toString(); } @@ -298,6 +307,7 @@ public class BsOrderSqlProvider { sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + sql.SET("freight_price = #{record.freightPrice,jdbcType=DECIMAL}"); BsOrderExample example = (BsOrderExample) parameter.get("example"); applyWhere(sql, example, true); @@ -400,6 +410,10 @@ public class BsOrderSqlProvider { sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); } + if (record.getFreightPrice() != null) { + sql.SET("freight_price = #{freightPrice,jdbcType=DECIMAL}"); + } + sql.WHERE("id = #{id,jdbcType=BIGINT}"); return sql.toString(); diff --git a/service/src/main/java/com/hfkj/entity/BsOrder.java b/service/src/main/java/com/hfkj/entity/BsOrder.java index cfee38b..dcfb826 100644 --- a/service/src/main/java/com/hfkj/entity/BsOrder.java +++ b/service/src/main/java/com/hfkj/entity/BsOrder.java @@ -65,7 +65,7 @@ public class BsOrder implements Serializable { private BigDecimal totalPrice; /** - * 应付金额 + * 实付金额 */ private BigDecimal payRealPrice; @@ -125,6 +125,11 @@ public class BsOrder implements Serializable { private String ext3; + /** + * 运费 + */ + private BigDecimal freightPrice; + private static final long serialVersionUID = 1L; public Long getId() { @@ -319,6 +324,14 @@ public class BsOrder implements Serializable { this.ext3 = ext3; } + public BigDecimal getFreightPrice() { + return freightPrice; + } + + public void setFreightPrice(BigDecimal freightPrice) { + this.freightPrice = freightPrice; + } + @Override public boolean equals(Object that) { if (this == that) { @@ -354,7 +367,8 @@ public class BsOrder implements Serializable { && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks())) && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) - && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())) + && (this.getFreightPrice() == null ? other.getFreightPrice() == null : this.getFreightPrice().equals(other.getFreightPrice())); } @Override @@ -385,6 +399,7 @@ public class BsOrder implements Serializable { result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + result = prime * result + ((getFreightPrice() == null) ? 0 : getFreightPrice().hashCode()); return result; } @@ -418,6 +433,7 @@ public class BsOrder implements Serializable { sb.append(", ext1=").append(ext1); sb.append(", ext2=").append(ext2); sb.append(", ext3=").append(ext3); + sb.append(", freightPrice=").append(freightPrice); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); diff --git a/service/src/main/java/com/hfkj/entity/BsOrderExample.java b/service/src/main/java/com/hfkj/entity/BsOrderExample.java index 9c98c82..1bdd0e6 100644 --- a/service/src/main/java/com/hfkj/entity/BsOrderExample.java +++ b/service/src/main/java/com/hfkj/entity/BsOrderExample.java @@ -1655,6 +1655,66 @@ public class BsOrderExample { addCriterion("ext_3 not between", value1, value2, "ext3"); return (Criteria) this; } + + public Criteria andFreightPriceIsNull() { + addCriterion("freight_price is null"); + return (Criteria) this; + } + + public Criteria andFreightPriceIsNotNull() { + addCriterion("freight_price is not null"); + return (Criteria) this; + } + + public Criteria andFreightPriceEqualTo(BigDecimal value) { + addCriterion("freight_price =", value, "freightPrice"); + return (Criteria) this; + } + + public Criteria andFreightPriceNotEqualTo(BigDecimal value) { + addCriterion("freight_price <>", value, "freightPrice"); + return (Criteria) this; + } + + public Criteria andFreightPriceGreaterThan(BigDecimal value) { + addCriterion("freight_price >", value, "freightPrice"); + return (Criteria) this; + } + + public Criteria andFreightPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("freight_price >=", value, "freightPrice"); + return (Criteria) this; + } + + public Criteria andFreightPriceLessThan(BigDecimal value) { + addCriterion("freight_price <", value, "freightPrice"); + return (Criteria) this; + } + + public Criteria andFreightPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("freight_price <=", value, "freightPrice"); + return (Criteria) this; + } + + public Criteria andFreightPriceIn(List values) { + addCriterion("freight_price in", values, "freightPrice"); + return (Criteria) this; + } + + public Criteria andFreightPriceNotIn(List values) { + addCriterion("freight_price not in", values, "freightPrice"); + return (Criteria) this; + } + + public Criteria andFreightPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("freight_price between", value1, value2, "freightPrice"); + return (Criteria) this; + } + + public Criteria andFreightPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("freight_price not between", value1, value2, "freightPrice"); + return (Criteria) this; + } } /**