Commit ac94eea4 authored by shiyu's avatar shiyu

计算平台佣金的新逻辑

parent c18c027e
package com.wwdz.ch.core.consts;
/**
* 账单类的枚举
*/
public class BillEnum {
/**
* 用户账户明细的状态
*/
public enum AccountDetailStateEnum {
ENTRY(1, "已入账"),
WAIT_ENTRY(0, "待入账"),
INVALID(-1, "无效"),
;
private int code;
private String des;
AccountDetailStateEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (BillEnum.AccountDetailStateEnum accountDetailStateEnum : BillEnum.AccountDetailStateEnum.values()) {
if (code == accountDetailStateEnum.getCode()) {
return accountDetailStateEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
/**
* 用户账户明细的类型
*/
public enum AccountDetailTypeEnum {
ORDER(1, "订单收入"),
CHANNEL(2, "平台佣金"),
INTRODUCE(3, "介绍佣金"),
;
private int code;
private String des;
AccountDetailTypeEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (BillEnum.AccountDetailTypeEnum accountDetailTypeEnum : BillEnum.AccountDetailTypeEnum.values()) {
if (code == accountDetailTypeEnum.getCode()) {
return accountDetailTypeEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
/**
* 用户账户明细收支类型
*/
public enum FundTypeEnum {
INCOME(1, "收入"),
EXPENDITURE(-1, "支出"),
;
private int code;
private String des;
FundTypeEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (BillEnum.FundTypeEnum fundTypeEnum : BillEnum.FundTypeEnum.values()) {
if (code == fundTypeEnum.getCode()) {
return fundTypeEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
}
package com.wwdz.ch.core.consts; package com.wwdz.ch.core.consts;
import tk.mybatis.spring.mapper.SpringBootBindUtil;
import java.math.BigDecimal;
/** /**
* 一些常用的参数定义 * 一些常用的参数定义
* *
...@@ -84,4 +88,9 @@ public interface CommConsts { ...@@ -84,4 +88,9 @@ public interface CommConsts {
* 消息跳转专场拍品详情 * 消息跳转专场拍品详情
*/ */
public final static String ITEM_OF_SPECIAL_PERFORMANCE_URL = "/pages/saleAuctionDetail/index"; public final static String ITEM_OF_SPECIAL_PERFORMANCE_URL = "/pages/saleAuctionDetail/index";
/**
* 微信手续费,按照最高的1%计算
*/
public final static double WX_COMMISSION_REBATE = 0.01;
} }
...@@ -4,16 +4,14 @@ import java.io.Serializable; ...@@ -4,16 +4,14 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data; import lombok.Data;
/** /**
* @author shiyu * @author shiyu
* @date 2024/05/14 * @date 2024/07/10
*/ */
@Data @Data
public class DistributorProfit implements Entity { public class DistributorProfit implements Serializable {
private Long id; private Long id;
/** /**
...@@ -41,6 +39,11 @@ public class DistributorProfit implements Entity { ...@@ -41,6 +39,11 @@ public class DistributorProfit implements Entity {
*/ */
private Long amount; private Long amount;
/**
* 实际到账金额
*/
private Long realAmount;
/** /**
* 商品成本,供货价 * 商品成本,供货价
*/ */
...@@ -90,6 +93,7 @@ public class DistributorProfit implements Entity { ...@@ -90,6 +93,7 @@ public class DistributorProfit implements Entity {
sb.append(", itemId=").append(itemId); sb.append(", itemId=").append(itemId);
sb.append(", itemNum=").append(itemNum); sb.append(", itemNum=").append(itemNum);
sb.append(", amount=").append(amount); sb.append(", amount=").append(amount);
sb.append(", realAmount=").append(realAmount);
sb.append(", itemCost=").append(itemCost); sb.append(", itemCost=").append(itemCost);
sb.append(", channelCost=").append(channelCost); sb.append(", channelCost=").append(channelCost);
sb.append(", introduceCost=").append(introduceCost); sb.append(", introduceCost=").append(introduceCost);
...@@ -120,6 +124,7 @@ public class DistributorProfit implements Entity { ...@@ -120,6 +124,7 @@ public class DistributorProfit implements Entity {
&& (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId())) && (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
&& (this.getItemNum() == null ? other.getItemNum() == null : this.getItemNum().equals(other.getItemNum())) && (this.getItemNum() == null ? other.getItemNum() == null : this.getItemNum().equals(other.getItemNum()))
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount())) && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
&& (this.getRealAmount() == null ? other.getRealAmount() == null : this.getRealAmount().equals(other.getRealAmount()))
&& (this.getItemCost() == null ? other.getItemCost() == null : this.getItemCost().equals(other.getItemCost())) && (this.getItemCost() == null ? other.getItemCost() == null : this.getItemCost().equals(other.getItemCost()))
&& (this.getChannelCost() == null ? other.getChannelCost() == null : this.getChannelCost().equals(other.getChannelCost())) && (this.getChannelCost() == null ? other.getChannelCost() == null : this.getChannelCost().equals(other.getChannelCost()))
&& (this.getIntroduceCost() == null ? other.getIntroduceCost() == null : this.getIntroduceCost().equals(other.getIntroduceCost())) && (this.getIntroduceCost() == null ? other.getIntroduceCost() == null : this.getIntroduceCost().equals(other.getIntroduceCost()))
...@@ -139,6 +144,7 @@ public class DistributorProfit implements Entity { ...@@ -139,6 +144,7 @@ public class DistributorProfit implements Entity {
result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode()); result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
result = prime * result + ((getItemNum() == null) ? 0 : getItemNum().hashCode()); result = prime * result + ((getItemNum() == null) ? 0 : getItemNum().hashCode());
result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode()); result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
result = prime * result + ((getRealAmount() == null) ? 0 : getRealAmount().hashCode());
result = prime * result + ((getItemCost() == null) ? 0 : getItemCost().hashCode()); result = prime * result + ((getItemCost() == null) ? 0 : getItemCost().hashCode());
result = prime * result + ((getChannelCost() == null) ? 0 : getChannelCost().hashCode()); result = prime * result + ((getChannelCost() == null) ? 0 : getChannelCost().hashCode());
result = prime * result + ((getIntroduceCost() == null) ? 0 : getIntroduceCost().hashCode()); result = prime * result + ((getIntroduceCost() == null) ? 0 : getIntroduceCost().hashCode());
...@@ -163,6 +169,7 @@ public class DistributorProfit implements Entity { ...@@ -163,6 +169,7 @@ public class DistributorProfit implements Entity {
itemId("item_id", "itemId", "BIGINT", false), itemId("item_id", "itemId", "BIGINT", false),
itemNum("item_num", "itemNum", "INTEGER", false), itemNum("item_num", "itemNum", "INTEGER", false),
amount("amount", "amount", "BIGINT", false), amount("amount", "amount", "BIGINT", false),
realAmount("real_amount", "realAmount", "BIGINT", false),
itemCost("item_cost", "itemCost", "BIGINT", false), itemCost("item_cost", "itemCost", "BIGINT", false),
channelCost("channel_cost", "channelCost", "BIGINT", false), channelCost("channel_cost", "channelCost", "BIGINT", false),
introduceCost("introduce_cost", "introduceCost", "BIGINT", false), introduceCost("introduce_cost", "introduceCost", "BIGINT", false),
......
...@@ -950,6 +950,138 @@ public class DistributorProfitExample { ...@@ -950,6 +950,138 @@ public class DistributorProfitExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRealAmountIsNull() {
addCriterion("real_amount is null");
return (Criteria) this;
}
public Criteria andRealAmountIsNotNull() {
addCriterion("real_amount is not null");
return (Criteria) this;
}
public Criteria andRealAmountEqualTo(Long value) {
addCriterion("real_amount =", value, "realAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distributor_profit
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRealAmountEqualToColumn(DistributorProfit.Column column) {
addCriterion(new StringBuilder("real_amount = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRealAmountNotEqualTo(Long value) {
addCriterion("real_amount <>", value, "realAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distributor_profit
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRealAmountNotEqualToColumn(DistributorProfit.Column column) {
addCriterion(new StringBuilder("real_amount <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRealAmountGreaterThan(Long value) {
addCriterion("real_amount >", value, "realAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distributor_profit
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRealAmountGreaterThanColumn(DistributorProfit.Column column) {
addCriterion(new StringBuilder("real_amount > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRealAmountGreaterThanOrEqualTo(Long value) {
addCriterion("real_amount >=", value, "realAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distributor_profit
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRealAmountGreaterThanOrEqualToColumn(DistributorProfit.Column column) {
addCriterion(new StringBuilder("real_amount >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRealAmountLessThan(Long value) {
addCriterion("real_amount <", value, "realAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distributor_profit
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRealAmountLessThanColumn(DistributorProfit.Column column) {
addCriterion(new StringBuilder("real_amount < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRealAmountLessThanOrEqualTo(Long value) {
addCriterion("real_amount <=", value, "realAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table distributor_profit
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRealAmountLessThanOrEqualToColumn(DistributorProfit.Column column) {
addCriterion(new StringBuilder("real_amount <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRealAmountIn(List<Long> values) {
addCriterion("real_amount in", values, "realAmount");
return (Criteria) this;
}
public Criteria andRealAmountNotIn(List<Long> values) {
addCriterion("real_amount not in", values, "realAmount");
return (Criteria) this;
}
public Criteria andRealAmountBetween(Long value1, Long value2) {
addCriterion("real_amount between", value1, value2, "realAmount");
return (Criteria) this;
}
public Criteria andRealAmountNotBetween(Long value1, Long value2) {
addCriterion("real_amount not between", value1, value2, "realAmount");
return (Criteria) this;
}
public Criteria andItemCostIsNull() { public Criteria andItemCostIsNull() {
addCriterion("item_cost is null"); addCriterion("item_cost is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -10,7 +10,7 @@ import lombok.Data; ...@@ -10,7 +10,7 @@ import lombok.Data;
/** /**
* @author shiyu * @author shiyu
* @date 2024/07/08 * @date 2024/07/10
*/ */
@Data @Data
public class UserAccountDetail implements Entity { public class UserAccountDetail implements Entity {
...@@ -22,9 +22,14 @@ public class UserAccountDetail implements Entity { ...@@ -22,9 +22,14 @@ public class UserAccountDetail implements Entity {
private Long userId; private Long userId;
/** /**
* 订单id * 交易id
*/ */
private String orderId; private String transactionId;
/**
* 金额
*/
private Long amount;
/** /**
* 收入或支出的类型 * 收入或支出的类型
...@@ -37,12 +42,12 @@ public class UserAccountDetail implements Entity { ...@@ -37,12 +42,12 @@ public class UserAccountDetail implements Entity {
private Integer fundType; private Integer fundType;
/** /**
* 状态 * 状态:待入账;已入账;无效
*/ */
private Integer state; private Integer state;
/** /**
* 创建时间 * 创建时间(订单创建时间)
*/ */
private Date createTime; private Date createTime;
...@@ -61,7 +66,8 @@ public class UserAccountDetail implements Entity { ...@@ -61,7 +66,8 @@ public class UserAccountDetail implements Entity {
sb.append("Hash = ").append(hashCode()); sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", userId=").append(userId); sb.append(", userId=").append(userId);
sb.append(", orderId=").append(orderId); sb.append(", transactionId=").append(transactionId);
sb.append(", amount=").append(amount);
sb.append(", type=").append(type); sb.append(", type=").append(type);
sb.append(", fundType=").append(fundType); sb.append(", fundType=").append(fundType);
sb.append(", state=").append(state); sb.append(", state=").append(state);
...@@ -86,7 +92,8 @@ public class UserAccountDetail implements Entity { ...@@ -86,7 +92,8 @@ public class UserAccountDetail implements Entity {
UserAccountDetail other = (UserAccountDetail) that; UserAccountDetail other = (UserAccountDetail) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId())) && (this.getTransactionId() == null ? other.getTransactionId() == null : this.getTransactionId().equals(other.getTransactionId()))
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getFundType() == null ? other.getFundType() == null : this.getFundType().equals(other.getFundType())) && (this.getFundType() == null ? other.getFundType() == null : this.getFundType().equals(other.getFundType()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState())) && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
...@@ -100,7 +107,8 @@ public class UserAccountDetail implements Entity { ...@@ -100,7 +107,8 @@ public class UserAccountDetail implements Entity {
int result = 1; int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode()); result = prime * result + ((getTransactionId() == null) ? 0 : getTransactionId().hashCode());
result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getFundType() == null) ? 0 : getFundType().hashCode()); result = prime * result + ((getFundType() == null) ? 0 : getFundType().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode()); result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
...@@ -119,7 +127,8 @@ public class UserAccountDetail implements Entity { ...@@ -119,7 +127,8 @@ public class UserAccountDetail implements Entity {
public enum Column { public enum Column {
id("id", "id", "BIGINT", false), id("id", "id", "BIGINT", false),
userId("user_id", "userId", "BIGINT", false), userId("user_id", "userId", "BIGINT", false),
orderId("order_id", "orderId", "VARCHAR", false), transactionId("transaction_id", "transactionId", "VARCHAR", false),
amount("amount", "amount", "BIGINT", false),
type("type", "type", "INTEGER", true), type("type", "type", "INTEGER", true),
fundType("fund_type", "fundType", "INTEGER", false), fundType("fund_type", "fundType", "INTEGER", false),
state("state", "state", "INTEGER", true), state("state", "state", "INTEGER", true),
......
...@@ -412,18 +412,18 @@ public class UserAccountDetailExample { ...@@ -412,18 +412,18 @@ public class UserAccountDetailExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdIsNull() { public Criteria andTransactionIdIsNull() {
addCriterion("order_id is null"); addCriterion("transaction_id is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdIsNotNull() { public Criteria andTransactionIdIsNotNull() {
addCriterion("order_id is not null"); addCriterion("transaction_id is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdEqualTo(String value) { public Criteria andTransactionIdEqualTo(String value) {
addCriterion("order_id =", value, "orderId"); addCriterion("transaction_id =", value, "transactionId");
return (Criteria) this; return (Criteria) this;
} }
...@@ -434,13 +434,13 @@ public class UserAccountDetailExample { ...@@ -434,13 +434,13 @@ public class UserAccountDetailExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andOrderIdEqualToColumn(UserAccountDetail.Column column) { public Criteria andTransactionIdEqualToColumn(UserAccountDetail.Column column) {
addCriterion(new StringBuilder("order_id = ").append(column.getEscapedColumnName()).toString()); addCriterion(new StringBuilder("transaction_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdNotEqualTo(String value) { public Criteria andTransactionIdNotEqualTo(String value) {
addCriterion("order_id <>", value, "orderId"); addCriterion("transaction_id <>", value, "transactionId");
return (Criteria) this; return (Criteria) this;
} }
...@@ -451,13 +451,13 @@ public class UserAccountDetailExample { ...@@ -451,13 +451,13 @@ public class UserAccountDetailExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andOrderIdNotEqualToColumn(UserAccountDetail.Column column) { public Criteria andTransactionIdNotEqualToColumn(UserAccountDetail.Column column) {
addCriterion(new StringBuilder("order_id <> ").append(column.getEscapedColumnName()).toString()); addCriterion(new StringBuilder("transaction_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdGreaterThan(String value) { public Criteria andTransactionIdGreaterThan(String value) {
addCriterion("order_id >", value, "orderId"); addCriterion("transaction_id >", value, "transactionId");
return (Criteria) this; return (Criteria) this;
} }
...@@ -468,13 +468,13 @@ public class UserAccountDetailExample { ...@@ -468,13 +468,13 @@ public class UserAccountDetailExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andOrderIdGreaterThanColumn(UserAccountDetail.Column column) { public Criteria andTransactionIdGreaterThanColumn(UserAccountDetail.Column column) {
addCriterion(new StringBuilder("order_id > ").append(column.getEscapedColumnName()).toString()); addCriterion(new StringBuilder("transaction_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdGreaterThanOrEqualTo(String value) { public Criteria andTransactionIdGreaterThanOrEqualTo(String value) {
addCriterion("order_id >=", value, "orderId"); addCriterion("transaction_id >=", value, "transactionId");
return (Criteria) this; return (Criteria) this;
} }
...@@ -485,13 +485,13 @@ public class UserAccountDetailExample { ...@@ -485,13 +485,13 @@ public class UserAccountDetailExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andOrderIdGreaterThanOrEqualToColumn(UserAccountDetail.Column column) { public Criteria andTransactionIdGreaterThanOrEqualToColumn(UserAccountDetail.Column column) {
addCriterion(new StringBuilder("order_id >= ").append(column.getEscapedColumnName()).toString()); addCriterion(new StringBuilder("transaction_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdLessThan(String value) { public Criteria andTransactionIdLessThan(String value) {
addCriterion("order_id <", value, "orderId"); addCriterion("transaction_id <", value, "transactionId");
return (Criteria) this; return (Criteria) this;
} }
...@@ -502,13 +502,13 @@ public class UserAccountDetailExample { ...@@ -502,13 +502,13 @@ public class UserAccountDetailExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andOrderIdLessThanColumn(UserAccountDetail.Column column) { public Criteria andTransactionIdLessThanColumn(UserAccountDetail.Column column) {
addCriterion(new StringBuilder("order_id < ").append(column.getEscapedColumnName()).toString()); addCriterion(new StringBuilder("transaction_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdLessThanOrEqualTo(String value) { public Criteria andTransactionIdLessThanOrEqualTo(String value) {
addCriterion("order_id <=", value, "orderId"); addCriterion("transaction_id <=", value, "transactionId");
return (Criteria) this; return (Criteria) this;
} }
...@@ -519,38 +519,170 @@ public class UserAccountDetailExample { ...@@ -519,38 +519,170 @@ public class UserAccountDetailExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andOrderIdLessThanOrEqualToColumn(UserAccountDetail.Column column) { public Criteria andTransactionIdLessThanOrEqualToColumn(UserAccountDetail.Column column) {
addCriterion(new StringBuilder("order_id <= ").append(column.getEscapedColumnName()).toString()); addCriterion(new StringBuilder("transaction_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdLike(String value) { public Criteria andTransactionIdLike(String value) {
addCriterion("order_id like", value, "orderId"); addCriterion("transaction_id like", value, "transactionId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdNotLike(String value) { public Criteria andTransactionIdNotLike(String value) {
addCriterion("order_id not like", value, "orderId"); addCriterion("transaction_id not like", value, "transactionId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdIn(List<String> values) { public Criteria andTransactionIdIn(List<String> values) {
addCriterion("order_id in", values, "orderId"); addCriterion("transaction_id in", values, "transactionId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdNotIn(List<String> values) { public Criteria andTransactionIdNotIn(List<String> values) {
addCriterion("order_id not in", values, "orderId"); addCriterion("transaction_id not in", values, "transactionId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdBetween(String value1, String value2) { public Criteria andTransactionIdBetween(String value1, String value2) {
addCriterion("order_id between", value1, value2, "orderId"); addCriterion("transaction_id between", value1, value2, "transactionId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrderIdNotBetween(String value1, String value2) { public Criteria andTransactionIdNotBetween(String value1, String value2) {
addCriterion("order_id not between", value1, value2, "orderId"); addCriterion("transaction_id not between", value1, value2, "transactionId");
return (Criteria) this;
}
public Criteria andAmountIsNull() {
addCriterion("amount is null");
return (Criteria) this;
}
public Criteria andAmountIsNotNull() {
addCriterion("amount is not null");
return (Criteria) this;
}
public Criteria andAmountEqualTo(Long value) {
addCriterion("amount =", value, "amount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account_detail
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAmountEqualToColumn(UserAccountDetail.Column column) {
addCriterion(new StringBuilder("amount = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAmountNotEqualTo(Long value) {
addCriterion("amount <>", value, "amount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account_detail
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAmountNotEqualToColumn(UserAccountDetail.Column column) {
addCriterion(new StringBuilder("amount <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAmountGreaterThan(Long value) {
addCriterion("amount >", value, "amount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account_detail
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAmountGreaterThanColumn(UserAccountDetail.Column column) {
addCriterion(new StringBuilder("amount > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAmountGreaterThanOrEqualTo(Long value) {
addCriterion("amount >=", value, "amount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account_detail
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAmountGreaterThanOrEqualToColumn(UserAccountDetail.Column column) {
addCriterion(new StringBuilder("amount >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAmountLessThan(Long value) {
addCriterion("amount <", value, "amount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account_detail
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAmountLessThanColumn(UserAccountDetail.Column column) {
addCriterion(new StringBuilder("amount < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAmountLessThanOrEqualTo(Long value) {
addCriterion("amount <=", value, "amount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account_detail
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAmountLessThanOrEqualToColumn(UserAccountDetail.Column column) {
addCriterion(new StringBuilder("amount <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAmountIn(List<Long> values) {
addCriterion("amount in", values, "amount");
return (Criteria) this;
}
public Criteria andAmountNotIn(List<Long> values) {
addCriterion("amount not in", values, "amount");
return (Criteria) this;
}
public Criteria andAmountBetween(Long value1, Long value2) {
addCriterion("amount between", value1, value2, "amount");
return (Criteria) this;
}
public Criteria andAmountNotBetween(Long value1, Long value2) {
addCriterion("amount not between", value1, value2, "amount");
return (Criteria) this; return (Criteria) this;
} }
......
package com.wwdz.ch.db.domain.distribution;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2024/07/10
*/
@Data
public class UserBill implements Entity {
private Integer id;
/**
* 账单id
*/
private String billId;
/**
* 账期
*/
private String accountPeriod;
/**
* 用户id
*/
private Long userId;
/**
* 总入账金额
*/
private Long totalEntryAmount;
/**
* 总待入账金额
*/
private Long totalWaitEntryAmount;
/**
* 订单入账金额
*/
private Long orderEntryAmount;
/**
* 订单待入账金额
*/
private Long orderWaitEntryAmount;
/**
* 介绍佣金入账金额
*/
private Long introduceEntryAmount;
/**
* 介绍佣金待入账金额
*/
private Long introduceWaitEntryAmount;
/**
* 状态
*/
private Integer state;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", billId=").append(billId);
sb.append(", accountPeriod=").append(accountPeriod);
sb.append(", userId=").append(userId);
sb.append(", totalEntryAmount=").append(totalEntryAmount);
sb.append(", totalWaitEntryAmount=").append(totalWaitEntryAmount);
sb.append(", orderEntryAmount=").append(orderEntryAmount);
sb.append(", orderWaitEntryAmount=").append(orderWaitEntryAmount);
sb.append(", introduceEntryAmount=").append(introduceEntryAmount);
sb.append(", introduceWaitEntryAmount=").append(introduceWaitEntryAmount);
sb.append(", state=").append(state);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
UserBill other = (UserBill) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getBillId() == null ? other.getBillId() == null : this.getBillId().equals(other.getBillId()))
&& (this.getAccountPeriod() == null ? other.getAccountPeriod() == null : this.getAccountPeriod().equals(other.getAccountPeriod()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getTotalEntryAmount() == null ? other.getTotalEntryAmount() == null : this.getTotalEntryAmount().equals(other.getTotalEntryAmount()))
&& (this.getTotalWaitEntryAmount() == null ? other.getTotalWaitEntryAmount() == null : this.getTotalWaitEntryAmount().equals(other.getTotalWaitEntryAmount()))
&& (this.getOrderEntryAmount() == null ? other.getOrderEntryAmount() == null : this.getOrderEntryAmount().equals(other.getOrderEntryAmount()))
&& (this.getOrderWaitEntryAmount() == null ? other.getOrderWaitEntryAmount() == null : this.getOrderWaitEntryAmount().equals(other.getOrderWaitEntryAmount()))
&& (this.getIntroduceEntryAmount() == null ? other.getIntroduceEntryAmount() == null : this.getIntroduceEntryAmount().equals(other.getIntroduceEntryAmount()))
&& (this.getIntroduceWaitEntryAmount() == null ? other.getIntroduceWaitEntryAmount() == null : this.getIntroduceWaitEntryAmount().equals(other.getIntroduceWaitEntryAmount()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getBillId() == null) ? 0 : getBillId().hashCode());
result = prime * result + ((getAccountPeriod() == null) ? 0 : getAccountPeriod().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getTotalEntryAmount() == null) ? 0 : getTotalEntryAmount().hashCode());
result = prime * result + ((getTotalWaitEntryAmount() == null) ? 0 : getTotalWaitEntryAmount().hashCode());
result = prime * result + ((getOrderEntryAmount() == null) ? 0 : getOrderEntryAmount().hashCode());
result = prime * result + ((getOrderWaitEntryAmount() == null) ? 0 : getOrderWaitEntryAmount().hashCode());
result = prime * result + ((getIntroduceEntryAmount() == null) ? 0 : getIntroduceEntryAmount().hashCode());
result = prime * result + ((getIntroduceWaitEntryAmount() == null) ? 0 : getIntroduceWaitEntryAmount().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
billId("bill_id", "billId", "VARCHAR", false),
accountPeriod("account_period", "accountPeriod", "VARCHAR", false),
userId("user_id", "userId", "BIGINT", false),
totalEntryAmount("total_entry_amount", "totalEntryAmount", "BIGINT", false),
totalWaitEntryAmount("total_wait_entry_amount", "totalWaitEntryAmount", "BIGINT", false),
orderEntryAmount("order_entry_amount", "orderEntryAmount", "BIGINT", false),
orderWaitEntryAmount("order_wait_entry_amount", "orderWaitEntryAmount", "BIGINT", false),
introduceEntryAmount("introduce_entry_amount", "introduceEntryAmount", "BIGINT", false),
introduceWaitEntryAmount("introduce_wait_entry_amount", "introduceWaitEntryAmount", "BIGINT", false),
state("state", "state", "INTEGER", true);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
package com.wwdz.ch.db.domain.distribution;
import java.util.ArrayList;
import java.util.List;
public class UserBillExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public UserBillExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public UserBillExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public UserBillExample orderBy(String ... orderByClauses) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < orderByClauses.length; i++) {
sb.append(orderByClauses[i]);
if (i < orderByClauses.length - 1) {
sb.append(" , ");
}
}
this.setOrderByClause(sb.toString());
return this;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria(this);
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
UserBillExample example = new UserBillExample();
return example.createCriteria();
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andBillIdIsNull() {
addCriterion("bill_id is null");
return (Criteria) this;
}
public Criteria andBillIdIsNotNull() {
addCriterion("bill_id is not null");
return (Criteria) this;
}
public Criteria andBillIdEqualTo(String value) {
addCriterion("bill_id =", value, "billId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBillIdEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("bill_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBillIdNotEqualTo(String value) {
addCriterion("bill_id <>", value, "billId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBillIdNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("bill_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBillIdGreaterThan(String value) {
addCriterion("bill_id >", value, "billId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBillIdGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("bill_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBillIdGreaterThanOrEqualTo(String value) {
addCriterion("bill_id >=", value, "billId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBillIdGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("bill_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBillIdLessThan(String value) {
addCriterion("bill_id <", value, "billId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBillIdLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("bill_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBillIdLessThanOrEqualTo(String value) {
addCriterion("bill_id <=", value, "billId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBillIdLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("bill_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBillIdLike(String value) {
addCriterion("bill_id like", value, "billId");
return (Criteria) this;
}
public Criteria andBillIdNotLike(String value) {
addCriterion("bill_id not like", value, "billId");
return (Criteria) this;
}
public Criteria andBillIdIn(List<String> values) {
addCriterion("bill_id in", values, "billId");
return (Criteria) this;
}
public Criteria andBillIdNotIn(List<String> values) {
addCriterion("bill_id not in", values, "billId");
return (Criteria) this;
}
public Criteria andBillIdBetween(String value1, String value2) {
addCriterion("bill_id between", value1, value2, "billId");
return (Criteria) this;
}
public Criteria andBillIdNotBetween(String value1, String value2) {
addCriterion("bill_id not between", value1, value2, "billId");
return (Criteria) this;
}
public Criteria andAccountPeriodIsNull() {
addCriterion("account_period is null");
return (Criteria) this;
}
public Criteria andAccountPeriodIsNotNull() {
addCriterion("account_period is not null");
return (Criteria) this;
}
public Criteria andAccountPeriodEqualTo(String value) {
addCriterion("account_period =", value, "accountPeriod");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAccountPeriodEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("account_period = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAccountPeriodNotEqualTo(String value) {
addCriterion("account_period <>", value, "accountPeriod");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAccountPeriodNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("account_period <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAccountPeriodGreaterThan(String value) {
addCriterion("account_period >", value, "accountPeriod");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAccountPeriodGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("account_period > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAccountPeriodGreaterThanOrEqualTo(String value) {
addCriterion("account_period >=", value, "accountPeriod");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAccountPeriodGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("account_period >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAccountPeriodLessThan(String value) {
addCriterion("account_period <", value, "accountPeriod");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAccountPeriodLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("account_period < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAccountPeriodLessThanOrEqualTo(String value) {
addCriterion("account_period <=", value, "accountPeriod");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAccountPeriodLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("account_period <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAccountPeriodLike(String value) {
addCriterion("account_period like", value, "accountPeriod");
return (Criteria) this;
}
public Criteria andAccountPeriodNotLike(String value) {
addCriterion("account_period not like", value, "accountPeriod");
return (Criteria) this;
}
public Criteria andAccountPeriodIn(List<String> values) {
addCriterion("account_period in", values, "accountPeriod");
return (Criteria) this;
}
public Criteria andAccountPeriodNotIn(List<String> values) {
addCriterion("account_period not in", values, "accountPeriod");
return (Criteria) this;
}
public Criteria andAccountPeriodBetween(String value1, String value2) {
addCriterion("account_period between", value1, value2, "accountPeriod");
return (Criteria) this;
}
public Criteria andAccountPeriodNotBetween(String value1, String value2) {
addCriterion("account_period not between", value1, value2, "accountPeriod");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("user_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("user_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("user_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("user_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("user_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("user_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andTotalEntryAmountIsNull() {
addCriterion("total_entry_amount is null");
return (Criteria) this;
}
public Criteria andTotalEntryAmountIsNotNull() {
addCriterion("total_entry_amount is not null");
return (Criteria) this;
}
public Criteria andTotalEntryAmountEqualTo(Long value) {
addCriterion("total_entry_amount =", value, "totalEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTotalEntryAmountEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("total_entry_amount = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTotalEntryAmountNotEqualTo(Long value) {
addCriterion("total_entry_amount <>", value, "totalEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTotalEntryAmountNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("total_entry_amount <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTotalEntryAmountGreaterThan(Long value) {
addCriterion("total_entry_amount >", value, "totalEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTotalEntryAmountGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("total_entry_amount > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTotalEntryAmountGreaterThanOrEqualTo(Long value) {
addCriterion("total_entry_amount >=", value, "totalEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTotalEntryAmountGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("total_entry_amount >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTotalEntryAmountLessThan(Long value) {
addCriterion("total_entry_amount <", value, "totalEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTotalEntryAmountLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("total_entry_amount < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTotalEntryAmountLessThanOrEqualTo(Long value) {
addCriterion("total_entry_amount <=", value, "totalEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTotalEntryAmountLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("total_entry_amount <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTotalEntryAmountIn(List<Long> values) {
addCriterion("total_entry_amount in", values, "totalEntryAmount");
return (Criteria) this;
}
public Criteria andTotalEntryAmountNotIn(List<Long> values) {
addCriterion("total_entry_amount not in", values, "totalEntryAmount");
return (Criteria) this;
}
public Criteria andTotalEntryAmountBetween(Long value1, Long value2) {
addCriterion("total_entry_amount between", value1, value2, "totalEntryAmount");
return (Criteria) this;
}
public Criteria andTotalEntryAmountNotBetween(Long value1, Long value2) {
addCriterion("total_entry_amount not between", value1, value2, "totalEntryAmount");
return (Criteria) this;
}
public Criteria andTotalWaitEntryAmountIsNull() {
addCriterion("total_wait_entry_amount is null");
return (Criteria) this;
}
public Criteria andTotalWaitEntryAmountIsNotNull() {
addCriterion("total_wait_entry_amount is not null");
return (Criteria) this;
}
public Criteria andTotalWaitEntryAmountEqualTo(Long value) {
addCriterion("total_wait_entry_amount =", value, "totalWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTotalWaitEntryAmountEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("total_wait_entry_amount = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTotalWaitEntryAmountNotEqualTo(Long value) {
addCriterion("total_wait_entry_amount <>", value, "totalWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTotalWaitEntryAmountNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("total_wait_entry_amount <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTotalWaitEntryAmountGreaterThan(Long value) {
addCriterion("total_wait_entry_amount >", value, "totalWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTotalWaitEntryAmountGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("total_wait_entry_amount > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTotalWaitEntryAmountGreaterThanOrEqualTo(Long value) {
addCriterion("total_wait_entry_amount >=", value, "totalWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTotalWaitEntryAmountGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("total_wait_entry_amount >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTotalWaitEntryAmountLessThan(Long value) {
addCriterion("total_wait_entry_amount <", value, "totalWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTotalWaitEntryAmountLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("total_wait_entry_amount < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTotalWaitEntryAmountLessThanOrEqualTo(Long value) {
addCriterion("total_wait_entry_amount <=", value, "totalWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTotalWaitEntryAmountLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("total_wait_entry_amount <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTotalWaitEntryAmountIn(List<Long> values) {
addCriterion("total_wait_entry_amount in", values, "totalWaitEntryAmount");
return (Criteria) this;
}
public Criteria andTotalWaitEntryAmountNotIn(List<Long> values) {
addCriterion("total_wait_entry_amount not in", values, "totalWaitEntryAmount");
return (Criteria) this;
}
public Criteria andTotalWaitEntryAmountBetween(Long value1, Long value2) {
addCriterion("total_wait_entry_amount between", value1, value2, "totalWaitEntryAmount");
return (Criteria) this;
}
public Criteria andTotalWaitEntryAmountNotBetween(Long value1, Long value2) {
addCriterion("total_wait_entry_amount not between", value1, value2, "totalWaitEntryAmount");
return (Criteria) this;
}
public Criteria andOrderEntryAmountIsNull() {
addCriterion("order_entry_amount is null");
return (Criteria) this;
}
public Criteria andOrderEntryAmountIsNotNull() {
addCriterion("order_entry_amount is not null");
return (Criteria) this;
}
public Criteria andOrderEntryAmountEqualTo(Long value) {
addCriterion("order_entry_amount =", value, "orderEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOrderEntryAmountEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("order_entry_amount = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOrderEntryAmountNotEqualTo(Long value) {
addCriterion("order_entry_amount <>", value, "orderEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOrderEntryAmountNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("order_entry_amount <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOrderEntryAmountGreaterThan(Long value) {
addCriterion("order_entry_amount >", value, "orderEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOrderEntryAmountGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("order_entry_amount > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOrderEntryAmountGreaterThanOrEqualTo(Long value) {
addCriterion("order_entry_amount >=", value, "orderEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOrderEntryAmountGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("order_entry_amount >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOrderEntryAmountLessThan(Long value) {
addCriterion("order_entry_amount <", value, "orderEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOrderEntryAmountLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("order_entry_amount < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOrderEntryAmountLessThanOrEqualTo(Long value) {
addCriterion("order_entry_amount <=", value, "orderEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOrderEntryAmountLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("order_entry_amount <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOrderEntryAmountIn(List<Long> values) {
addCriterion("order_entry_amount in", values, "orderEntryAmount");
return (Criteria) this;
}
public Criteria andOrderEntryAmountNotIn(List<Long> values) {
addCriterion("order_entry_amount not in", values, "orderEntryAmount");
return (Criteria) this;
}
public Criteria andOrderEntryAmountBetween(Long value1, Long value2) {
addCriterion("order_entry_amount between", value1, value2, "orderEntryAmount");
return (Criteria) this;
}
public Criteria andOrderEntryAmountNotBetween(Long value1, Long value2) {
addCriterion("order_entry_amount not between", value1, value2, "orderEntryAmount");
return (Criteria) this;
}
public Criteria andOrderWaitEntryAmountIsNull() {
addCriterion("order_wait_entry_amount is null");
return (Criteria) this;
}
public Criteria andOrderWaitEntryAmountIsNotNull() {
addCriterion("order_wait_entry_amount is not null");
return (Criteria) this;
}
public Criteria andOrderWaitEntryAmountEqualTo(Long value) {
addCriterion("order_wait_entry_amount =", value, "orderWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOrderWaitEntryAmountEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("order_wait_entry_amount = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOrderWaitEntryAmountNotEqualTo(Long value) {
addCriterion("order_wait_entry_amount <>", value, "orderWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOrderWaitEntryAmountNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("order_wait_entry_amount <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOrderWaitEntryAmountGreaterThan(Long value) {
addCriterion("order_wait_entry_amount >", value, "orderWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOrderWaitEntryAmountGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("order_wait_entry_amount > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOrderWaitEntryAmountGreaterThanOrEqualTo(Long value) {
addCriterion("order_wait_entry_amount >=", value, "orderWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOrderWaitEntryAmountGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("order_wait_entry_amount >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOrderWaitEntryAmountLessThan(Long value) {
addCriterion("order_wait_entry_amount <", value, "orderWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOrderWaitEntryAmountLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("order_wait_entry_amount < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOrderWaitEntryAmountLessThanOrEqualTo(Long value) {
addCriterion("order_wait_entry_amount <=", value, "orderWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOrderWaitEntryAmountLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("order_wait_entry_amount <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOrderWaitEntryAmountIn(List<Long> values) {
addCriterion("order_wait_entry_amount in", values, "orderWaitEntryAmount");
return (Criteria) this;
}
public Criteria andOrderWaitEntryAmountNotIn(List<Long> values) {
addCriterion("order_wait_entry_amount not in", values, "orderWaitEntryAmount");
return (Criteria) this;
}
public Criteria andOrderWaitEntryAmountBetween(Long value1, Long value2) {
addCriterion("order_wait_entry_amount between", value1, value2, "orderWaitEntryAmount");
return (Criteria) this;
}
public Criteria andOrderWaitEntryAmountNotBetween(Long value1, Long value2) {
addCriterion("order_wait_entry_amount not between", value1, value2, "orderWaitEntryAmount");
return (Criteria) this;
}
public Criteria andIntroduceEntryAmountIsNull() {
addCriterion("introduce_entry_amount is null");
return (Criteria) this;
}
public Criteria andIntroduceEntryAmountIsNotNull() {
addCriterion("introduce_entry_amount is not null");
return (Criteria) this;
}
public Criteria andIntroduceEntryAmountEqualTo(Long value) {
addCriterion("introduce_entry_amount =", value, "introduceEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroduceEntryAmountEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("introduce_entry_amount = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroduceEntryAmountNotEqualTo(Long value) {
addCriterion("introduce_entry_amount <>", value, "introduceEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroduceEntryAmountNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("introduce_entry_amount <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroduceEntryAmountGreaterThan(Long value) {
addCriterion("introduce_entry_amount >", value, "introduceEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroduceEntryAmountGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("introduce_entry_amount > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroduceEntryAmountGreaterThanOrEqualTo(Long value) {
addCriterion("introduce_entry_amount >=", value, "introduceEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroduceEntryAmountGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("introduce_entry_amount >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroduceEntryAmountLessThan(Long value) {
addCriterion("introduce_entry_amount <", value, "introduceEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroduceEntryAmountLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("introduce_entry_amount < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroduceEntryAmountLessThanOrEqualTo(Long value) {
addCriterion("introduce_entry_amount <=", value, "introduceEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroduceEntryAmountLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("introduce_entry_amount <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroduceEntryAmountIn(List<Long> values) {
addCriterion("introduce_entry_amount in", values, "introduceEntryAmount");
return (Criteria) this;
}
public Criteria andIntroduceEntryAmountNotIn(List<Long> values) {
addCriterion("introduce_entry_amount not in", values, "introduceEntryAmount");
return (Criteria) this;
}
public Criteria andIntroduceEntryAmountBetween(Long value1, Long value2) {
addCriterion("introduce_entry_amount between", value1, value2, "introduceEntryAmount");
return (Criteria) this;
}
public Criteria andIntroduceEntryAmountNotBetween(Long value1, Long value2) {
addCriterion("introduce_entry_amount not between", value1, value2, "introduceEntryAmount");
return (Criteria) this;
}
public Criteria andIntroduceWaitEntryAmountIsNull() {
addCriterion("introduce_wait_entry_amount is null");
return (Criteria) this;
}
public Criteria andIntroduceWaitEntryAmountIsNotNull() {
addCriterion("introduce_wait_entry_amount is not null");
return (Criteria) this;
}
public Criteria andIntroduceWaitEntryAmountEqualTo(Long value) {
addCriterion("introduce_wait_entry_amount =", value, "introduceWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroduceWaitEntryAmountEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("introduce_wait_entry_amount = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroduceWaitEntryAmountNotEqualTo(Long value) {
addCriterion("introduce_wait_entry_amount <>", value, "introduceWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroduceWaitEntryAmountNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("introduce_wait_entry_amount <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroduceWaitEntryAmountGreaterThan(Long value) {
addCriterion("introduce_wait_entry_amount >", value, "introduceWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroduceWaitEntryAmountGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("introduce_wait_entry_amount > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroduceWaitEntryAmountGreaterThanOrEqualTo(Long value) {
addCriterion("introduce_wait_entry_amount >=", value, "introduceWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroduceWaitEntryAmountGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("introduce_wait_entry_amount >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroduceWaitEntryAmountLessThan(Long value) {
addCriterion("introduce_wait_entry_amount <", value, "introduceWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroduceWaitEntryAmountLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("introduce_wait_entry_amount < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroduceWaitEntryAmountLessThanOrEqualTo(Long value) {
addCriterion("introduce_wait_entry_amount <=", value, "introduceWaitEntryAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroduceWaitEntryAmountLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("introduce_wait_entry_amount <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroduceWaitEntryAmountIn(List<Long> values) {
addCriterion("introduce_wait_entry_amount in", values, "introduceWaitEntryAmount");
return (Criteria) this;
}
public Criteria andIntroduceWaitEntryAmountNotIn(List<Long> values) {
addCriterion("introduce_wait_entry_amount not in", values, "introduceWaitEntryAmount");
return (Criteria) this;
}
public Criteria andIntroduceWaitEntryAmountBetween(Long value1, Long value2) {
addCriterion("introduce_wait_entry_amount between", value1, value2, "introduceWaitEntryAmount");
return (Criteria) this;
}
public Criteria andIntroduceWaitEntryAmountNotBetween(Long value1, Long value2) {
addCriterion("introduce_wait_entry_amount not between", value1, value2, "introduceWaitEntryAmount");
return (Criteria) this;
}
public Criteria andStateIsNull() {
addCriterion("`state` is null");
return (Criteria) this;
}
public Criteria andStateIsNotNull() {
addCriterion("`state` is not null");
return (Criteria) this;
}
public Criteria andStateEqualTo(Integer value) {
addCriterion("`state` =", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("`state` = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateNotEqualTo(Integer value) {
addCriterion("`state` <>", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("`state` <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateGreaterThan(Integer value) {
addCriterion("`state` >", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("`state` > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateGreaterThanOrEqualTo(Integer value) {
addCriterion("`state` >=", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("`state` >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateLessThan(Integer value) {
addCriterion("`state` <", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("`state` < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateLessThanOrEqualTo(Integer value) {
addCriterion("`state` <=", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("`state` <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateIn(List<Integer> values) {
addCriterion("`state` in", values, "state");
return (Criteria) this;
}
public Criteria andStateNotIn(List<Integer> values) {
addCriterion("`state` not in", values, "state");
return (Criteria) this;
}
public Criteria andStateBetween(Integer value1, Integer value2) {
addCriterion("`state` between", value1, value2, "state");
return (Criteria) this;
}
public Criteria andStateNotBetween(Integer value1, Integer value2) {
addCriterion("`state` not between", value1, value2, "state");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private UserBillExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(UserBillExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public UserBillExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
if (ifAdd) {
add.add(this);
}
return this;
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public interface ICriteriaAdd {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Criteria add(Criteria add);
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
...@@ -36,6 +36,12 @@ public class DistributorProfitRequestDto implements Entity { ...@@ -36,6 +36,12 @@ public class DistributorProfitRequestDto implements Entity {
*/ */
private Long amount; private Long amount;
/**
* 实际金额
* 要扣除微信的手续费
*/
private Long realAmount;
/** /**
* 商品成本,供货价 * 商品成本,供货价
*/ */
......
...@@ -17,19 +17,25 @@ public class UserAccountDetailRequestDto extends BaseRequestDto implements Entit ...@@ -17,19 +17,25 @@ public class UserAccountDetailRequestDto extends BaseRequestDto implements Entit
private Long userId; private Long userId;
/** /**
* 订单id * 交易id
* 可以是订单号,也可以是转账记录id
*/ */
private String orderId; private String transactionId;
/** /**
* 批量查询订单id * 金额
*/ */
private List<String> orderIdList; private Long amount;
/** /**
* 查询时需要排除的订单id * 批量查询交易id
*/ */
private List<String> filterOrderIdList; private List<String> transactionIdList;
/**
* 查询时需要排除的交易id
*/
private List<String> filterTransactionIdList;
/** /**
* 收入或支出的类型 * 收入或支出的类型
......
package com.wwdz.ch.db.dto.request.distribution;
import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity;
import lombok.Data;
@Data
public class UserBillRequestDto extends BaseRequestDto implements Entity {
private Integer id;
/**
* 账单id
*/
private String billId;
/**
* 账期
*/
private String accountPeriod;
/**
* 用户id
*/
private Long userId;
/**
* 总入账金额
*/
private Long totalEntryAmount;
/**
* 总待入账金额
*/
private Long totalWaitEntryAmount;
/**
* 订单入账金额
*/
private Long orderEntryAmount;
/**
* 订单待入账金额
*/
private Long orderWaitEntryAmount;
/**
* 介绍佣金入账金额
*/
private Long introduceEntryAmount;
/**
* 介绍佣金待入账金额
*/
private Long introduceWaitEntryAmount;
/**
* 状态
*/
private Integer state;
}
...@@ -21,7 +21,6 @@ public class UserAccountDetailDaoImpl implements UserAccountDetailDao { ...@@ -21,7 +21,6 @@ public class UserAccountDetailDaoImpl implements UserAccountDetailDao {
@Override @Override
public boolean insert(UserAccountDetail userAccountDetail) { public boolean insert(UserAccountDetail userAccountDetail) {
userAccountDetail.setCreateTime(new Date());
userAccountDetail.setUpdateTime(new Date()); userAccountDetail.setUpdateTime(new Date());
return userAccountDetailMapper.insert(userAccountDetail) > 0; return userAccountDetailMapper.insert(userAccountDetail) > 0;
} }
...@@ -31,7 +30,7 @@ public class UserAccountDetailDaoImpl implements UserAccountDetailDao { ...@@ -31,7 +30,7 @@ public class UserAccountDetailDaoImpl implements UserAccountDetailDao {
UserAccountDetailExample example = new UserAccountDetailExample(); UserAccountDetailExample example = new UserAccountDetailExample();
UserAccountDetailExample.Criteria criteria = example.createCriteria(); UserAccountDetailExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(userAccountDetail.getUserId(), criteria::andUserIdEqualTo); JdbcHelper.ifPresent(userAccountDetail.getUserId(), criteria::andUserIdEqualTo);
JdbcHelper.ifPresent(userAccountDetail.getOrderId(), criteria::andOrderIdEqualTo); JdbcHelper.ifPresent(userAccountDetail.getTransactionId(), criteria::andTransactionIdEqualTo);
userAccountDetail.setUpdateTime(new Date()); userAccountDetail.setUpdateTime(new Date());
return userAccountDetailMapper.updateByExampleSelective(userAccountDetail, example) > 0; return userAccountDetailMapper.updateByExampleSelective(userAccountDetail, example) > 0;
} }
...@@ -42,9 +41,9 @@ public class UserAccountDetailDaoImpl implements UserAccountDetailDao { ...@@ -42,9 +41,9 @@ public class UserAccountDetailDaoImpl implements UserAccountDetailDao {
UserAccountDetailExample example = new UserAccountDetailExample(); UserAccountDetailExample example = new UserAccountDetailExample();
UserAccountDetailExample.Criteria criteria = example.createCriteria(); UserAccountDetailExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getUserId(), criteria::andUserIdEqualTo); JdbcHelper.ifPresent(dto.getUserId(), criteria::andUserIdEqualTo);
JdbcHelper.ifPresent(dto.getOrderId(), criteria::andOrderIdEqualTo); JdbcHelper.ifPresent(dto.getTransactionId(), criteria::andTransactionIdEqualTo);
JdbcHelper.ifPresent(dto.getOrderIdList(), criteria::andOrderIdIn); JdbcHelper.ifPresent(dto.getTransactionIdList(), criteria::andTransactionIdIn);
JdbcHelper.ifPresent(dto.getFilterOrderIdList(), criteria::andOrderIdNotIn); JdbcHelper.ifPresent(dto.getFilterTransactionIdList(), criteria::andTransactionIdNotIn);
JdbcHelper.ifPresent(dto.getState(), criteria::andStateEqualTo); JdbcHelper.ifPresent(dto.getState(), criteria::andStateEqualTo);
JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo); JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo);
JdbcHelper.ifPresent(dto.getFundType(), criteria::andFundTypeEqualTo); JdbcHelper.ifPresent(dto.getFundType(), criteria::andFundTypeEqualTo);
......
package com.wwdz.ch.db.mapper.distribution;
import com.wwdz.ch.db.domain.distribution.UserBill;
import com.wwdz.ch.db.domain.distribution.UserBillExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface UserBillMapper {
long countByExample(UserBillExample example);
int deleteByExample(UserBillExample example);
int deleteByPrimaryKey(Integer id);
int insert(UserBill record);
int insertSelective(UserBill record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
UserBill selectOneByExample(UserBillExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
UserBill selectOneByExampleSelective(@Param("example") UserBillExample example, @Param("selective") UserBill.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<UserBill> selectByExampleSelective(@Param("example") UserBillExample example, @Param("selective") UserBill.Column ... selective);
List<UserBill> selectByExample(UserBillExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
UserBill selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") UserBill.Column ... selective);
UserBill selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") UserBill record, @Param("example") UserBillExample example);
int updateByExample(@Param("record") UserBill record, @Param("example") UserBillExample example);
int updateByPrimaryKeySelective(UserBill record);
int updateByPrimaryKey(UserBill record);
}
\ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<result column="item_id" jdbcType="BIGINT" property="itemId" /> <result column="item_id" jdbcType="BIGINT" property="itemId" />
<result column="item_num" jdbcType="INTEGER" property="itemNum" /> <result column="item_num" jdbcType="INTEGER" property="itemNum" />
<result column="amount" jdbcType="BIGINT" property="amount" /> <result column="amount" jdbcType="BIGINT" property="amount" />
<result column="real_amount" jdbcType="BIGINT" property="realAmount" />
<result column="item_cost" jdbcType="BIGINT" property="itemCost" /> <result column="item_cost" jdbcType="BIGINT" property="itemCost" />
<result column="channel_cost" jdbcType="BIGINT" property="channelCost" /> <result column="channel_cost" jdbcType="BIGINT" property="channelCost" />
<result column="introduce_cost" jdbcType="BIGINT" property="introduceCost" /> <result column="introduce_cost" jdbcType="BIGINT" property="introduceCost" />
...@@ -16,7 +17,6 @@ ...@@ -16,7 +17,6 @@
<result column="type" jdbcType="INTEGER" property="type" /> <result column="type" jdbcType="INTEGER" property="type" />
<result column="is_valid" jdbcType="BIT" property="isValid" /> <result column="is_valid" jdbcType="BIT" property="isValid" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
<foreach collection="oredCriteria" item="criteria" separator="or"> <foreach collection="oredCriteria" item="criteria" separator="or">
...@@ -76,8 +76,8 @@ ...@@ -76,8 +76,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, distribution_order_id, distributor_id, item_id, item_num, amount, item_cost, id, distribution_order_id, distributor_id, item_id, item_num, amount, real_amount,
channel_cost, introduce_cost, profit, create_time, `type`, is_valid item_cost, channel_cost, introduce_cost, profit, create_time, `type`, is_valid
</sql> </sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.DistributorProfitExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.DistributorProfitExample" resultMap="BaseResultMap">
select select
...@@ -112,8 +112,8 @@ ...@@ -112,8 +112,8 @@
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, distribution_order_id, distributor_id, item_id, item_num, amount, item_cost, id, distribution_order_id, distributor_id, item_id, item_num, amount, real_amount,
channel_cost, introduce_cost, profit, create_time, `type`, is_valid item_cost, channel_cost, introduce_cost, profit, create_time, `type`, is_valid
</otherwise> </otherwise>
</choose> </choose>
from distributor_profit from distributor_profit
...@@ -144,8 +144,8 @@ ...@@ -144,8 +144,8 @@
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, distribution_order_id, distributor_id, item_id, item_num, amount, item_cost, id, distribution_order_id, distributor_id, item_id, item_num, amount, real_amount,
channel_cost, introduce_cost, profit, create_time, `type`, is_valid item_cost, channel_cost, introduce_cost, profit, create_time, `type`, is_valid
</otherwise> </otherwise>
</choose> </choose>
from distributor_profit from distributor_profit
...@@ -167,14 +167,14 @@ ...@@ -167,14 +167,14 @@
</selectKey> </selectKey>
insert into distributor_profit (distribution_order_id, distributor_id, insert into distributor_profit (distribution_order_id, distributor_id,
item_id, item_num, amount, item_id, item_num, amount,
item_cost, channel_cost, introduce_cost, real_amount, item_cost, channel_cost,
profit, create_time, `type`, introduce_cost, profit, create_time,
is_valid) `type`, is_valid)
values (#{distributionOrderId,jdbcType=VARCHAR}, #{distributorId,jdbcType=BIGINT}, values (#{distributionOrderId,jdbcType=VARCHAR}, #{distributorId,jdbcType=BIGINT},
#{itemId,jdbcType=BIGINT}, #{itemNum,jdbcType=INTEGER}, #{amount,jdbcType=BIGINT}, #{itemId,jdbcType=BIGINT}, #{itemNum,jdbcType=INTEGER}, #{amount,jdbcType=BIGINT},
#{itemCost,jdbcType=BIGINT}, #{channelCost,jdbcType=BIGINT}, #{introduceCost,jdbcType=BIGINT}, #{realAmount,jdbcType=BIGINT}, #{itemCost,jdbcType=BIGINT}, #{channelCost,jdbcType=BIGINT},
#{profit,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=INTEGER}, #{introduceCost,jdbcType=BIGINT}, #{profit,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{isValid,jdbcType=BIT}) #{type,jdbcType=INTEGER}, #{isValid,jdbcType=BIT})
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.DistributorProfit"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.DistributorProfit">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
...@@ -197,6 +197,9 @@ ...@@ -197,6 +197,9 @@
<if test="amount != null"> <if test="amount != null">
amount, amount,
</if> </if>
<if test="realAmount != null">
real_amount,
</if>
<if test="itemCost != null"> <if test="itemCost != null">
item_cost, item_cost,
</if> </if>
...@@ -235,6 +238,9 @@ ...@@ -235,6 +238,9 @@
<if test="amount != null"> <if test="amount != null">
#{amount,jdbcType=BIGINT}, #{amount,jdbcType=BIGINT},
</if> </if>
<if test="realAmount != null">
#{realAmount,jdbcType=BIGINT},
</if>
<if test="itemCost != null"> <if test="itemCost != null">
#{itemCost,jdbcType=BIGINT}, #{itemCost,jdbcType=BIGINT},
</if> </if>
...@@ -285,6 +291,9 @@ ...@@ -285,6 +291,9 @@
<if test="record.amount != null"> <if test="record.amount != null">
amount = #{record.amount,jdbcType=BIGINT}, amount = #{record.amount,jdbcType=BIGINT},
</if> </if>
<if test="record.realAmount != null">
real_amount = #{record.realAmount,jdbcType=BIGINT},
</if>
<if test="record.itemCost != null"> <if test="record.itemCost != null">
item_cost = #{record.itemCost,jdbcType=BIGINT}, item_cost = #{record.itemCost,jdbcType=BIGINT},
</if> </if>
...@@ -319,6 +328,7 @@ ...@@ -319,6 +328,7 @@
item_id = #{record.itemId,jdbcType=BIGINT}, item_id = #{record.itemId,jdbcType=BIGINT},
item_num = #{record.itemNum,jdbcType=INTEGER}, item_num = #{record.itemNum,jdbcType=INTEGER},
amount = #{record.amount,jdbcType=BIGINT}, amount = #{record.amount,jdbcType=BIGINT},
real_amount = #{record.realAmount,jdbcType=BIGINT},
item_cost = #{record.itemCost,jdbcType=BIGINT}, item_cost = #{record.itemCost,jdbcType=BIGINT},
channel_cost = #{record.channelCost,jdbcType=BIGINT}, channel_cost = #{record.channelCost,jdbcType=BIGINT},
introduce_cost = #{record.introduceCost,jdbcType=BIGINT}, introduce_cost = #{record.introduceCost,jdbcType=BIGINT},
...@@ -348,6 +358,9 @@ ...@@ -348,6 +358,9 @@
<if test="amount != null"> <if test="amount != null">
amount = #{amount,jdbcType=BIGINT}, amount = #{amount,jdbcType=BIGINT},
</if> </if>
<if test="realAmount != null">
real_amount = #{realAmount,jdbcType=BIGINT},
</if>
<if test="itemCost != null"> <if test="itemCost != null">
item_cost = #{itemCost,jdbcType=BIGINT}, item_cost = #{itemCost,jdbcType=BIGINT},
</if> </if>
...@@ -379,6 +392,7 @@ ...@@ -379,6 +392,7 @@
item_id = #{itemId,jdbcType=BIGINT}, item_id = #{itemId,jdbcType=BIGINT},
item_num = #{itemNum,jdbcType=INTEGER}, item_num = #{itemNum,jdbcType=INTEGER},
amount = #{amount,jdbcType=BIGINT}, amount = #{amount,jdbcType=BIGINT},
real_amount = #{realAmount,jdbcType=BIGINT},
item_cost = #{itemCost,jdbcType=BIGINT}, item_cost = #{itemCost,jdbcType=BIGINT},
channel_cost = #{channelCost,jdbcType=BIGINT}, channel_cost = #{channelCost,jdbcType=BIGINT},
introduce_cost = #{introduceCost,jdbcType=BIGINT}, introduce_cost = #{introduceCost,jdbcType=BIGINT},
...@@ -421,8 +435,8 @@ ...@@ -421,8 +435,8 @@
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, distribution_order_id, distributor_id, item_id, item_num, amount, item_cost, id, distribution_order_id, distributor_id, item_id, item_num, amount, real_amount,
channel_cost, introduce_cost, profit, create_time, `type`, is_valid item_cost, channel_cost, introduce_cost, profit, create_time, `type`, is_valid
</otherwise> </otherwise>
</choose> </choose>
from distributor_profit from distributor_profit
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.distribution.UserAccountDetail"> <resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.distribution.UserAccountDetail">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" /> <result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="order_id" jdbcType="VARCHAR" property="orderId" /> <result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
<result column="amount" jdbcType="BIGINT" property="amount" />
<result column="type" jdbcType="INTEGER" property="type" /> <result column="type" jdbcType="INTEGER" property="type" />
<result column="fund_type" jdbcType="INTEGER" property="fundType" /> <result column="fund_type" jdbcType="INTEGER" property="fundType" />
<result column="state" jdbcType="INTEGER" property="state" /> <result column="state" jdbcType="INTEGER" property="state" />
...@@ -70,7 +71,7 @@ ...@@ -70,7 +71,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, user_id, order_id, `type`, fund_type, `state`, create_time, update_time id, user_id, transaction_id, amount, `type`, fund_type, `state`, create_time, update_time
</sql> </sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.UserAccountDetailExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.UserAccountDetailExample" resultMap="BaseResultMap">
select select
...@@ -99,13 +100,14 @@ ...@@ -99,13 +100,14 @@
distinct distinct
</if> </if>
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, user_id, order_id, `type`, fund_type, `state`, create_time, update_time id, user_id, transaction_id, amount, `type`, fund_type, `state`, create_time, update_time
</otherwise> </otherwise>
</choose> </choose>
from user_account_detail from user_account_detail
...@@ -130,13 +132,14 @@ ...@@ -130,13 +132,14 @@
--> -->
select select
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, user_id, order_id, `type`, fund_type, `state`, create_time, update_time id, user_id, transaction_id, amount, `type`, fund_type, `state`, create_time, update_time
</otherwise> </otherwise>
</choose> </choose>
from user_account_detail from user_account_detail
...@@ -156,12 +159,12 @@ ...@@ -156,12 +159,12 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into user_account_detail (user_id, order_id, `type`, insert into user_account_detail (user_id, transaction_id, amount,
fund_type, `state`, create_time, `type`, fund_type, `state`,
update_time) create_time, update_time)
values (#{userId,jdbcType=BIGINT}, #{orderId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, values (#{userId,jdbcType=BIGINT}, #{transactionId,jdbcType=VARCHAR}, #{amount,jdbcType=BIGINT},
#{fundType,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=INTEGER}, #{fundType,jdbcType=INTEGER}, #{state,jdbcType=INTEGER},
#{updateTime,jdbcType=TIMESTAMP}) #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.UserAccountDetail"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.UserAccountDetail">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
...@@ -172,8 +175,11 @@ ...@@ -172,8 +175,11 @@
<if test="userId != null"> <if test="userId != null">
user_id, user_id,
</if> </if>
<if test="orderId != null"> <if test="transactionId != null">
order_id, transaction_id,
</if>
<if test="amount != null">
amount,
</if> </if>
<if test="type != null"> <if test="type != null">
`type`, `type`,
...@@ -195,8 +201,11 @@ ...@@ -195,8 +201,11 @@
<if test="userId != null"> <if test="userId != null">
#{userId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
</if> </if>
<if test="orderId != null"> <if test="transactionId != null">
#{orderId,jdbcType=VARCHAR}, #{transactionId,jdbcType=VARCHAR},
</if>
<if test="amount != null">
#{amount,jdbcType=BIGINT},
</if> </if>
<if test="type != null"> <if test="type != null">
#{type,jdbcType=INTEGER}, #{type,jdbcType=INTEGER},
...@@ -230,8 +239,11 @@ ...@@ -230,8 +239,11 @@
<if test="record.userId != null"> <if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT}, user_id = #{record.userId,jdbcType=BIGINT},
</if> </if>
<if test="record.orderId != null"> <if test="record.transactionId != null">
order_id = #{record.orderId,jdbcType=VARCHAR}, transaction_id = #{record.transactionId,jdbcType=VARCHAR},
</if>
<if test="record.amount != null">
amount = #{record.amount,jdbcType=BIGINT},
</if> </if>
<if test="record.type != null"> <if test="record.type != null">
`type` = #{record.type,jdbcType=INTEGER}, `type` = #{record.type,jdbcType=INTEGER},
...@@ -257,7 +269,8 @@ ...@@ -257,7 +269,8 @@
update user_account_detail update user_account_detail
set id = #{record.id,jdbcType=BIGINT}, set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT}, user_id = #{record.userId,jdbcType=BIGINT},
order_id = #{record.orderId,jdbcType=VARCHAR}, transaction_id = #{record.transactionId,jdbcType=VARCHAR},
amount = #{record.amount,jdbcType=BIGINT},
`type` = #{record.type,jdbcType=INTEGER}, `type` = #{record.type,jdbcType=INTEGER},
fund_type = #{record.fundType,jdbcType=INTEGER}, fund_type = #{record.fundType,jdbcType=INTEGER},
`state` = #{record.state,jdbcType=INTEGER}, `state` = #{record.state,jdbcType=INTEGER},
...@@ -273,8 +286,11 @@ ...@@ -273,8 +286,11 @@
<if test="userId != null"> <if test="userId != null">
user_id = #{userId,jdbcType=BIGINT}, user_id = #{userId,jdbcType=BIGINT},
</if> </if>
<if test="orderId != null"> <if test="transactionId != null">
order_id = #{orderId,jdbcType=VARCHAR}, transaction_id = #{transactionId,jdbcType=VARCHAR},
</if>
<if test="amount != null">
amount = #{amount,jdbcType=BIGINT},
</if> </if>
<if test="type != null"> <if test="type != null">
`type` = #{type,jdbcType=INTEGER}, `type` = #{type,jdbcType=INTEGER},
...@@ -297,7 +313,8 @@ ...@@ -297,7 +313,8 @@
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.distribution.UserAccountDetail"> <update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.distribution.UserAccountDetail">
update user_account_detail update user_account_detail
set user_id = #{userId,jdbcType=BIGINT}, set user_id = #{userId,jdbcType=BIGINT},
order_id = #{orderId,jdbcType=VARCHAR}, transaction_id = #{transactionId,jdbcType=VARCHAR},
amount = #{amount,jdbcType=BIGINT},
`type` = #{type,jdbcType=INTEGER}, `type` = #{type,jdbcType=INTEGER},
fund_type = #{fundType,jdbcType=INTEGER}, fund_type = #{fundType,jdbcType=INTEGER},
`state` = #{state,jdbcType=INTEGER}, `state` = #{state,jdbcType=INTEGER},
...@@ -332,13 +349,14 @@ ...@@ -332,13 +349,14 @@
select select
'true' as QUERYID, 'true' as QUERYID,
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, user_id, order_id, `type`, fund_type, `state`, create_time, update_time id, user_id, transaction_id, amount, `type`, fund_type, `state`, create_time, update_time
</otherwise> </otherwise>
</choose> </choose>
from user_account_detail from user_account_detail
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wwdz.ch.db.mapper.distribution.UserBillMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.distribution.UserBill">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="bill_id" jdbcType="VARCHAR" property="billId" />
<result column="account_period" jdbcType="VARCHAR" property="accountPeriod" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="total_entry_amount" jdbcType="BIGINT" property="totalEntryAmount" />
<result column="total_wait_entry_amount" jdbcType="BIGINT" property="totalWaitEntryAmount" />
<result column="order_entry_amount" jdbcType="BIGINT" property="orderEntryAmount" />
<result column="order_wait_entry_amount" jdbcType="BIGINT" property="orderWaitEntryAmount" />
<result column="introduce_entry_amount" jdbcType="BIGINT" property="introduceEntryAmount" />
<result column="introduce_wait_entry_amount" jdbcType="BIGINT" property="introduceWaitEntryAmount" />
<result column="state" jdbcType="INTEGER" property="state" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, bill_id, account_period, user_id, total_entry_amount, total_wait_entry_amount,
order_entry_amount, order_wait_entry_amount, introduce_entry_amount, introduce_wait_entry_amount,
`state`
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.UserBillExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from user_bill
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<if test="example.distinct">
distinct
</if>
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, bill_id, account_period, user_id, total_entry_amount, total_wait_entry_amount,
order_entry_amount, order_wait_entry_amount, introduce_entry_amount, introduce_wait_entry_amount,
`state`
</otherwise>
</choose>
from user_bill
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from user_bill
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, bill_id, account_period, user_id, total_entry_amount, total_wait_entry_amount,
order_entry_amount, order_wait_entry_amount, introduce_entry_amount, introduce_wait_entry_amount,
`state`
</otherwise>
</choose>
from user_bill
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from user_bill
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.distribution.UserBillExample">
delete from user_bill
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.distribution.UserBill">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into user_bill (bill_id, account_period, user_id,
total_entry_amount, total_wait_entry_amount, order_entry_amount,
order_wait_entry_amount, introduce_entry_amount,
introduce_wait_entry_amount, `state`)
values (#{billId,jdbcType=VARCHAR}, #{accountPeriod,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT},
#{totalEntryAmount,jdbcType=BIGINT}, #{totalWaitEntryAmount,jdbcType=BIGINT}, #{orderEntryAmount,jdbcType=BIGINT},
#{orderWaitEntryAmount,jdbcType=BIGINT}, #{introduceEntryAmount,jdbcType=BIGINT},
#{introduceWaitEntryAmount,jdbcType=BIGINT}, #{state,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.UserBill">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into user_bill
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billId != null">
bill_id,
</if>
<if test="accountPeriod != null">
account_period,
</if>
<if test="userId != null">
user_id,
</if>
<if test="totalEntryAmount != null">
total_entry_amount,
</if>
<if test="totalWaitEntryAmount != null">
total_wait_entry_amount,
</if>
<if test="orderEntryAmount != null">
order_entry_amount,
</if>
<if test="orderWaitEntryAmount != null">
order_wait_entry_amount,
</if>
<if test="introduceEntryAmount != null">
introduce_entry_amount,
</if>
<if test="introduceWaitEntryAmount != null">
introduce_wait_entry_amount,
</if>
<if test="state != null">
`state`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billId != null">
#{billId,jdbcType=VARCHAR},
</if>
<if test="accountPeriod != null">
#{accountPeriod,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="totalEntryAmount != null">
#{totalEntryAmount,jdbcType=BIGINT},
</if>
<if test="totalWaitEntryAmount != null">
#{totalWaitEntryAmount,jdbcType=BIGINT},
</if>
<if test="orderEntryAmount != null">
#{orderEntryAmount,jdbcType=BIGINT},
</if>
<if test="orderWaitEntryAmount != null">
#{orderWaitEntryAmount,jdbcType=BIGINT},
</if>
<if test="introduceEntryAmount != null">
#{introduceEntryAmount,jdbcType=BIGINT},
</if>
<if test="introduceWaitEntryAmount != null">
#{introduceWaitEntryAmount,jdbcType=BIGINT},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.distribution.UserBillExample" resultType="java.lang.Long">
select count(*) from user_bill
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update user_bill
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.billId != null">
bill_id = #{record.billId,jdbcType=VARCHAR},
</if>
<if test="record.accountPeriod != null">
account_period = #{record.accountPeriod,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.totalEntryAmount != null">
total_entry_amount = #{record.totalEntryAmount,jdbcType=BIGINT},
</if>
<if test="record.totalWaitEntryAmount != null">
total_wait_entry_amount = #{record.totalWaitEntryAmount,jdbcType=BIGINT},
</if>
<if test="record.orderEntryAmount != null">
order_entry_amount = #{record.orderEntryAmount,jdbcType=BIGINT},
</if>
<if test="record.orderWaitEntryAmount != null">
order_wait_entry_amount = #{record.orderWaitEntryAmount,jdbcType=BIGINT},
</if>
<if test="record.introduceEntryAmount != null">
introduce_entry_amount = #{record.introduceEntryAmount,jdbcType=BIGINT},
</if>
<if test="record.introduceWaitEntryAmount != null">
introduce_wait_entry_amount = #{record.introduceWaitEntryAmount,jdbcType=BIGINT},
</if>
<if test="record.state != null">
`state` = #{record.state,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update user_bill
set id = #{record.id,jdbcType=INTEGER},
bill_id = #{record.billId,jdbcType=VARCHAR},
account_period = #{record.accountPeriod,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=BIGINT},
total_entry_amount = #{record.totalEntryAmount,jdbcType=BIGINT},
total_wait_entry_amount = #{record.totalWaitEntryAmount,jdbcType=BIGINT},
order_entry_amount = #{record.orderEntryAmount,jdbcType=BIGINT},
order_wait_entry_amount = #{record.orderWaitEntryAmount,jdbcType=BIGINT},
introduce_entry_amount = #{record.introduceEntryAmount,jdbcType=BIGINT},
introduce_wait_entry_amount = #{record.introduceWaitEntryAmount,jdbcType=BIGINT},
`state` = #{record.state,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.distribution.UserBill">
update user_bill
<set>
<if test="billId != null">
bill_id = #{billId,jdbcType=VARCHAR},
</if>
<if test="accountPeriod != null">
account_period = #{accountPeriod,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="totalEntryAmount != null">
total_entry_amount = #{totalEntryAmount,jdbcType=BIGINT},
</if>
<if test="totalWaitEntryAmount != null">
total_wait_entry_amount = #{totalWaitEntryAmount,jdbcType=BIGINT},
</if>
<if test="orderEntryAmount != null">
order_entry_amount = #{orderEntryAmount,jdbcType=BIGINT},
</if>
<if test="orderWaitEntryAmount != null">
order_wait_entry_amount = #{orderWaitEntryAmount,jdbcType=BIGINT},
</if>
<if test="introduceEntryAmount != null">
introduce_entry_amount = #{introduceEntryAmount,jdbcType=BIGINT},
</if>
<if test="introduceWaitEntryAmount != null">
introduce_wait_entry_amount = #{introduceWaitEntryAmount,jdbcType=BIGINT},
</if>
<if test="state != null">
`state` = #{state,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.distribution.UserBill">
update user_bill
set bill_id = #{billId,jdbcType=VARCHAR},
account_period = #{accountPeriod,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=BIGINT},
total_entry_amount = #{totalEntryAmount,jdbcType=BIGINT},
total_wait_entry_amount = #{totalWaitEntryAmount,jdbcType=BIGINT},
order_entry_amount = #{orderEntryAmount,jdbcType=BIGINT},
order_wait_entry_amount = #{orderWaitEntryAmount,jdbcType=BIGINT},
introduce_entry_amount = #{introduceEntryAmount,jdbcType=BIGINT},
introduce_wait_entry_amount = #{introduceWaitEntryAmount,jdbcType=BIGINT},
`state` = #{state,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.distribution.UserBillExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<include refid="Base_Column_List" />
from user_bill
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, bill_id, account_period, user_id, total_entry_amount, total_wait_entry_amount,
order_entry_amount, order_wait_entry_amount, introduce_entry_amount, introduce_wait_entry_amount,
`state`
</otherwise>
</choose>
from user_bill
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution" <javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution"
targetProject="ch-dao/src/main/java"/> targetProject="ch-dao/src/main/java"/>
<table tableName="user_bank_card" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"> <table tableName="distributor_profit" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" /> <generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table> </table>
......
...@@ -243,15 +243,27 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -243,15 +243,27 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
} }
Date now = new Date(); Date now = new Date();
AuctionConfig auctionConfig = auctionConfigDao.findByItemId(dto.getItemId()); AuctionConfig auctionConfig = auctionConfigDao.findByItemId(dto.getItemId());
//查询用户第一次出价对应的分销商 /* //查询用户第一次出价对应的分销商
AuctionRecord firstAuctionRecord = auctionRecordDao.findFirstRecord(dto.getItemId(), auctionRecord.getUserId()); AuctionRecord firstAuctionRecord = auctionRecordDao.findFirstRecord(dto.getItemId(), auctionRecord.getUserId());
String shareRecordId = firstAuctionRecord.getShareRecordId(); String shareRecordId = firstAuctionRecord.getShareRecordId();*/
// DistributorShareRecord distributorShareRecord = distributorShareRecordDao.findById(shareRecordId);
//SupplierItem supplierItem = supplierItemDao.findById(dto.getItemId()); //查询该用户和藏家的介绍人
FollowFansRecordRequestDto queryFollowFansRecordRequestDto = new FollowFansRecordRequestDto();
queryFollowFansRecordRequestDto.setFollowerId(auctionConfig.getCreatorId());
queryFollowFansRecordRequestDto.setFansId(dto.getBuyerId());
FollowFansRecord followFansRecord = followFansRecordDao.findOne(queryFollowFansRecordRequestDto);
long introducerId;
//没有关注记录,则介绍费算作平台的
if (followFansRecord == null) {
introducerId = CommConsts.SYSTEM_ACCOUNT;
} else {
//把介绍人作为该订单的分享链接字段的值
introducerId = followFansRecord.getIntroducerId();
}
DistributionOrder distributionOrder = new DistributionOrder(); DistributionOrder distributionOrder = new DistributionOrder();
distributionOrder.setItemId(dto.getItemId()); distributionOrder.setItemId(dto.getItemId());
distributionOrder.setItemNum(1); distributionOrder.setItemNum(1);
distributionOrder.setShareRecordId(shareRecordId); distributionOrder.setShareRecordId(String.valueOf(introducerId));
distributionOrder.setDistributionOrderId(distributionOrderId); distributionOrder.setDistributionOrderId(distributionOrderId);
distributionOrder.setBuyerId(auctionRecord.getUserId()); distributionOrder.setBuyerId(auctionRecord.getUserId());
distributionOrder.setBuyerOpenid(auctionRecord.getUserOpenId()); distributionOrder.setBuyerOpenid(auctionRecord.getUserOpenId());
...@@ -277,17 +289,20 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -277,17 +289,20 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
channelCostRebate = channelCost.doubleValue(); channelCostRebate = channelCost.doubleValue();
} }
logger.info("藏家id:{} 生成新拍卖订单,平台服务费比例:{}", auctionConfig.getCreatorId(), channelCostRebate); logger.info("藏家id:{} 生成新拍卖订单,平台服务费比例:{}", auctionConfig.getCreatorId(), channelCostRebate);
double channelServiceCost = distributionOrder.getAmount().doubleValue() * channelCostRebate; SupplierItem supplierItem = supplierItemDao.findById(dto.getItemId());
distributorProfit.setChannelCost(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(channelServiceCost)));
//查询该用户和藏家的介绍人 //查询该用户和藏家的介绍人
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto(); FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFollowerId(auctionConfig.getCreatorId()); followFansRecordRequestDto.setFollowerId(auctionConfig.getCreatorId());
followFansRecordRequestDto.setFansId(auctionRecord.getUserId()); followFansRecordRequestDto.setFansId(auctionRecord.getUserId());
double rebate = distributorProfitService.getIntroduceRebate(followFansRecordRequestDto); double rebate = distributorProfitService.getIntroduceRebate(followFansRecordRequestDto);
double introduceCost = distributionOrder.getAmount().doubleValue() * rebate; double introduceCost = distributionOrder.getAmount().doubleValue() * rebate;
//拍卖的平台佣金= 订单金额 - 藏家供货价 - 介绍佣金
double channelServiceCost = distributionOrder.getAmount().doubleValue() - supplierItem.getSupplyPrice() - introduceCost;
distributorProfit.setChannelCost(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(channelServiceCost)));
//实际订单到账金额
double realAmount = distributionOrder.getAmount().doubleValue() * (1 - CommConsts.WX_COMMISSION_REBATE);
distributorProfit.setIntroduceCost(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(introduceCost))); distributorProfit.setIntroduceCost(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(introduceCost)));
distributorProfit.setDistributionOrderId(distributionOrderId); distributorProfit.setDistributionOrderId(distributionOrderId);
...@@ -295,64 +310,17 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -295,64 +310,17 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
distributorProfit.setItemId(distributionOrder.getItemId()); distributorProfit.setItemId(distributionOrder.getItemId());
distributorProfit.setItemNum(distributionOrder.getItemNum()); distributorProfit.setItemNum(distributionOrder.getItemNum());
distributorProfit.setAmount(distributionOrder.getAmount()); distributorProfit.setAmount(distributionOrder.getAmount());
distributorProfit.setRealAmount(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(realAmount)));
distributorProfit.setItemCost(auctionConfig.getStartPrice()); distributorProfit.setItemCost(auctionConfig.getStartPrice());
distributorProfit.setChannelCost(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(channelServiceCost))); distributorProfit.setChannelCost(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(channelServiceCost)));
distributorProfit.setIntroduceCost(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(introduceCost))); distributorProfit.setIntroduceCost(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(introduceCost)));
long profit = distributionOrder.getAmount() - distributorProfit.getChannelCost() - distributorProfit.getIntroduceCost(); //拍卖订单,藏家的利润就是商品设置的供货价
distributorProfit.setProfit(profit); distributorProfit.setProfit(supplierItem.getSupplyPrice());
distributorProfit.setCreateTime(new Date()); distributorProfit.setCreateTime(new Date());
distributorProfit.setType(DistributionEnum.DistributionTypeEnum.AUCTION.getCode()); distributorProfit.setType(DistributionEnum.DistributionTypeEnum.AUCTION.getCode());
distributorProfit.setIsValid(false); distributorProfit.setIsValid(false);
distributorProfitDao.insert(distributorProfit); distributorProfitDao.insert(distributorProfit);
SupplierItem supplierItem = supplierItemDao.findById(dto.getItemId());
//去除了分销商的角色,无需计算分销佣金
//查询参与出价的所有用户所对应的分销商,可以平分成交额的3%的利润
/* List<AuctionRecord> auctionRecordList = auctionRecordDao.findByItemId(dto.getItemId());
List<AuctionRecord> filterRecordList = auctionRecordList.stream()
.filter(StringUtil.distinctByKey(AuctionRecord::getDistributorId))
.filter(a -> a.getDistributorId().longValue() != firstAuctionRecord.getDistributorId())
.collect(Collectors.toList());
for (AuctionRecord record : filterRecordList) {
Double allProfit = distributionOrder.getAmount().doubleValue() * 0.03;
int peopleNum = filterRecordList.size();
double averageProfit = allProfit / peopleNum;
DistributorProfit averageProfitRecord = new DistributorProfit();
averageProfitRecord.setDistributionOrderId(distributionOrderId);
averageProfitRecord.setDistributorId(record.getDistributorId());
averageProfitRecord.setItemId(distributionOrder.getItemId());
averageProfitRecord.setItemNum(distributionOrder.getItemNum());
averageProfitRecord.setAmount(distributionOrder.getAmount());
averageProfitRecord.setItemCost(0L);
averageProfitRecord.setProfit((long) Math.floor(averageProfit));
averageProfitRecord.setCreateTime(new Date());
averageProfitRecord.setIsValid(false);
distributorProfitDao.insert(averageProfitRecord);
//通知每一个分享参与出价的分销商
String distributorOpenId = sendMsgService.getOpenIdByUserId(record.getDistributorId());
if (com.xxdxxs.utils.StringUtils.hasLength(distributorOpenId)) {
AuctionOfferNoticeMsg auctionOfferNoticeMsg = new AuctionOfferNoticeMsg();
auctionOfferNoticeMsg.setCurrentPrice(PriceUtil.convertPriceFenToYuan(auctionRecord.getPrice()));
auctionOfferNoticeMsg.setOpenId(distributorOpenId);
auctionOfferNoticeMsg.setItemId(supplierItem.getId());
auctionOfferNoticeMsg.setItemName(supplierItem.getName());
auctionOfferNoticeMsg.setCurrentPrice(PriceUtil.convertPriceFenToYuan(distributionOrder.getAmount()));
auctionOfferNoticeMsg.setAuctionEndTime(auctionConfig.getRealEndTime());
auctionOfferNoticeMsg.setProfit(PriceUtil.convertDoubleToString(Math.floor(averageProfit)));
Result result = sendMsgService.auctionSuccessForDistributorsMsg(auctionOfferNoticeMsg);
if (!result.getSuccess()) {
String url = wxAppletApi.getUrlLink(AUCTION_MSG_URL, "itemId=" + supplierItem.getId() + "&shareRecordId=");
String msg = "您分享的拍品" + supplierItem.getName() + "已成拍,成交价是" + PriceUtil.convertPriceFenToYuan(distributionOrder.getAmount()) +
"元,您预计获得利润" + PriceUtil.convertDoubleToString(Math.floor(averageProfit)) + "元。请前往"+ url + "查看";
aliSmsSender.sendSms(record.getDistributorId(), msg);
}
} else {
String url = wxAppletApi.getUrlLink(AUCTION_MSG_URL,"itemId=" + supplierItem.getId() + "&shareRecordId=");
String msg = "您分享的拍品" + supplierItem.getName() + "已成拍,成交价是" + PriceUtil.convertPriceFenToYuan(distributionOrder.getAmount()) +
"元,您预计获得利润" + PriceUtil.convertDoubleToString(Math.floor(averageProfit)) + "元。请前往"+ url + "查看";
aliSmsSender.sendSms(record.getDistributorId(), msg);
}
}*/
//把该拍卖配置信息改为已处理, 拍品状态为"中拍未付款" //把该拍卖配置信息改为已处理, 拍品状态为"中拍未付款"
auctionConfigDao.setDeal(dto.getItemId(), AuctionEnum.StateEnum.GET_NOT_PAY.getCode()); auctionConfigDao.setDeal(dto.getItemId(), AuctionEnum.StateEnum.GET_NOT_PAY.getCode());
//发送中拍信息给用户 //发送中拍信息给用户
...@@ -442,8 +410,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -442,8 +410,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
followFansRecordRequestDto.setFansId(dto.getBuyerId()); followFansRecordRequestDto.setFansId(dto.getBuyerId());
FollowFansRecord followFansRecord = followFansRecordDao.findOne(followFansRecordRequestDto); FollowFansRecord followFansRecord = followFansRecordDao.findOne(followFansRecordRequestDto);
long introducerId; long introducerId;
//没有关注记录,则介绍费算作平台的
if (followFansRecord == null) { if (followFansRecord == null) {
introducerId = CommConsts.SYSTEM_SELLER; introducerId = CommConsts.SYSTEM_ACCOUNT;
} else { } else {
//把介绍人作为该订单的分享链接字段的值 //把介绍人作为该订单的分享链接字段的值
introducerId = followFansRecord.getIntroducerId(); introducerId = followFansRecord.getIntroducerId();
...@@ -482,18 +451,21 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -482,18 +451,21 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
channelCostRebate = channelCost.doubleValue(); channelCostRebate = channelCost.doubleValue();
} }
logger.info("藏家id:{} 生成新订单,平台服务费比例:{}", supplierItem.getCreatorId(), channelCostRebate); logger.info("藏家id:{} 生成新订单,平台服务费比例:{}", supplierItem.getCreatorId(), channelCostRebate);
double channelServiceCost = distributionOrder.getAmount().doubleValue() * channelCostRebate; //平台佣金还要减去微信的服务手续费1%,实际上平台佣金就是订单金额* (平台佣金比例(默认0.15)- 微信手续费(0.01))
double channelServiceCost = distributionOrder.getAmount().doubleValue() * (channelCostRebate - CommConsts.WX_COMMISSION_REBATE);
//实际订单到账金额
double realAmount = distributionOrder.getAmount().doubleValue() * (1 - CommConsts.WX_COMMISSION_REBATE);
//介绍人分佣,自己推荐获得的订单无需计算介绍佣金 //介绍人分佣,自己推荐获得的订单无需计算介绍佣金
// double introduceCost = 0;
// if (supplierItem.getCreatorId() != introducerId) {
double rebate = distributorProfitService.getIntroduceRebate(followFansRecordRequestDto); double rebate = distributorProfitService.getIntroduceRebate(followFansRecordRequestDto);
double introduceCost = distributionOrder.getAmount().doubleValue() * rebate; double introduceCost = distributionOrder.getAmount().doubleValue() * rebate;
// }
distributorProfit.setDistributionOrderId(distributionOrderId); distributorProfit.setDistributionOrderId(distributionOrderId);
distributorProfit.setDistributorId(distributionOrder.getSellerId()); distributorProfit.setDistributorId(distributionOrder.getSellerId());
distributorProfit.setItemId(distributionOrder.getItemId()); distributorProfit.setItemId(distributionOrder.getItemId());
distributorProfit.setItemNum(distributionOrder.getItemNum()); distributorProfit.setItemNum(distributionOrder.getItemNum());
distributorProfit.setAmount(distributionOrder.getAmount()); distributorProfit.setAmount(distributionOrder.getAmount());
distributorProfit.setRealAmount(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(realAmount)));
distributorProfit.setItemCost(null); distributorProfit.setItemCost(null);
distributorProfit.setChannelCost(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(channelServiceCost))); distributorProfit.setChannelCost(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(channelServiceCost)));
distributorProfit.setIntroduceCost(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(introduceCost))); distributorProfit.setIntroduceCost(PriceUtil.convertPriceFromStr(PriceUtil.convertDoubleToString(introduceCost)));
......
...@@ -533,33 +533,37 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -533,33 +533,37 @@ public class SupplierItemServiceImpl implements SupplierItemService {
Long itemId; Long itemId;
String shareRecordId = dto.getShareRecordId(); String shareRecordId = dto.getShareRecordId();
CollectionShareRecord collectionShareRecord = null; CollectionShareRecord collectionShareRecord = null;
long introducerId = CommConsts.SYSTEM_ACCOUNT;
if (StringUtils.isEmpty(shareRecordId) && dto.getId() == null) { if (StringUtils.isEmpty(shareRecordId) && dto.getId() == null) {
return Result.failed("商品信息为空"); return Result.failed("商品信息为空");
} else if (StringUtils.hasLength(shareRecordId) && ! shareRecordId.equals(CommConsts.DEFAULT_SHARE_ID)) { } else if (StringUtils.hasLength(shareRecordId) && ! shareRecordId.equals(CommConsts.DEFAULT_SHARE_ID)) {
collectionShareRecord = collectionShareRecordDao.findById(dto.getShareRecordId()); collectionShareRecord = collectionShareRecordDao.findById(dto.getShareRecordId());
introducerId = collectionShareRecord.getSharerId();
itemId = collectionShareRecord.getShareTargetId(); itemId = collectionShareRecord.getShareTargetId();
if (collectionShareRecord.getItemUserId().longValue() != dto.getUserId().longValue()) {
//客态进入别人的藏馆,自动关注
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFollowerId(collectionShareRecord.getItemUserId());
followFansRecordRequestDto.setFansId(dto.getUserId());
followFansRecordRequestDto.setIntroducerId(collectionShareRecord.getSharerId());
followFansRecordService.follow(followFansRecordRequestDto);
logger.info("通过藏品详情分享点击,用户id:{} 关注了 用户id为 {}, 介绍人为", dto.getUserId(), collectionShareRecord.getItemUserId(), collectionShareRecord.getSharerId());
}
} else { } else {
itemId = dto.getId(); itemId = dto.getId();
} }
if (itemId == null) { if (itemId == null) {
return Result.failed("没有对应的商品id"); return Result.failed("没有对应的商品id");
} }
if (collectionShareRecord.getItemUserId().longValue() != dto.getUserId().longValue()) {
//客态进入别人的藏馆,自动关注
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFollowerId(collectionShareRecord.getItemUserId());
followFansRecordRequestDto.setFansId(dto.getUserId());
followFansRecordRequestDto.setIntroducerId(introducerId);
Result followResult = followFansRecordService.follow(followFansRecordRequestDto);
if (followResult.getSuccess()) {
logger.info("通过藏品详情分享点击,用户id:{} 关注了 用户id为 {}, 介绍人为", dto.getUserId(), collectionShareRecord.getItemUserId(), collectionShareRecord.getSharerId());
} else {
logger.info("通过藏品详情分享点击关注用户返回信息 : {}" + followResult.getErrmsg());
}
}
//拍卖专场进入详情页,增加围观次数 //拍卖专场进入详情页,增加围观次数
specialPerformanceConfigDao.addViewNum(itemId); specialPerformanceConfigDao.addViewNum(itemId);
/* if (StringUtils.hasLength(shareRecordId) && !shareRecordId.equals(CommConsts.DEFAULT_SHARE_ID)) {
if (collectionShareRecord.getItemUserId().longValue() != dto.getUserId().longValue()) {
}
}*/
//查询商品所属专场id //查询商品所属专场id
SpecialPerformanceConfigRequestDto specialPerformanceConfigRequestDto = new SpecialPerformanceConfigRequestDto(); SpecialPerformanceConfigRequestDto specialPerformanceConfigRequestDto = new SpecialPerformanceConfigRequestDto();
specialPerformanceConfigRequestDto.setItemId(itemId); specialPerformanceConfigRequestDto.setItemId(itemId);
......
package com.wwdz.ch.wx.impl.distribution; package com.wwdz.ch.wx.impl.distribution;
import com.wwdz.ch.core.consts.BillEnum;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.distribution.UserAccountDetailDao; import com.wwdz.ch.db.dao.distribution.UserAccountDetailDao;
import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import com.wwdz.ch.db.domain.distribution.DistributorProfit;
import com.wwdz.ch.db.domain.distribution.UserAccountDetail;
import com.wwdz.ch.db.dto.request.distribution.UserAccountDetailRequestDto; import com.wwdz.ch.db.dto.request.distribution.UserAccountDetailRequestDto;
import com.wwdz.ch.wx.service.distribution.UserAccountDetailService; import com.wwdz.ch.wx.service.distribution.UserAccountDetailService;
import com.xxdxxs.utils.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -11,6 +17,8 @@ import org.springframework.stereotype.Service; ...@@ -11,6 +17,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
@Service @Service
public class UserAccountDetailServiceImpl implements UserAccountDetailService { public class UserAccountDetailServiceImpl implements UserAccountDetailService {
...@@ -19,10 +27,63 @@ public class UserAccountDetailServiceImpl implements UserAccountDetailService { ...@@ -19,10 +27,63 @@ public class UserAccountDetailServiceImpl implements UserAccountDetailService {
@Autowired @Autowired
UserAccountDetailDao userAccountDetailDao; UserAccountDetailDao userAccountDetailDao;
@Transactional(propagation=Propagation.REQUIRED) @Transactional(propagation=Propagation.REQUIRED)
@Override @Override
public Result create(UserAccountDetailRequestDto dto) throws Exception { public Result create(DistributionOrder distributionOrder, DistributorProfit distributorProfit) throws Exception {
try { try {
//订单金额
long orderAmount = distributionOrder.getAmount();
//平台佣金
long channelCost = distributorProfit.getChannelCost();
//介绍佣金
long introduceCost = distributorProfit.getIntroduceCost();
//卖家实际收益
long sellerProfitAmount = orderAmount - channelCost - introduceCost;
//记录卖家的收益
UserAccountDetail userAccountDetail = new UserAccountDetail();
userAccountDetail.setUserId(distributionOrder.getSellerId());
userAccountDetail.setTransactionId(distributionOrder.getDistributionOrderId());
userAccountDetail.setAmount(sellerProfitAmount);
userAccountDetail.setType(BillEnum.AccountDetailTypeEnum.ORDER.getCode());
userAccountDetail.setFundType(BillEnum.FundTypeEnum.INCOME.getCode());
//创建订单时状态是无效,等买家付款后变为待入账,订单完成变成已入账
userAccountDetail.setState(BillEnum.AccountDetailStateEnum.INVALID.getCode());
userAccountDetail.setCreateTime(distributionOrder.getCreateTime());
userAccountDetailDao.insert(userAccountDetail);
//记录平台佣金
UserAccountDetail channelAccountDetail = new UserAccountDetail();
channelAccountDetail.setUserId(CommConsts.SYSTEM_ACCOUNT);
channelAccountDetail.setTransactionId(distributionOrder.getDistributionOrderId());
channelAccountDetail.setAmount(channelCost);
channelAccountDetail.setType(BillEnum.AccountDetailTypeEnum.CHANNEL.getCode());
channelAccountDetail.setFundType(BillEnum.FundTypeEnum.INCOME.getCode());
//创建订单时状态是无效,等买家付款后变为待入账,订单完成变成已入账
channelAccountDetail.setState(BillEnum.AccountDetailStateEnum.INVALID.getCode());
channelAccountDetail.setCreateTime(distributionOrder.getCreateTime());
userAccountDetailDao.insert(channelAccountDetail);
//记录介绍佣金,判断介绍人是平台还是用户
UserAccountDetail introduceAccountDetail = new UserAccountDetail();
if (StringUtils.isEmpty(distributionOrder.getShareRecordId()) || CommConsts.DEFAULT_SHARE_ID.equals(distributionOrder.getShareRecordId())) {
introduceAccountDetail.setUserId(CommConsts.SYSTEM_ACCOUNT);
} else {
}
introduceAccountDetail.setTransactionId(distributionOrder.getDistributionOrderId());
introduceAccountDetail.setAmount(channelCost);
introduceAccountDetail.setType(BillEnum.AccountDetailTypeEnum.CHANNEL.getCode());
introduceAccountDetail.setFundType(BillEnum.FundTypeEnum.INCOME.getCode());
//创建订单时状态是无效,等买家付款后变为待入账,订单完成变成已入账
introduceAccountDetail.setState(BillEnum.AccountDetailStateEnum.INVALID.getCode());
introduceAccountDetail.setCreateTime(distributionOrder.getCreateTime());
userAccountDetailDao.insert(introduceAccountDetail);
return Result.success(); return Result.success();
...@@ -31,4 +92,7 @@ public class UserAccountDetailServiceImpl implements UserAccountDetailService { ...@@ -31,4 +92,7 @@ public class UserAccountDetailServiceImpl implements UserAccountDetailService {
throw new Exception(e); throw new Exception(e);
} }
} }
} }
package com.wwdz.ch.wx.service.distribution; package com.wwdz.ch.wx.service.distribution;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import com.wwdz.ch.db.domain.distribution.DistributorProfit;
import com.wwdz.ch.db.dto.request.distribution.UserAccountDetailRequestDto; import com.wwdz.ch.db.dto.request.distribution.UserAccountDetailRequestDto;
public interface UserAccountDetailService { public interface UserAccountDetailService {
...@@ -10,5 +12,5 @@ public interface UserAccountDetailService { ...@@ -10,5 +12,5 @@ public interface UserAccountDetailService {
* @param dto * @param dto
* @return * @return
*/ */
Result create(UserAccountDetailRequestDto dto) throws Exception; Result create(DistributionOrder distributionOrder, DistributorProfit distributorProfit) throws Exception;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment