Commit 85083d96 by wutong

采购在途增加在途金额字段, 根据每个采购单单价* 数量汇总而成

parent 67d2e01c
......@@ -2,6 +2,7 @@ package com.bailuntec.domain.entity;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
......@@ -88,6 +89,42 @@ public class DcMidTransit {
private LocalDateTime gmtOutStockModified;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_mid_transit.quantity_unshipped
*
* @mbg.generated
*/
private Integer quantityUnshipped;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_mid_transit.gmt_unshipped_modified
*
* @mbg.generated
*/
private LocalDateTime gmtUnshippedModified;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_mid_transit.company_id
*
* @mbg.generated
*/
private Integer companyId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_mid_transit.amount_purchase_transit
*
* @mbg.generated
*/
private BigDecimal amountPurchaseTransit;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_transit
*
......@@ -108,6 +145,10 @@ public class DcMidTransit {
sb.append(", gmtTransferModified=").append(gmtTransferModified);
sb.append(", quantityOutStock=").append(quantityOutStock);
sb.append(", gmtOutStockModified=").append(gmtOutStockModified);
sb.append(", quantityUnshipped=").append(quantityUnshipped);
sb.append(", gmtUnshippedModified=").append(gmtUnshippedModified);
sb.append(", companyId=").append(companyId);
sb.append(", amountPurchaseTransit=").append(amountPurchaseTransit);
sb.append("]");
return sb.toString();
}
......@@ -138,7 +179,11 @@ public class DcMidTransit {
&& (this.getQuantityTransfer() == null ? other.getQuantityTransfer() == null : this.getQuantityTransfer().equals(other.getQuantityTransfer()))
&& (this.getGmtTransferModified() == null ? other.getGmtTransferModified() == null : this.getGmtTransferModified().equals(other.getGmtTransferModified()))
&& (this.getQuantityOutStock() == null ? other.getQuantityOutStock() == null : this.getQuantityOutStock().equals(other.getQuantityOutStock()))
&& (this.getGmtOutStockModified() == null ? other.getGmtOutStockModified() == null : this.getGmtOutStockModified().equals(other.getGmtOutStockModified()));
&& (this.getGmtOutStockModified() == null ? other.getGmtOutStockModified() == null : this.getGmtOutStockModified().equals(other.getGmtOutStockModified()))
&& (this.getQuantityUnshipped() == null ? other.getQuantityUnshipped() == null : this.getQuantityUnshipped().equals(other.getQuantityUnshipped()))
&& (this.getGmtUnshippedModified() == null ? other.getGmtUnshippedModified() == null : this.getGmtUnshippedModified().equals(other.getGmtUnshippedModified()))
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
&& (this.getAmountPurchaseTransit() == null ? other.getAmountPurchaseTransit() == null : this.getAmountPurchaseTransit().equals(other.getAmountPurchaseTransit()));
}
/**
......@@ -160,6 +205,10 @@ public class DcMidTransit {
result = prime * result + ((getGmtTransferModified() == null) ? 0 : getGmtTransferModified().hashCode());
result = prime * result + ((getQuantityOutStock() == null) ? 0 : getQuantityOutStock().hashCode());
result = prime * result + ((getGmtOutStockModified() == null) ? 0 : getGmtOutStockModified().hashCode());
result = prime * result + ((getQuantityUnshipped() == null) ? 0 : getQuantityUnshipped().hashCode());
result = prime * result + ((getGmtUnshippedModified() == null) ? 0 : getGmtUnshippedModified().hashCode());
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
result = prime * result + ((getAmountPurchaseTransit() == null) ? 0 : getAmountPurchaseTransit().hashCode());
return result;
}
}
\ No newline at end of file
package com.bailuntec.domain.example;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
......@@ -929,6 +930,246 @@ public class DcMidTransitExample {
addCriterion("gmt_out_stock_modified not between", value1, value2, "gmtOutStockModified");
return (Criteria) this;
}
public Criteria andQuantityUnshippedIsNull() {
addCriterion("quantity_unshipped is null");
return (Criteria) this;
}
public Criteria andQuantityUnshippedIsNotNull() {
addCriterion("quantity_unshipped is not null");
return (Criteria) this;
}
public Criteria andQuantityUnshippedEqualTo(Integer value) {
addCriterion("quantity_unshipped =", value, "quantityUnshipped");
return (Criteria) this;
}
public Criteria andQuantityUnshippedNotEqualTo(Integer value) {
addCriterion("quantity_unshipped <>", value, "quantityUnshipped");
return (Criteria) this;
}
public Criteria andQuantityUnshippedGreaterThan(Integer value) {
addCriterion("quantity_unshipped >", value, "quantityUnshipped");
return (Criteria) this;
}
public Criteria andQuantityUnshippedGreaterThanOrEqualTo(Integer value) {
addCriterion("quantity_unshipped >=", value, "quantityUnshipped");
return (Criteria) this;
}
public Criteria andQuantityUnshippedLessThan(Integer value) {
addCriterion("quantity_unshipped <", value, "quantityUnshipped");
return (Criteria) this;
}
public Criteria andQuantityUnshippedLessThanOrEqualTo(Integer value) {
addCriterion("quantity_unshipped <=", value, "quantityUnshipped");
return (Criteria) this;
}
public Criteria andQuantityUnshippedIn(List<Integer> values) {
addCriterion("quantity_unshipped in", values, "quantityUnshipped");
return (Criteria) this;
}
public Criteria andQuantityUnshippedNotIn(List<Integer> values) {
addCriterion("quantity_unshipped not in", values, "quantityUnshipped");
return (Criteria) this;
}
public Criteria andQuantityUnshippedBetween(Integer value1, Integer value2) {
addCriterion("quantity_unshipped between", value1, value2, "quantityUnshipped");
return (Criteria) this;
}
public Criteria andQuantityUnshippedNotBetween(Integer value1, Integer value2) {
addCriterion("quantity_unshipped not between", value1, value2, "quantityUnshipped");
return (Criteria) this;
}
public Criteria andGmtUnshippedModifiedIsNull() {
addCriterion("gmt_unshipped_modified is null");
return (Criteria) this;
}
public Criteria andGmtUnshippedModifiedIsNotNull() {
addCriterion("gmt_unshipped_modified is not null");
return (Criteria) this;
}
public Criteria andGmtUnshippedModifiedEqualTo(LocalDateTime value) {
addCriterion("gmt_unshipped_modified =", value, "gmtUnshippedModified");
return (Criteria) this;
}
public Criteria andGmtUnshippedModifiedNotEqualTo(LocalDateTime value) {
addCriterion("gmt_unshipped_modified <>", value, "gmtUnshippedModified");
return (Criteria) this;
}
public Criteria andGmtUnshippedModifiedGreaterThan(LocalDateTime value) {
addCriterion("gmt_unshipped_modified >", value, "gmtUnshippedModified");
return (Criteria) this;
}
public Criteria andGmtUnshippedModifiedGreaterThanOrEqualTo(LocalDateTime value) {
addCriterion("gmt_unshipped_modified >=", value, "gmtUnshippedModified");
return (Criteria) this;
}
public Criteria andGmtUnshippedModifiedLessThan(LocalDateTime value) {
addCriterion("gmt_unshipped_modified <", value, "gmtUnshippedModified");
return (Criteria) this;
}
public Criteria andGmtUnshippedModifiedLessThanOrEqualTo(LocalDateTime value) {
addCriterion("gmt_unshipped_modified <=", value, "gmtUnshippedModified");
return (Criteria) this;
}
public Criteria andGmtUnshippedModifiedIn(List<LocalDateTime> values) {
addCriterion("gmt_unshipped_modified in", values, "gmtUnshippedModified");
return (Criteria) this;
}
public Criteria andGmtUnshippedModifiedNotIn(List<LocalDateTime> values) {
addCriterion("gmt_unshipped_modified not in", values, "gmtUnshippedModified");
return (Criteria) this;
}
public Criteria andGmtUnshippedModifiedBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("gmt_unshipped_modified between", value1, value2, "gmtUnshippedModified");
return (Criteria) this;
}
public Criteria andGmtUnshippedModifiedNotBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("gmt_unshipped_modified not between", value1, value2, "gmtUnshippedModified");
return (Criteria) this;
}
public Criteria andCompanyIdIsNull() {
addCriterion("company_id is null");
return (Criteria) this;
}
public Criteria andCompanyIdIsNotNull() {
addCriterion("company_id is not null");
return (Criteria) this;
}
public Criteria andCompanyIdEqualTo(Integer value) {
addCriterion("company_id =", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotEqualTo(Integer value) {
addCriterion("company_id <>", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThan(Integer value) {
addCriterion("company_id >", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThanOrEqualTo(Integer value) {
addCriterion("company_id >=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThan(Integer value) {
addCriterion("company_id <", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThanOrEqualTo(Integer value) {
addCriterion("company_id <=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdIn(List<Integer> values) {
addCriterion("company_id in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotIn(List<Integer> values) {
addCriterion("company_id not in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdBetween(Integer value1, Integer value2) {
addCriterion("company_id between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotBetween(Integer value1, Integer value2) {
addCriterion("company_id not between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andAmountPurchaseTransitIsNull() {
addCriterion("amount_purchase_transit is null");
return (Criteria) this;
}
public Criteria andAmountPurchaseTransitIsNotNull() {
addCriterion("amount_purchase_transit is not null");
return (Criteria) this;
}
public Criteria andAmountPurchaseTransitEqualTo(BigDecimal value) {
addCriterion("amount_purchase_transit =", value, "amountPurchaseTransit");
return (Criteria) this;
}
public Criteria andAmountPurchaseTransitNotEqualTo(BigDecimal value) {
addCriterion("amount_purchase_transit <>", value, "amountPurchaseTransit");
return (Criteria) this;
}
public Criteria andAmountPurchaseTransitGreaterThan(BigDecimal value) {
addCriterion("amount_purchase_transit >", value, "amountPurchaseTransit");
return (Criteria) this;
}
public Criteria andAmountPurchaseTransitGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("amount_purchase_transit >=", value, "amountPurchaseTransit");
return (Criteria) this;
}
public Criteria andAmountPurchaseTransitLessThan(BigDecimal value) {
addCriterion("amount_purchase_transit <", value, "amountPurchaseTransit");
return (Criteria) this;
}
public Criteria andAmountPurchaseTransitLessThanOrEqualTo(BigDecimal value) {
addCriterion("amount_purchase_transit <=", value, "amountPurchaseTransit");
return (Criteria) this;
}
public Criteria andAmountPurchaseTransitIn(List<BigDecimal> values) {
addCriterion("amount_purchase_transit in", values, "amountPurchaseTransit");
return (Criteria) this;
}
public Criteria andAmountPurchaseTransitNotIn(List<BigDecimal> values) {
addCriterion("amount_purchase_transit not in", values, "amountPurchaseTransit");
return (Criteria) this;
}
public Criteria andAmountPurchaseTransitBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("amount_purchase_transit between", value1, value2, "amountPurchaseTransit");
return (Criteria) this;
}
public Criteria andAmountPurchaseTransitNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("amount_purchase_transit not between", value1, value2, "amountPurchaseTransit");
return (Criteria) this;
}
}
/**
......
......@@ -144,7 +144,7 @@ public interface DcMidTransitMapper {
LocalDateTime selectMaxPurchaseModified();
LocalDateTime selectMaxUnshippedModified();
void updateOldUnshippedToZero(@Param("unshippedModified")LocalDateTime unshippedModified);
void updateOldUnshippedToZero(@Param("unshippedModified") LocalDateTime unshippedModified);
void calculateUnshipped();
}
\ No newline at end of file
......@@ -6,15 +6,19 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku"/>
<result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode"/>
<result column="quantity_purchase" jdbcType="INTEGER" property="quantityPurchase"/>
<result column="gmt_purchase_modified" jdbcType="TIMESTAMP" property="gmtPurchaseModified"/>
<result column="quantity_transfer" jdbcType="INTEGER" property="quantityTransfer"/>
<result column="gmt_transfer_modified" jdbcType="TIMESTAMP" property="gmtTransferModified"/>
<result column="quantity_out_stock" jdbcType="INTEGER" property="quantityOutStock"/>
<result column="gmt_out_stock_modified" jdbcType="TIMESTAMP" property="gmtOutStockModified"/>
<id column="id" jdbcType="INTEGER" property="id" />
<result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku" />
<result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode" />
<result column="quantity_purchase" jdbcType="INTEGER" property="quantityPurchase" />
<result column="gmt_purchase_modified" jdbcType="TIMESTAMP" property="gmtPurchaseModified" />
<result column="quantity_transfer" jdbcType="INTEGER" property="quantityTransfer" />
<result column="gmt_transfer_modified" jdbcType="TIMESTAMP" property="gmtTransferModified" />
<result column="quantity_out_stock" jdbcType="INTEGER" property="quantityOutStock" />
<result column="gmt_out_stock_modified" jdbcType="TIMESTAMP" property="gmtOutStockModified" />
<result column="quantity_unshipped" jdbcType="INTEGER" property="quantityUnshipped" />
<result column="gmt_unshipped_modified" jdbcType="TIMESTAMP" property="gmtUnshippedModified" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
<result column="amount_purchase_transit" jdbcType="DECIMAL" property="amountPurchaseTransit" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
......@@ -38,8 +42,7 @@
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
......@@ -72,8 +75,7 @@
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
......@@ -90,10 +92,10 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, bailun_sku, warehouse_code, quantity_purchase, gmt_purchase_modified, quantity_transfer,
gmt_transfer_modified, quantity_out_stock, gmt_out_stock_modified
gmt_transfer_modified, quantity_out_stock, gmt_out_stock_modified, quantity_unshipped,
gmt_unshipped_modified, company_id, amount_purchase_transit
</sql>
<select id="selectByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample"
resultMap="BaseResultMap">
<select id="selectByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
......@@ -102,10 +104,10 @@
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
<include refid="Base_Column_List" />
from dc_mid_transit
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
......@@ -125,7 +127,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List"/>
<include refid="Base_Column_List" />
from dc_mid_transit
where id = #{id,jdbcType=INTEGER}
</select>
......@@ -144,7 +146,7 @@
-->
delete from dc_mid_transit
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.bailuntec.domain.entity.DcMidTransit">
......@@ -155,13 +157,15 @@
insert into dc_mid_transit (id, bailun_sku, warehouse_code,
quantity_purchase, gmt_purchase_modified,
quantity_transfer, gmt_transfer_modified,
quantity_out_stock, gmt_out_stock_modified
)
quantity_out_stock, gmt_out_stock_modified,
quantity_unshipped, gmt_unshipped_modified,
company_id, amount_purchase_transit)
values (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR},
#{quantityPurchase,jdbcType=INTEGER}, #{gmtPurchaseModified,jdbcType=TIMESTAMP},
#{quantityTransfer,jdbcType=INTEGER}, #{gmtTransferModified,jdbcType=TIMESTAMP},
#{quantityOutStock,jdbcType=INTEGER}, #{gmtOutStockModified,jdbcType=TIMESTAMP}
)
#{quantityOutStock,jdbcType=INTEGER}, #{gmtOutStockModified,jdbcType=TIMESTAMP},
#{quantityUnshipped,jdbcType=INTEGER}, #{gmtUnshippedModified,jdbcType=TIMESTAMP},
#{companyId,jdbcType=INTEGER}, #{amountPurchaseTransit,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcMidTransit">
<!--
......@@ -197,6 +201,18 @@
<if test="gmtOutStockModified != null">
gmt_out_stock_modified,
</if>
<if test="quantityUnshipped != null">
quantity_unshipped,
</if>
<if test="gmtUnshippedModified != null">
gmt_unshipped_modified,
</if>
<if test="companyId != null">
company_id,
</if>
<if test="amountPurchaseTransit != null">
amount_purchase_transit,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -226,17 +242,28 @@
<if test="gmtOutStockModified != null">
#{gmtOutStockModified,jdbcType=TIMESTAMP},
</if>
<if test="quantityUnshipped != null">
#{quantityUnshipped,jdbcType=INTEGER},
</if>
<if test="gmtUnshippedModified != null">
#{gmtUnshippedModified,jdbcType=TIMESTAMP},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
</if>
<if test="amountPurchaseTransit != null">
#{amountPurchaseTransit,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample"
resultType="java.lang.Long">
<select id="countByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from dc_mid_transit
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
......@@ -273,9 +300,21 @@
<if test="record.gmtOutStockModified != null">
gmt_out_stock_modified = #{record.gmtOutStockModified,jdbcType=TIMESTAMP},
</if>
<if test="record.quantityUnshipped != null">
quantity_unshipped = #{record.quantityUnshipped,jdbcType=INTEGER},
</if>
<if test="record.gmtUnshippedModified != null">
gmt_unshipped_modified = #{record.gmtUnshippedModified,jdbcType=TIMESTAMP},
</if>
<if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=INTEGER},
</if>
<if test="record.amountPurchaseTransit != null">
amount_purchase_transit = #{record.amountPurchaseTransit,jdbcType=DECIMAL},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
......@@ -292,9 +331,13 @@
quantity_transfer = #{record.quantityTransfer,jdbcType=INTEGER},
gmt_transfer_modified = #{record.gmtTransferModified,jdbcType=TIMESTAMP},
quantity_out_stock = #{record.quantityOutStock,jdbcType=INTEGER},
gmt_out_stock_modified = #{record.gmtOutStockModified,jdbcType=TIMESTAMP}
gmt_out_stock_modified = #{record.gmtOutStockModified,jdbcType=TIMESTAMP},
quantity_unshipped = #{record.quantityUnshipped,jdbcType=INTEGER},
gmt_unshipped_modified = #{record.gmtUnshippedModified,jdbcType=TIMESTAMP},
company_id = #{record.companyId,jdbcType=INTEGER},
amount_purchase_transit = #{record.amountPurchaseTransit,jdbcType=DECIMAL}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcMidTransit">
......@@ -328,6 +371,18 @@
<if test="gmtOutStockModified != null">
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP},
</if>
<if test="quantityUnshipped != null">
quantity_unshipped = #{quantityUnshipped,jdbcType=INTEGER},
</if>
<if test="gmtUnshippedModified != null">
gmt_unshipped_modified = #{gmtUnshippedModified,jdbcType=TIMESTAMP},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
</if>
<if test="amountPurchaseTransit != null">
amount_purchase_transit = #{amountPurchaseTransit,jdbcType=DECIMAL},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -344,7 +399,11 @@
quantity_transfer = #{quantityTransfer,jdbcType=INTEGER},
gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP},
quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER},
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP}
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP},
quantity_unshipped = #{quantityUnshipped,jdbcType=INTEGER},
gmt_unshipped_modified = #{gmtUnshippedModified,jdbcType=TIMESTAMP},
company_id = #{companyId,jdbcType=INTEGER},
amount_purchase_transit = #{amountPurchaseTransit,jdbcType=DECIMAL}
where id = #{id,jdbcType=INTEGER}
</update>
<insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcMidTransit">
......@@ -382,6 +441,18 @@
<if test="gmtOutStockModified != null">
gmt_out_stock_modified,
</if>
<if test="quantityUnshipped != null">
quantity_unshipped,
</if>
<if test="gmtUnshippedModified != null">
gmt_unshipped_modified,
</if>
<if test="companyId != null">
company_id,
</if>
<if test="amountPurchaseTransit != null">
amount_purchase_transit,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -412,6 +483,18 @@
<if test="gmtOutStockModified != null">
#{gmtOutStockModified,jdbcType=TIMESTAMP},
</if>
<if test="quantityUnshipped != null">
#{quantityUnshipped,jdbcType=INTEGER},
</if>
<if test="gmtUnshippedModified != null">
#{gmtUnshippedModified,jdbcType=TIMESTAMP},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
</if>
<if test="amountPurchaseTransit != null">
#{amountPurchaseTransit,jdbcType=DECIMAL},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
......@@ -442,6 +525,18 @@
<if test="gmtOutStockModified != null">
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP},
</if>
<if test="quantityUnshipped != null">
quantity_unshipped = #{quantityUnshipped,jdbcType=INTEGER},
</if>
<if test="gmtUnshippedModified != null">
gmt_unshipped_modified = #{gmtUnshippedModified,jdbcType=TIMESTAMP},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
</if>
<if test="amountPurchaseTransit != null">
amount_purchase_transit = #{amountPurchaseTransit,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<insert id="upsert" parameterType="com.bailuntec.domain.entity.DcMidTransit">
......@@ -452,13 +547,15 @@
-->
insert into dc_mid_transit
(id, bailun_sku, warehouse_code, quantity_purchase, gmt_purchase_modified, quantity_transfer,
gmt_transfer_modified, quantity_out_stock, gmt_out_stock_modified)
gmt_transfer_modified, quantity_out_stock, gmt_out_stock_modified, quantity_unshipped,
gmt_unshipped_modified, company_id, amount_purchase_transit)
values
(#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR},
#{quantityPurchase,jdbcType=INTEGER}, #{gmtPurchaseModified,jdbcType=TIMESTAMP},
#{quantityTransfer,jdbcType=INTEGER}, #{gmtTransferModified,jdbcType=TIMESTAMP},
#{quantityOutStock,jdbcType=INTEGER}, #{gmtOutStockModified,jdbcType=TIMESTAMP}
)
#{quantityOutStock,jdbcType=INTEGER}, #{gmtOutStockModified,jdbcType=TIMESTAMP},
#{quantityUnshipped,jdbcType=INTEGER}, #{gmtUnshippedModified,jdbcType=TIMESTAMP},
#{companyId,jdbcType=INTEGER}, #{amountPurchaseTransit,jdbcType=DECIMAL})
on duplicate key update
id = #{id,jdbcType=INTEGER},
bailun_sku = #{bailunSku,jdbcType=VARCHAR},
......@@ -468,20 +565,23 @@
quantity_transfer = #{quantityTransfer,jdbcType=INTEGER},
gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP},
quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER},
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP}
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP},
quantity_unshipped = #{quantityUnshipped,jdbcType=INTEGER},
gmt_unshipped_modified = #{gmtUnshippedModified,jdbcType=TIMESTAMP},
company_id = #{companyId,jdbcType=INTEGER},
amount_purchase_transit = #{amountPurchaseTransit,jdbcType=DECIMAL}
</insert>
<select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample"
resultMap="BaseResultMap">
<select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample" 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
<include refid="Base_Column_List"/>
<include refid="Base_Column_List" />
from dc_mid_transit
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
......@@ -490,6 +590,7 @@
</select>
<insert id="calculateTransferTransit">
insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_transfer, gmt_transfer_modified)
select bailun_sku, warehouse_code, sum(count), CURRENT_TIMESTAMP
......@@ -551,14 +652,67 @@
</insert>
<insert id="calculatePurchaseTransit">
insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_purchase,gmt_purchase_modified)
SELECT tb1.bailun_sku as bailun_sku,tb1.warehouse_code as warehouse_code,sum((tb1.count - IFNULL(tb2.count,0))) as count,CURRENT_TIMESTAMP FROM
(SELECT bailun_sku, warehouse_code, parent_id, sum(count) as count FROM dc_base_purchase WHERE buy_status IN ( 0, 1, 2, 3 ) and has_delete=0 GROUP BY bailun_sku,parent_id) tb1
LEFT JOIN (SELECT bailun_sku, warehouse_code, parent_id, sum(count) as count FROM dc_base_purchase_inbound GROUP BY bailun_sku,parent_id) tb2
on tb1.bailun_sku = tb2.bailun_sku
insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_purchase,amount_purchase_transit,gmt_purchase_modified)
SELECT
bailun_sku,
warehouse_code,
sum( count ) as count,
sum( count * price ) AS amount_purchase_transit,
CURRENT_TIMESTAMP
FROM
(
SELECT
tb1.bailun_sku AS bailun_sku,
tb1.warehouse_code AS warehouse_code,
tb1.purchase_id AS purchase_id,
sum( ( tb1.count - IFNULL( tb2.count, 0 ) ) ) AS count,
price
FROM
(
SELECT
bailun_sku,
warehouse_code,
parent_id,
purchase_id,
estimated_arrival_time,
has_transfer,
sum( count ) AS count,
price
FROM
dc_base_purchase
WHERE
buy_status IN ( 0, 1, 2, 3 )
AND has_delete = 0
GROUP BY
bailun_sku,
parent_id
) tb1
LEFT JOIN (
SELECT
bailun_sku,
warehouse_code,
parent_id,
sum( count ) AS count
FROM
dc_base_purchase_inbound
WHERE
1=1
GROUP BY
bailun_sku,
parent_id
) tb2 ON tb1.bailun_sku = tb2.bailun_sku
AND tb1.parent_id = tb2.parent_id
GROUP BY tb1.bailun_sku, tb1.warehouse_code HAVING count>0
ON DUPLICATE KEY UPDATE quantity_purchase = VALUES(quantity_purchase), gmt_purchase_modified = VALUES(gmt_purchase_modified)
GROUP BY
tb1.bailun_sku,
tb1.warehouse_code,
tb1.purchase_id
) t
GROUP BY
bailun_sku,
warehouse_code
HAVING
count > 0
ON DUPLICATE KEY UPDATE quantity_purchase = VALUES(quantity_purchase), amount_purchase_transit = VALUES(amount_purchase_transit), gmt_purchase_modified = VALUES(gmt_purchase_modified)
</insert>
<insert id="insertMidDailyTransit">
......
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