Commit 85083d96 by wutong

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

parent 67d2e01c
...@@ -2,6 +2,7 @@ package com.bailuntec.domain.entity; ...@@ -2,6 +2,7 @@ package com.bailuntec.domain.entity;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@Data @Data
...@@ -88,6 +89,42 @@ public class DcMidTransit { ...@@ -88,6 +89,42 @@ public class DcMidTransit {
private LocalDateTime gmtOutStockModified; 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 was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_transit * This method corresponds to the database table dc_mid_transit
* *
...@@ -108,6 +145,10 @@ public class DcMidTransit { ...@@ -108,6 +145,10 @@ public class DcMidTransit {
sb.append(", gmtTransferModified=").append(gmtTransferModified); sb.append(", gmtTransferModified=").append(gmtTransferModified);
sb.append(", quantityOutStock=").append(quantityOutStock); sb.append(", quantityOutStock=").append(quantityOutStock);
sb.append(", gmtOutStockModified=").append(gmtOutStockModified); 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("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }
...@@ -138,7 +179,11 @@ public class DcMidTransit { ...@@ -138,7 +179,11 @@ public class DcMidTransit {
&& (this.getQuantityTransfer() == null ? other.getQuantityTransfer() == null : this.getQuantityTransfer().equals(other.getQuantityTransfer())) && (this.getQuantityTransfer() == null ? other.getQuantityTransfer() == null : this.getQuantityTransfer().equals(other.getQuantityTransfer()))
&& (this.getGmtTransferModified() == null ? other.getGmtTransferModified() == null : this.getGmtTransferModified().equals(other.getGmtTransferModified())) && (this.getGmtTransferModified() == null ? other.getGmtTransferModified() == null : this.getGmtTransferModified().equals(other.getGmtTransferModified()))
&& (this.getQuantityOutStock() == null ? other.getQuantityOutStock() == null : this.getQuantityOutStock().equals(other.getQuantityOutStock())) && (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 { ...@@ -160,6 +205,10 @@ public class DcMidTransit {
result = prime * result + ((getGmtTransferModified() == null) ? 0 : getGmtTransferModified().hashCode()); result = prime * result + ((getGmtTransferModified() == null) ? 0 : getGmtTransferModified().hashCode());
result = prime * result + ((getQuantityOutStock() == null) ? 0 : getQuantityOutStock().hashCode()); result = prime * result + ((getQuantityOutStock() == null) ? 0 : getQuantityOutStock().hashCode());
result = prime * result + ((getGmtOutStockModified() == null) ? 0 : getGmtOutStockModified().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; return result;
} }
} }
\ No newline at end of file
package com.bailuntec.domain.example; package com.bailuntec.domain.example;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -929,6 +930,246 @@ public class DcMidTransitExample { ...@@ -929,6 +930,246 @@ public class DcMidTransitExample {
addCriterion("gmt_out_stock_modified not between", value1, value2, "gmtOutStockModified"); addCriterion("gmt_out_stock_modified not between", value1, value2, "gmtOutStockModified");
return (Criteria) this; 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 { ...@@ -144,7 +144,7 @@ public interface DcMidTransitMapper {
LocalDateTime selectMaxPurchaseModified(); LocalDateTime selectMaxPurchaseModified();
LocalDateTime selectMaxUnshippedModified(); LocalDateTime selectMaxUnshippedModified();
void updateOldUnshippedToZero(@Param("unshippedModified")LocalDateTime unshippedModified); void updateOldUnshippedToZero(@Param("unshippedModified") LocalDateTime unshippedModified);
void calculateUnshipped(); void calculateUnshipped();
} }
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bailuntec.mapper.DcMidTransitMapper"> <mapper namespace="com.bailuntec.mapper.DcMidTransitMapper">
<resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcMidTransit"> <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcMidTransit">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
<id column="id" jdbcType="INTEGER" property="id"/> <id column="id" jdbcType="INTEGER" property="id" />
<result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku"/> <result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku" />
<result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode"/> <result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode" />
<result column="quantity_purchase" jdbcType="INTEGER" property="quantityPurchase"/> <result column="quantity_purchase" jdbcType="INTEGER" property="quantityPurchase" />
<result column="gmt_purchase_modified" jdbcType="TIMESTAMP" property="gmtPurchaseModified"/> <result column="gmt_purchase_modified" jdbcType="TIMESTAMP" property="gmtPurchaseModified" />
<result column="quantity_transfer" jdbcType="INTEGER" property="quantityTransfer"/> <result column="quantity_transfer" jdbcType="INTEGER" property="quantityTransfer" />
<result column="gmt_transfer_modified" jdbcType="TIMESTAMP" property="gmtTransferModified"/> <result column="gmt_transfer_modified" jdbcType="TIMESTAMP" property="gmtTransferModified" />
<result column="quantity_out_stock" jdbcType="INTEGER" property="quantityOutStock"/> <result column="quantity_out_stock" jdbcType="INTEGER" property="quantityOutStock" />
<result column="gmt_out_stock_modified" jdbcType="TIMESTAMP" property="gmtOutStockModified"/> <result column="gmt_out_stock_modified" jdbcType="TIMESTAMP" property="gmtOutStockModified" />
</resultMap> <result column="quantity_unshipped" jdbcType="INTEGER" property="quantityUnshipped" />
<sql id="Example_Where_Clause"> <result column="gmt_unshipped_modified" jdbcType="TIMESTAMP" property="gmtUnshippedModified" />
<!-- <result column="company_id" jdbcType="INTEGER" property="companyId" />
WARNING - @mbg.generated <result column="amount_purchase_transit" jdbcType="DECIMAL" property="amountPurchaseTransit" />
This element is automatically generated by MyBatis Generator, do not modify. </resultMap>
--> <sql id="Example_Where_Clause">
<where> <!--
<foreach collection="oredCriteria" item="criteria" separator="or"> WARNING - @mbg.generated
<if test="criteria.valid"> This element is automatically generated by MyBatis Generator, do not modify.
<trim prefix="(" prefixOverrides="and" suffix=")"> -->
<foreach collection="criteria.criteria" item="criterion"> <where>
<choose> <foreach collection="oredCriteria" item="criteria" separator="or">
<when test="criterion.noValue"> <if test="criteria.valid">
and ${criterion.condition} <trim prefix="(" prefixOverrides="and" suffix=")">
</when> <foreach collection="criteria.criteria" item="criterion">
<when test="criterion.singleValue"> <choose>
and ${criterion.condition} #{criterion.value} <when test="criterion.noValue">
</when> and ${criterion.condition}
<when test="criterion.betweenValue"> </when>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} <when test="criterion.singleValue">
</when> and ${criterion.condition} #{criterion.value}
<when test="criterion.listValue"> </when>
and ${criterion.condition} <when test="criterion.betweenValue">
<foreach close=")" collection="criterion.value" item="listItem" open="(" and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
separator=","> </when>
#{listItem} <when test="criterion.listValue">
</foreach> and ${criterion.condition}
</when> <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
</choose> #{listItem}
</foreach> </foreach>
</trim> </when>
</if> </choose>
</foreach> </foreach>
</where> </trim>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<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">
<!--
WARNING - @mbg.generated
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
</sql>
<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.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from dc_mid_transit
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="rows != null">
<if test="offset != null">
limit ${offset}, ${rows}
</if>
<if test="offset == null">
limit ${rows}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List"/>
from dc_mid_transit
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from dc_mid_transit
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from dc_mid_transit
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if> </if>
</delete> </foreach>
<insert id="insert" parameterType="com.bailuntec.domain.entity.DcMidTransit"> </where>
<!-- </sql>
WARNING - @mbg.generated <sql id="Update_By_Example_Where_Clause">
This element is automatically generated by MyBatis Generator, do not modify. <!--
--> WARNING - @mbg.generated
insert into dc_mid_transit (id, bailun_sku, warehouse_code, This element is automatically generated by MyBatis Generator, do not modify.
quantity_purchase, gmt_purchase_modified, -->
quantity_transfer, gmt_transfer_modified, <where>
quantity_out_stock, gmt_out_stock_modified <foreach collection="example.oredCriteria" item="criteria" separator="or">
) <if test="criteria.valid">
values (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, <trim prefix="(" prefixOverrides="and" suffix=")">
#{quantityPurchase,jdbcType=INTEGER}, #{gmtPurchaseModified,jdbcType=TIMESTAMP}, <foreach collection="criteria.criteria" item="criterion">
#{quantityTransfer,jdbcType=INTEGER}, #{gmtTransferModified,jdbcType=TIMESTAMP}, <choose>
#{quantityOutStock,jdbcType=INTEGER}, #{gmtOutStockModified,jdbcType=TIMESTAMP} <when test="criterion.noValue">
) and ${criterion.condition}
</insert> </when>
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcMidTransit"> <when test="criterion.singleValue">
<!-- and ${criterion.condition} #{criterion.value}
WARNING - @mbg.generated </when>
This element is automatically generated by MyBatis Generator, do not modify. <when test="criterion.betweenValue">
--> and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
insert into dc_mid_transit </when>
<trim prefix="(" suffix=")" suffixOverrides=","> <when test="criterion.listValue">
<if test="id != null"> and ${criterion.condition}
id, <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
</if> #{listItem}
<if test="bailunSku != null"> </foreach>
bailun_sku, </when>
</if> </choose>
<if test="warehouseCode != null"> </foreach>
warehouse_code, </trim>
</if>
<if test="quantityPurchase != null">
quantity_purchase,
</if>
<if test="gmtPurchaseModified != null">
gmt_purchase_modified,
</if>
<if test="quantityTransfer != null">
quantity_transfer,
</if>
<if test="gmtTransferModified != null">
gmt_transfer_modified,
</if>
<if test="quantityOutStock != null">
quantity_out_stock,
</if>
<if test="gmtOutStockModified != null">
gmt_out_stock_modified,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="bailunSku != null">
#{bailunSku,jdbcType=VARCHAR},
</if>
<if test="warehouseCode != null">
#{warehouseCode,jdbcType=VARCHAR},
</if>
<if test="quantityPurchase != null">
#{quantityPurchase,jdbcType=INTEGER},
</if>
<if test="gmtPurchaseModified != null">
#{gmtPurchaseModified,jdbcType=TIMESTAMP},
</if>
<if test="quantityTransfer != null">
#{quantityTransfer,jdbcType=INTEGER},
</if>
<if test="gmtTransferModified != null">
#{gmtTransferModified,jdbcType=TIMESTAMP},
</if>
<if test="quantityOutStock != null">
#{quantityOutStock,jdbcType=INTEGER},
</if>
<if test="gmtOutStockModified != null">
#{gmtOutStockModified,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<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"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dc_mid_transit
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.bailunSku != null">
bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
</if>
<if test="record.warehouseCode != null">
warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
</if>
<if test="record.quantityPurchase != null">
quantity_purchase = #{record.quantityPurchase,jdbcType=INTEGER},
</if>
<if test="record.gmtPurchaseModified != null">
gmt_purchase_modified = #{record.gmtPurchaseModified,jdbcType=TIMESTAMP},
</if>
<if test="record.quantityTransfer != null">
quantity_transfer = #{record.quantityTransfer,jdbcType=INTEGER},
</if>
<if test="record.gmtTransferModified != null">
gmt_transfer_modified = #{record.gmtTransferModified,jdbcType=TIMESTAMP},
</if>
<if test="record.quantityOutStock != null">
quantity_out_stock = #{record.quantityOutStock,jdbcType=INTEGER},
</if>
<if test="record.gmtOutStockModified != null">
gmt_out_stock_modified = #{record.gmtOutStockModified,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</update> </foreach>
<update id="updateByExample" parameterType="map"> </where>
<!-- </sql>
WARNING - @mbg.generated <sql id="Base_Column_List">
This element is automatically generated by MyBatis Generator, do not modify. <!--
--> WARNING - @mbg.generated
update dc_mid_transit This element is automatically generated by MyBatis Generator, do not modify.
set id = #{record.id,jdbcType=INTEGER}, -->
id, bailun_sku, warehouse_code, quantity_purchase, gmt_purchase_modified, quantity_transfer,
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">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from dc_mid_transit
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="rows != null">
<if test="offset != null">
limit ${offset}, ${rows}
</if>
<if test="offset == null">
limit ${rows}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from dc_mid_transit
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from dc_mid_transit
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from dc_mid_transit
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.bailuntec.domain.entity.DcMidTransit">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
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_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},
#{quantityUnshipped,jdbcType=INTEGER}, #{gmtUnshippedModified,jdbcType=TIMESTAMP},
#{companyId,jdbcType=INTEGER}, #{amountPurchaseTransit,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcMidTransit">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into dc_mid_transit
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="bailunSku != null">
bailun_sku,
</if>
<if test="warehouseCode != null">
warehouse_code,
</if>
<if test="quantityPurchase != null">
quantity_purchase,
</if>
<if test="gmtPurchaseModified != null">
gmt_purchase_modified,
</if>
<if test="quantityTransfer != null">
quantity_transfer,
</if>
<if test="gmtTransferModified != null">
gmt_transfer_modified,
</if>
<if test="quantityOutStock != null">
quantity_out_stock,
</if>
<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">
#{id,jdbcType=INTEGER},
</if>
<if test="bailunSku != null">
#{bailunSku,jdbcType=VARCHAR},
</if>
<if test="warehouseCode != null">
#{warehouseCode,jdbcType=VARCHAR},
</if>
<if test="quantityPurchase != null">
#{quantityPurchase,jdbcType=INTEGER},
</if>
<if test="gmtPurchaseModified != null">
#{gmtPurchaseModified,jdbcType=TIMESTAMP},
</if>
<if test="quantityTransfer != null">
#{quantityTransfer,jdbcType=INTEGER},
</if>
<if test="gmtTransferModified != null">
#{gmtTransferModified,jdbcType=TIMESTAMP},
</if>
<if test="quantityOutStock != null">
#{quantityOutStock,jdbcType=INTEGER},
</if>
<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">
<!--
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" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dc_mid_transit
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.bailunSku != null">
bailun_sku = #{record.bailunSku,jdbcType=VARCHAR}, bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
</if>
<if test="record.warehouseCode != null">
warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR}, warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
</if>
<if test="record.quantityPurchase != null">
quantity_purchase = #{record.quantityPurchase,jdbcType=INTEGER}, quantity_purchase = #{record.quantityPurchase,jdbcType=INTEGER},
</if>
<if test="record.gmtPurchaseModified != null">
gmt_purchase_modified = #{record.gmtPurchaseModified,jdbcType=TIMESTAMP}, gmt_purchase_modified = #{record.gmtPurchaseModified,jdbcType=TIMESTAMP},
</if>
<if test="record.quantityTransfer != null">
quantity_transfer = #{record.quantityTransfer,jdbcType=INTEGER}, quantity_transfer = #{record.quantityTransfer,jdbcType=INTEGER},
</if>
<if test="record.gmtTransferModified != null">
gmt_transfer_modified = #{record.gmtTransferModified,jdbcType=TIMESTAMP}, gmt_transfer_modified = #{record.gmtTransferModified,jdbcType=TIMESTAMP},
</if>
<if test="record.quantityOutStock != null">
quantity_out_stock = #{record.quantityOutStock,jdbcType=INTEGER}, quantity_out_stock = #{record.quantityOutStock,jdbcType=INTEGER},
gmt_out_stock_modified = #{record.gmtOutStockModified,jdbcType=TIMESTAMP} </if>
<if test="_parameter != null"> <if test="record.gmtOutStockModified != null">
<include refid="Update_By_Example_Where_Clause"/> gmt_out_stock_modified = #{record.gmtOutStockModified,jdbcType=TIMESTAMP},
</if> </if>
</update> <if test="record.quantityUnshipped != null">
<update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcMidTransit"> quantity_unshipped = #{record.quantityUnshipped,jdbcType=INTEGER},
<!-- </if>
WARNING - @mbg.generated <if test="record.gmtUnshippedModified != null">
This element is automatically generated by MyBatis Generator, do not modify. gmt_unshipped_modified = #{record.gmtUnshippedModified,jdbcType=TIMESTAMP},
--> </if>
update dc_mid_transit <if test="record.companyId != null">
<set> company_id = #{record.companyId,jdbcType=INTEGER},
<if test="bailunSku != null"> </if>
bailun_sku = #{bailunSku,jdbcType=VARCHAR}, <if test="record.amountPurchaseTransit != null">
</if> amount_purchase_transit = #{record.amountPurchaseTransit,jdbcType=DECIMAL},
<if test="warehouseCode != null"> </if>
warehouse_code = #{warehouseCode,jdbcType=VARCHAR}, </set>
</if> <if test="_parameter != null">
<if test="quantityPurchase != null"> <include refid="Update_By_Example_Where_Clause" />
quantity_purchase = #{quantityPurchase,jdbcType=INTEGER}, </if>
</if> </update>
<if test="gmtPurchaseModified != null"> <update id="updateByExample" parameterType="map">
gmt_purchase_modified = #{gmtPurchaseModified,jdbcType=TIMESTAMP}, <!--
</if> WARNING - @mbg.generated
<if test="quantityTransfer != null"> This element is automatically generated by MyBatis Generator, do not modify.
quantity_transfer = #{quantityTransfer,jdbcType=INTEGER}, -->
</if> update dc_mid_transit
<if test="gmtTransferModified != null"> set id = #{record.id,jdbcType=INTEGER},
gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP}, bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
</if> warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
<if test="quantityOutStock != null"> quantity_purchase = #{record.quantityPurchase,jdbcType=INTEGER},
quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER}, gmt_purchase_modified = #{record.gmtPurchaseModified,jdbcType=TIMESTAMP},
</if> quantity_transfer = #{record.quantityTransfer,jdbcType=INTEGER},
<if test="gmtOutStockModified != null"> gmt_transfer_modified = #{record.gmtTransferModified,jdbcType=TIMESTAMP},
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP}, quantity_out_stock = #{record.quantityOutStock,jdbcType=INTEGER},
</if> gmt_out_stock_modified = #{record.gmtOutStockModified,jdbcType=TIMESTAMP},
</set> quantity_unshipped = #{record.quantityUnshipped,jdbcType=INTEGER},
where id = #{id,jdbcType=INTEGER} gmt_unshipped_modified = #{record.gmtUnshippedModified,jdbcType=TIMESTAMP},
</update> company_id = #{record.companyId,jdbcType=INTEGER},
<update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcMidTransit"> amount_purchase_transit = #{record.amountPurchaseTransit,jdbcType=DECIMAL}
<!-- <if test="_parameter != null">
WARNING - @mbg.generated <include refid="Update_By_Example_Where_Clause" />
This element is automatically generated by MyBatis Generator, do not modify. </if>
--> </update>
update dc_mid_transit <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcMidTransit">
set bailun_sku = #{bailunSku,jdbcType=VARCHAR}, <!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dc_mid_transit
<set>
<if test="bailunSku != null">
bailun_sku = #{bailunSku,jdbcType=VARCHAR},
</if>
<if test="warehouseCode != null">
warehouse_code = #{warehouseCode,jdbcType=VARCHAR}, warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
</if>
<if test="quantityPurchase != null">
quantity_purchase = #{quantityPurchase,jdbcType=INTEGER}, quantity_purchase = #{quantityPurchase,jdbcType=INTEGER},
</if>
<if test="gmtPurchaseModified != null">
gmt_purchase_modified = #{gmtPurchaseModified,jdbcType=TIMESTAMP}, gmt_purchase_modified = #{gmtPurchaseModified,jdbcType=TIMESTAMP},
</if>
<if test="quantityTransfer != null">
quantity_transfer = #{quantityTransfer,jdbcType=INTEGER}, quantity_transfer = #{quantityTransfer,jdbcType=INTEGER},
</if>
<if test="gmtTransferModified != null">
gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP}, gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP},
</if>
<if test="quantityOutStock != null">
quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER}, quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER},
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP} </if>
where id = #{id,jdbcType=INTEGER} <if test="gmtOutStockModified != null">
</update> gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP},
<insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcMidTransit"> </if>
<!-- <if test="quantityUnshipped != null">
WARNING - @mbg.generated quantity_unshipped = #{quantityUnshipped,jdbcType=INTEGER},
This element is automatically generated by MyBatis Generator, do not modify. </if>
@project https://github.com/itfsw/mybatis-generator-plugin <if test="gmtUnshippedModified != null">
--> gmt_unshipped_modified = #{gmtUnshippedModified,jdbcType=TIMESTAMP},
insert into dc_mid_transit </if>
<trim prefix="(" suffix=")" suffixOverrides=","> <if test="companyId != null">
<if test="id != null"> company_id = #{companyId,jdbcType=INTEGER},
id, </if>
</if> <if test="amountPurchaseTransit != null">
<if test="bailunSku != null"> amount_purchase_transit = #{amountPurchaseTransit,jdbcType=DECIMAL},
bailun_sku, </if>
</if> </set>
<if test="warehouseCode != null"> where id = #{id,jdbcType=INTEGER}
warehouse_code, </update>
</if> <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcMidTransit">
<if test="quantityPurchase != null"> <!--
quantity_purchase, WARNING - @mbg.generated
</if> This element is automatically generated by MyBatis Generator, do not modify.
<if test="gmtPurchaseModified != null"> -->
gmt_purchase_modified, update dc_mid_transit
</if> set bailun_sku = #{bailunSku,jdbcType=VARCHAR},
<if test="quantityTransfer != null"> warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
quantity_transfer, quantity_purchase = #{quantityPurchase,jdbcType=INTEGER},
</if> gmt_purchase_modified = #{gmtPurchaseModified,jdbcType=TIMESTAMP},
<if test="gmtTransferModified != null"> quantity_transfer = #{quantityTransfer,jdbcType=INTEGER},
gmt_transfer_modified, gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP},
</if> quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER},
<if test="quantityOutStock != null"> gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP},
quantity_out_stock, quantity_unshipped = #{quantityUnshipped,jdbcType=INTEGER},
</if> gmt_unshipped_modified = #{gmtUnshippedModified,jdbcType=TIMESTAMP},
<if test="gmtOutStockModified != null"> company_id = #{companyId,jdbcType=INTEGER},
gmt_out_stock_modified, amount_purchase_transit = #{amountPurchaseTransit,jdbcType=DECIMAL}
</if> where id = #{id,jdbcType=INTEGER}
</trim> </update>
values <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcMidTransit">
<trim prefix="(" suffix=")" suffixOverrides=","> <!--
<if test="id != null"> WARNING - @mbg.generated
#{id,jdbcType=INTEGER}, This element is automatically generated by MyBatis Generator, do not modify.
</if> @project https://github.com/itfsw/mybatis-generator-plugin
<if test="bailunSku != null"> -->
#{bailunSku,jdbcType=VARCHAR}, insert into dc_mid_transit
</if> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warehouseCode != null"> <if test="id != null">
#{warehouseCode,jdbcType=VARCHAR}, id,
</if> </if>
<if test="quantityPurchase != null"> <if test="bailunSku != null">
#{quantityPurchase,jdbcType=INTEGER}, bailun_sku,
</if> </if>
<if test="gmtPurchaseModified != null"> <if test="warehouseCode != null">
#{gmtPurchaseModified,jdbcType=TIMESTAMP}, warehouse_code,
</if> </if>
<if test="quantityTransfer != null"> <if test="quantityPurchase != null">
#{quantityTransfer,jdbcType=INTEGER}, quantity_purchase,
</if> </if>
<if test="gmtTransferModified != null"> <if test="gmtPurchaseModified != null">
#{gmtTransferModified,jdbcType=TIMESTAMP}, gmt_purchase_modified,
</if> </if>
<if test="quantityOutStock != null"> <if test="quantityTransfer != null">
#{quantityOutStock,jdbcType=INTEGER}, quantity_transfer,
</if> </if>
<if test="gmtOutStockModified != null"> <if test="gmtTransferModified != null">
#{gmtOutStockModified,jdbcType=TIMESTAMP}, gmt_transfer_modified,
</if> </if>
</trim> <if test="quantityOutStock != null">
on duplicate key update quantity_out_stock,
<trim suffixOverrides=","> </if>
<if test="id != null"> <if test="gmtOutStockModified != null">
id = #{id,jdbcType=INTEGER}, gmt_out_stock_modified,
</if> </if>
<if test="bailunSku != null"> <if test="quantityUnshipped != null">
bailun_sku = #{bailunSku,jdbcType=VARCHAR}, quantity_unshipped,
</if> </if>
<if test="warehouseCode != null"> <if test="gmtUnshippedModified != null">
warehouse_code = #{warehouseCode,jdbcType=VARCHAR}, gmt_unshipped_modified,
</if> </if>
<if test="quantityPurchase != null"> <if test="companyId != null">
quantity_purchase = #{quantityPurchase,jdbcType=INTEGER}, company_id,
</if> </if>
<if test="gmtPurchaseModified != null"> <if test="amountPurchaseTransit != null">
gmt_purchase_modified = #{gmtPurchaseModified,jdbcType=TIMESTAMP}, amount_purchase_transit,
</if> </if>
<if test="quantityTransfer != null"> </trim>
quantity_transfer = #{quantityTransfer,jdbcType=INTEGER}, values
</if> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="gmtTransferModified != null"> <if test="id != null">
gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP}, #{id,jdbcType=INTEGER},
</if> </if>
<if test="quantityOutStock != null"> <if test="bailunSku != null">
quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR},
</if> </if>
<if test="gmtOutStockModified != null"> <if test="warehouseCode != null">
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP}, #{warehouseCode,jdbcType=VARCHAR},
</if> </if>
</trim> <if test="quantityPurchase != null">
</insert> #{quantityPurchase,jdbcType=INTEGER},
<insert id="upsert" parameterType="com.bailuntec.domain.entity.DcMidTransit"> </if>
<!-- <if test="gmtPurchaseModified != null">
WARNING - @mbg.generated #{gmtPurchaseModified,jdbcType=TIMESTAMP},
This element is automatically generated by MyBatis Generator, do not modify. </if>
@project https://github.com/itfsw/mybatis-generator-plugin <if test="quantityTransfer != null">
--> #{quantityTransfer,jdbcType=INTEGER},
insert into dc_mid_transit </if>
(id, bailun_sku, warehouse_code, quantity_purchase, gmt_purchase_modified, quantity_transfer, <if test="gmtTransferModified != null">
gmt_transfer_modified, quantity_out_stock, gmt_out_stock_modified) #{gmtTransferModified,jdbcType=TIMESTAMP},
values </if>
(#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, <if test="quantityOutStock != null">
#{quantityPurchase,jdbcType=INTEGER}, #{gmtPurchaseModified,jdbcType=TIMESTAMP}, #{quantityOutStock,jdbcType=INTEGER},
#{quantityTransfer,jdbcType=INTEGER}, #{gmtTransferModified,jdbcType=TIMESTAMP}, </if>
#{quantityOutStock,jdbcType=INTEGER}, #{gmtOutStockModified,jdbcType=TIMESTAMP} <if test="gmtOutStockModified != null">
) #{gmtOutStockModified,jdbcType=TIMESTAMP},
on duplicate key update </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=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER}, id = #{id,jdbcType=INTEGER},
</if>
<if test="bailunSku != null">
bailun_sku = #{bailunSku,jdbcType=VARCHAR}, bailun_sku = #{bailunSku,jdbcType=VARCHAR},
</if>
<if test="warehouseCode != null">
warehouse_code = #{warehouseCode,jdbcType=VARCHAR}, warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
</if>
<if test="quantityPurchase != null">
quantity_purchase = #{quantityPurchase,jdbcType=INTEGER}, quantity_purchase = #{quantityPurchase,jdbcType=INTEGER},
</if>
<if test="gmtPurchaseModified != null">
gmt_purchase_modified = #{gmtPurchaseModified,jdbcType=TIMESTAMP}, gmt_purchase_modified = #{gmtPurchaseModified,jdbcType=TIMESTAMP},
</if>
<if test="quantityTransfer != null">
quantity_transfer = #{quantityTransfer,jdbcType=INTEGER}, quantity_transfer = #{quantityTransfer,jdbcType=INTEGER},
</if>
<if test="gmtTransferModified != null">
gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP}, gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP},
</if>
<if test="quantityOutStock != null">
quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER}, quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER},
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP} </if>
</insert> <if test="gmtOutStockModified != null">
<select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample" gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP},
resultMap="BaseResultMap"> </if>
<!-- <if test="quantityUnshipped != null">
WARNING - @mbg.generated quantity_unshipped = #{quantityUnshipped,jdbcType=INTEGER},
This element is automatically generated by MyBatis Generator, do not modify. </if>
@project https://github.com/itfsw/mybatis-generator-plugin <if test="gmtUnshippedModified != null">
--> gmt_unshipped_modified = #{gmtUnshippedModified,jdbcType=TIMESTAMP},
select </if>
<include refid="Base_Column_List"/> <if test="companyId != null">
from dc_mid_transit company_id = #{companyId,jdbcType=INTEGER},
<if test="_parameter != null"> </if>
<include refid="Example_Where_Clause"/> <if test="amountPurchaseTransit != null">
</if> amount_purchase_transit = #{amountPurchaseTransit,jdbcType=DECIMAL},
<if test="orderByClause != null"> </if>
order by ${orderByClause} </trim>
</if> </insert>
limit 1 <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcMidTransit">
</select> <!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
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_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},
#{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},
warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
quantity_purchase = #{quantityPurchase,jdbcType=INTEGER},
gmt_purchase_modified = #{gmtPurchaseModified,jdbcType=TIMESTAMP},
quantity_transfer = #{quantityTransfer,jdbcType=INTEGER},
gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP},
quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER},
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">
<!--
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" />
from dc_mid_transit
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<insert id="calculateTransferTransit">
<insert id="calculateTransferTransit">
insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_transfer, gmt_transfer_modified) insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_transfer, gmt_transfer_modified)
select bailun_sku, warehouse_code, sum(count), CURRENT_TIMESTAMP select bailun_sku, warehouse_code, sum(count), CURRENT_TIMESTAMP
from ( from (
...@@ -550,18 +651,71 @@ ...@@ -550,18 +651,71 @@
gmt_transfer_modified = VALUES(gmt_transfer_modified) gmt_transfer_modified = VALUES(gmt_transfer_modified)
</insert> </insert>
<insert id="calculatePurchaseTransit"> <insert id="calculatePurchaseTransit">
insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_purchase,gmt_purchase_modified) insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_purchase,amount_purchase_transit,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
(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 bailun_sku,
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 warehouse_code,
on tb1.bailun_sku = tb2.bailun_sku sum( count ) as count,
AND tb1.parent_id = tb2.parent_id sum( count * price ) AS amount_purchase_transit,
GROUP BY tb1.bailun_sku, tb1.warehouse_code HAVING count>0 CURRENT_TIMESTAMP
ON DUPLICATE KEY UPDATE quantity_purchase = VALUES(quantity_purchase), gmt_purchase_modified = VALUES(gmt_purchase_modified) 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,
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>
<insert id="insertMidDailyTransit"> <insert id="insertMidDailyTransit">
INSERT into dc_daily_transit ( INSERT into dc_daily_transit (
`bailun_sku` , `bailun_sku` ,
`warehouse_code`, `warehouse_code`,
...@@ -575,7 +729,7 @@ ...@@ -575,7 +729,7 @@
FROM dc_mid_transit FROM dc_mid_transit
</insert> </insert>
<insert id="calculateOutStock"> <insert id="calculateOutStock">
insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_out_stock,gmt_out_stock_modified) insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_out_stock,gmt_out_stock_modified)
SELECT SELECT
t1.bailun_sku, t1.bailun_sku,
...@@ -605,32 +759,32 @@ ...@@ -605,32 +759,32 @@
WHERE (t1.bailun_sku_quantity_ordered - t1.bailun_sku_quantity_picked - t2.usable_stock - t2.occupy_stock) >= 0 WHERE (t1.bailun_sku_quantity_ordered - t1.bailun_sku_quantity_picked - t2.usable_stock - t2.occupy_stock) >= 0
ON DUPLICATE KEY UPDATE quantity_out_stock = VALUES(quantity_out_stock),gmt_out_stock_modified = VALUES(gmt_out_stock_modified) ON DUPLICATE KEY UPDATE quantity_out_stock = VALUES(quantity_out_stock),gmt_out_stock_modified = VALUES(gmt_out_stock_modified)
</insert> </insert>
<update id="updateOldOutStockToZero"> <update id="updateOldOutStockToZero">
update dc_mid_transit set quantity_out_stock =0 where gmt_out_stock_modified &lt; #{outStockModified,jdbcType=TIMESTAMP} update dc_mid_transit set quantity_out_stock =0 where gmt_out_stock_modified &lt; #{outStockModified,jdbcType=TIMESTAMP}
</update> </update>
<update id="updateOldTransferToZero"> <update id="updateOldTransferToZero">
update dc_mid_transit set quantity_transfer =0 where gmt_transfer_modified &lt; #{transferModified,jdbcType=TIMESTAMP} update dc_mid_transit set quantity_transfer =0 where gmt_transfer_modified &lt; #{transferModified,jdbcType=TIMESTAMP}
</update> </update>
<update id="updateOldPurchaseToZero"> <update id="updateOldPurchaseToZero">
update dc_mid_transit set quantity_purchase =0 where gmt_purchase_modified &lt; #{purchaseModified,jdbcType=TIMESTAMP} update dc_mid_transit set quantity_purchase =0 where gmt_purchase_modified &lt; #{purchaseModified,jdbcType=TIMESTAMP}
</update> </update>
<update id="updateOldUnshippedToZero"> <update id="updateOldUnshippedToZero">
update dc_mid_transit set quantity_unshipped =0 where gmt_unshipped_modified &lt; #{unshippedModified,jdbcType=TIMESTAMP} update dc_mid_transit set quantity_unshipped =0 where gmt_unshipped_modified &lt; #{unshippedModified,jdbcType=TIMESTAMP}
</update> </update>
<select id="selectMaxOutStockModified" resultType="java.time.LocalDateTime"> <select id="selectMaxOutStockModified" resultType="java.time.LocalDateTime">
select max(gmt_out_stock_modified) from dc_mid_transit select max(gmt_out_stock_modified) from dc_mid_transit
</select> </select>
<select id="selectMaxTransferModified" resultType="java.time.LocalDateTime"> <select id="selectMaxTransferModified" resultType="java.time.LocalDateTime">
select max(gmt_transfer_modified) from dc_mid_transit select max(gmt_transfer_modified) from dc_mid_transit
</select> </select>
<select id="selectMaxPurchaseModified" resultType="java.time.LocalDateTime"> <select id="selectMaxPurchaseModified" resultType="java.time.LocalDateTime">
select max(gmt_purchase_modified) from dc_mid_transit select max(gmt_purchase_modified) from dc_mid_transit
</select> </select>
<select id="selectMaxUnshippedModified" resultType="java.time.LocalDateTime"> <select id="selectMaxUnshippedModified" resultType="java.time.LocalDateTime">
select max(gmt_unshipped_modified) from dc_mid_transit select max(gmt_unshipped_modified) from dc_mid_transit
</select> </select>
<insert id="calculateUnshipped"> <insert id="calculateUnshipped">
insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_unshipped,gmt_unshipped_modified) insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_unshipped,gmt_unshipped_modified)
SELECT SELECT
t1.bailun_sku, t1.bailun_sku,
......
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