Commit d5dadeee by wutong

调拨单在途考虑到调拨计划单

parent 669f8b1b
<?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> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!-- <!--
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.
--> -->
<where> <where>
<foreach collection="oredCriteria" item="criteria" separator="or"> <foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid"> <if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")"> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion"> <foreach collection="criteria.criteria" item="criterion">
<choose> <choose>
<when test="criterion.noValue"> <when test="criterion.noValue">
and ${criterion.condition} and ${criterion.condition}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> <foreach close=")" collection="criterion.value" item="listItem" open="("
#{listItem} separator=",">
</foreach> #{listItem}
</when> </foreach>
</choose> </when>
</choose>
</foreach>
</trim>
</if>
</foreach> </foreach>
</trim> </where>
</if> </sql>
</foreach> <sql id="Update_By_Example_Where_Clause">
</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 <where>
This element is automatically generated by MyBatis Generator, do not modify. <foreach collection="example.oredCriteria" item="criteria" separator="or">
--> <if test="criteria.valid">
<where> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="example.oredCriteria" item="criteria" separator="or"> <foreach collection="criteria.criteria" item="criterion">
<if test="criteria.valid"> <choose>
<trim prefix="(" prefixOverrides="and" suffix=")"> <when test="criterion.noValue">
<foreach collection="criteria.criteria" item="criterion"> and ${criterion.condition}
<choose> </when>
<when test="criterion.noValue"> <when test="criterion.singleValue">
and ${criterion.condition} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.listValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition}
</when> <foreach close=")" collection="criterion.value" item="listItem" open="("
<when test="criterion.listValue"> separator=",">
and ${criterion.condition} #{listItem}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> </foreach>
#{listItem} </when>
</foreach> </choose>
</when> </foreach>
</choose> </trim>
</if>
</foreach> </foreach>
</trim> </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> </if>
</foreach> <include refid="Base_Column_List"/>
</where> from dc_mid_transit
</sql> <if test="_parameter != null">
<sql id="Base_Column_List"> <include refid="Example_Where_Clause"/>
<!-- </if>
WARNING - @mbg.generated <if test="orderByClause != null">
This element is automatically generated by MyBatis Generator, do not modify. order by ${orderByClause}
--> </if>
id, bailun_sku, warehouse_code, quantity_purchase, gmt_purchase_modified, quantity_transfer, <if test="rows != null">
gmt_transfer_modified, quantity_out_stock, gmt_out_stock_modified <if test="offset != null">
</sql> limit ${offset}, ${rows}
<select id="selectByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample" resultMap="BaseResultMap"> </if>
<!-- <if test="offset == null">
WARNING - @mbg.generated limit ${rows}
This element is automatically generated by MyBatis Generator, do not modify. </if>
--> </if>
select </select>
<if test="distinct"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
distinct <!--
</if> WARNING - @mbg.generated
<include refid="Base_Column_List" /> This element is automatically generated by MyBatis Generator, do not modify.
from dc_mid_transit -->
<if test="_parameter != null"> select
<include refid="Example_Where_Clause" /> <include refid="Base_Column_List"/>
</if> from dc_mid_transit
<if test="orderByClause != null"> where id = #{id,jdbcType=INTEGER}
order by ${orderByClause} </select>
</if> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<if test="rows != null"> <!--
<if test="offset != null"> WARNING - @mbg.generated
limit ${offset}, ${rows} This element is automatically generated by MyBatis Generator, do not modify.
</if> -->
<if test="offset == null"> delete from dc_mid_transit
limit ${rows} where id = #{id,jdbcType=INTEGER}
</if> </delete>
</if> <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample">
</select> <!--
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> WARNING - @mbg.generated
<!-- This element is automatically generated by MyBatis Generator, do not modify.
WARNING - @mbg.generated -->
This element is automatically generated by MyBatis Generator, do not modify. delete from dc_mid_transit
--> <if test="_parameter != null">
select <include refid="Example_Where_Clause"/>
<include refid="Base_Column_List" /> </if>
from dc_mid_transit </delete>
where id = #{id,jdbcType=INTEGER} <insert id="insert" parameterType="com.bailuntec.domain.entity.DcMidTransit">
</select> <!--
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> WARNING - @mbg.generated
<!-- This element is automatically generated by MyBatis Generator, do not modify.
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,
delete from dc_mid_transit quantity_transfer, gmt_transfer_modified,
where id = #{id,jdbcType=INTEGER} quantity_out_stock, gmt_out_stock_modified
</delete> )
<delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample"> values (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR},
<!-- #{quantityPurchase,jdbcType=INTEGER}, #{gmtPurchaseModified,jdbcType=TIMESTAMP},
WARNING - @mbg.generated #{quantityTransfer,jdbcType=INTEGER}, #{gmtTransferModified,jdbcType=TIMESTAMP},
This element is automatically generated by MyBatis Generator, do not modify. #{quantityOutStock,jdbcType=INTEGER}, #{gmtOutStockModified,jdbcType=TIMESTAMP}
--> )
delete from dc_mid_transit </insert>
<if test="_parameter != null"> <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcMidTransit">
<include refid="Example_Where_Clause" /> <!--
</if> WARNING - @mbg.generated
</delete> This element is automatically generated by MyBatis Generator, do not modify.
<insert id="insert" parameterType="com.bailuntec.domain.entity.DcMidTransit"> -->
<!-- insert into dc_mid_transit
WARNING - @mbg.generated <trim prefix="(" suffix=")" suffixOverrides=",">
This element is automatically generated by MyBatis Generator, do not modify. <if test="id != null">
--> id,
insert into dc_mid_transit (id, bailun_sku, warehouse_code, </if>
quantity_purchase, gmt_purchase_modified, <if test="bailunSku != null">
quantity_transfer, gmt_transfer_modified, bailun_sku,
quantity_out_stock, gmt_out_stock_modified </if>
) <if test="warehouseCode != null">
values (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, warehouse_code,
#{quantityPurchase,jdbcType=INTEGER}, #{gmtPurchaseModified,jdbcType=TIMESTAMP}, </if>
#{quantityTransfer,jdbcType=INTEGER}, #{gmtTransferModified,jdbcType=TIMESTAMP}, <if test="quantityPurchase != null">
#{quantityOutStock,jdbcType=INTEGER}, #{gmtOutStockModified,jdbcType=TIMESTAMP} quantity_purchase,
) </if>
</insert> <if test="gmtPurchaseModified != null">
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcMidTransit"> gmt_purchase_modified,
<!-- </if>
WARNING - @mbg.generated <if test="quantityTransfer != null">
This element is automatically generated by MyBatis Generator, do not modify. quantity_transfer,
--> </if>
insert into dc_mid_transit <if test="gmtTransferModified != null">
<trim prefix="(" suffix=")" suffixOverrides=","> gmt_transfer_modified,
<if test="id != null"> </if>
id, <if test="quantityOutStock != null">
</if> quantity_out_stock,
<if test="bailunSku != null"> </if>
bailun_sku, <if test="gmtOutStockModified != null">
</if> gmt_out_stock_modified,
<if test="warehouseCode != null"> </if>
warehouse_code, </trim>
</if> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="quantityPurchase != null"> <if test="id != null">
quantity_purchase, #{id,jdbcType=INTEGER},
</if> </if>
<if test="gmtPurchaseModified != null"> <if test="bailunSku != null">
gmt_purchase_modified, #{bailunSku,jdbcType=VARCHAR},
</if> </if>
<if test="quantityTransfer != null"> <if test="warehouseCode != null">
quantity_transfer, #{warehouseCode,jdbcType=VARCHAR},
</if> </if>
<if test="gmtTransferModified != null"> <if test="quantityPurchase != null">
gmt_transfer_modified, #{quantityPurchase,jdbcType=INTEGER},
</if> </if>
<if test="quantityOutStock != null"> <if test="gmtPurchaseModified != null">
quantity_out_stock, #{gmtPurchaseModified,jdbcType=TIMESTAMP},
</if> </if>
<if test="gmtOutStockModified != null"> <if test="quantityTransfer != null">
gmt_out_stock_modified, #{quantityTransfer,jdbcType=INTEGER},
</if> </if>
</trim> <if test="gmtTransferModified != null">
<trim prefix="values (" suffix=")" suffixOverrides=","> #{gmtTransferModified,jdbcType=TIMESTAMP},
<if test="id != null"> </if>
#{id,jdbcType=INTEGER}, <if test="quantityOutStock != null">
</if> #{quantityOutStock,jdbcType=INTEGER},
<if test="bailunSku != null"> </if>
#{bailunSku,jdbcType=VARCHAR}, <if test="gmtOutStockModified != null">
</if> #{gmtOutStockModified,jdbcType=TIMESTAMP},
<if test="warehouseCode != null"> </if>
#{warehouseCode,jdbcType=VARCHAR}, </trim>
</if> </insert>
<if test="quantityPurchase != null"> <select id="countByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample"
#{quantityPurchase,jdbcType=INTEGER}, resultType="java.lang.Long">
</if> <!--
<if test="gmtPurchaseModified != null"> WARNING - @mbg.generated
#{gmtPurchaseModified,jdbcType=TIMESTAMP}, This element is automatically generated by MyBatis Generator, do not modify.
</if> -->
<if test="quantityTransfer != null"> select count(*) from dc_mid_transit
#{quantityTransfer,jdbcType=INTEGER}, <if test="_parameter != null">
</if> <include refid="Example_Where_Clause"/>
<if test="gmtTransferModified != null"> </if>
#{gmtTransferModified,jdbcType=TIMESTAMP}, </select>
</if> <update id="updateByExampleSelective" parameterType="map">
<if test="quantityOutStock != null"> <!--
#{quantityOutStock,jdbcType=INTEGER}, WARNING - @mbg.generated
</if> This element is automatically generated by MyBatis Generator, do not modify.
<if test="gmtOutStockModified != null"> -->
#{gmtOutStockModified,jdbcType=TIMESTAMP}, update dc_mid_transit
</if> <set>
</trim> <if test="record.id != null">
</insert> id = #{record.id,jdbcType=INTEGER},
<select id="countByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample" resultType="java.lang.Long"> </if>
<!-- <if test="record.bailunSku != null">
WARNING - @mbg.generated bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
This element is automatically generated by MyBatis Generator, do not modify. </if>
--> <if test="record.warehouseCode != null">
select count(*) from dc_mid_transit warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
<if test="_parameter != null"> </if>
<include refid="Example_Where_Clause" /> <if test="record.quantityPurchase != null">
</if> quantity_purchase = #{record.quantityPurchase,jdbcType=INTEGER},
</select> </if>
<update id="updateByExampleSelective" parameterType="map"> <if test="record.gmtPurchaseModified != null">
<!-- gmt_purchase_modified = #{record.gmtPurchaseModified,jdbcType=TIMESTAMP},
WARNING - @mbg.generated </if>
This element is automatically generated by MyBatis Generator, do not modify. <if test="record.quantityTransfer != null">
--> quantity_transfer = #{record.quantityTransfer,jdbcType=INTEGER},
update dc_mid_transit </if>
<set> <if test="record.gmtTransferModified != null">
<if test="record.id != null"> gmt_transfer_modified = #{record.gmtTransferModified,jdbcType=TIMESTAMP},
id = #{record.id,jdbcType=INTEGER}, </if>
</if> <if test="record.quantityOutStock != null">
<if test="record.bailunSku != 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>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dc_mid_transit
set id = #{record.id,jdbcType=INTEGER},
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},
</if> gmt_out_stock_modified = #{record.gmtOutStockModified,jdbcType=TIMESTAMP}
<if test="record.gmtOutStockModified != null"> <if test="_parameter != null">
gmt_out_stock_modified = #{record.gmtOutStockModified,jdbcType=TIMESTAMP}, <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</set> </update>
<if test="_parameter != null"> <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcMidTransit">
<include refid="Update_By_Example_Where_Clause" /> <!--
</if> WARNING - @mbg.generated
</update> This element is automatically generated by MyBatis Generator, do not modify.
<update id="updateByExample" parameterType="map"> -->
<!-- update dc_mid_transit
WARNING - @mbg.generated <set>
This element is automatically generated by MyBatis Generator, do not modify. <if test="bailunSku != null">
--> bailun_sku = #{bailunSku,jdbcType=VARCHAR},
update dc_mid_transit </if>
set id = #{record.id,jdbcType=INTEGER}, <if test="warehouseCode != null">
bailun_sku = #{record.bailunSku,jdbcType=VARCHAR}, warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR}, </if>
quantity_purchase = #{record.quantityPurchase,jdbcType=INTEGER}, <if test="quantityPurchase != null">
gmt_purchase_modified = #{record.gmtPurchaseModified,jdbcType=TIMESTAMP}, quantity_purchase = #{quantityPurchase,jdbcType=INTEGER},
quantity_transfer = #{record.quantityTransfer,jdbcType=INTEGER}, </if>
gmt_transfer_modified = #{record.gmtTransferModified,jdbcType=TIMESTAMP}, <if test="gmtPurchaseModified != null">
quantity_out_stock = #{record.quantityOutStock,jdbcType=INTEGER}, gmt_purchase_modified = #{gmtPurchaseModified,jdbcType=TIMESTAMP},
gmt_out_stock_modified = #{record.gmtOutStockModified,jdbcType=TIMESTAMP} </if>
<if test="_parameter != null"> <if test="quantityTransfer != null">
<include refid="Update_By_Example_Where_Clause" /> quantity_transfer = #{quantityTransfer,jdbcType=INTEGER},
</if> </if>
</update> <if test="gmtTransferModified != null">
<update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcMidTransit"> gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP},
<!-- </if>
WARNING - @mbg.generated <if test="quantityOutStock != null">
This element is automatically generated by MyBatis Generator, do not modify. quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER},
--> </if>
update dc_mid_transit <if test="gmtOutStockModified != null">
<set> gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP},
<if test="bailunSku != null"> </if>
bailun_sku = #{bailunSku,jdbcType=VARCHAR}, </set>
</if> where id = #{id,jdbcType=INTEGER}
<if test="warehouseCode != null"> </update>
<update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcMidTransit">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dc_mid_transit
set bailun_sku = #{bailunSku,jdbcType=VARCHAR},
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},
</if> gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP}
<if test="gmtOutStockModified != null"> where id = #{id,jdbcType=INTEGER}
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP}, </update>
</if> <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcMidTransit">
</set> <!--
where id = #{id,jdbcType=INTEGER} WARNING - @mbg.generated
</update> This element is automatically generated by MyBatis Generator, do not modify.
<update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcMidTransit"> @project https://github.com/itfsw/mybatis-generator-plugin
<!-- -->
WARNING - @mbg.generated insert into dc_mid_transit
This element is automatically generated by MyBatis Generator, do not modify. <trim prefix="(" suffix=")" suffixOverrides=",">
--> <if test="id != null">
update dc_mid_transit id,
set bailun_sku = #{bailunSku,jdbcType=VARCHAR}, </if>
warehouse_code = #{warehouseCode,jdbcType=VARCHAR}, <if test="bailunSku != null">
quantity_purchase = #{quantityPurchase,jdbcType=INTEGER}, bailun_sku,
gmt_purchase_modified = #{gmtPurchaseModified,jdbcType=TIMESTAMP}, </if>
quantity_transfer = #{quantityTransfer,jdbcType=INTEGER}, <if test="warehouseCode != null">
gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP}, warehouse_code,
quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER}, </if>
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP} <if test="quantityPurchase != null">
where id = #{id,jdbcType=INTEGER} quantity_purchase,
</update> </if>
<insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcMidTransit"> <if test="gmtPurchaseModified != null">
<!-- gmt_purchase_modified,
WARNING - @mbg.generated </if>
This element is automatically generated by MyBatis Generator, do not modify. <if test="quantityTransfer != null">
@project https://github.com/itfsw/mybatis-generator-plugin quantity_transfer,
--> </if>
insert into dc_mid_transit <if test="gmtTransferModified != null">
<trim prefix="(" suffix=")" suffixOverrides=","> gmt_transfer_modified,
<if test="id != null"> </if>
id, <if test="quantityOutStock != null">
</if> quantity_out_stock,
<if test="bailunSku != null"> </if>
bailun_sku, <if test="gmtOutStockModified != null">
</if> gmt_out_stock_modified,
<if test="warehouseCode != null"> </if>
warehouse_code, </trim>
</if> values
<if test="quantityPurchase != null"> <trim prefix="(" suffix=")" suffixOverrides=",">
quantity_purchase, <if test="id != null">
</if> #{id,jdbcType=INTEGER},
<if test="gmtPurchaseModified != null"> </if>
gmt_purchase_modified, <if test="bailunSku != null">
</if> #{bailunSku,jdbcType=VARCHAR},
<if test="quantityTransfer != null"> </if>
quantity_transfer, <if test="warehouseCode != null">
</if> #{warehouseCode,jdbcType=VARCHAR},
<if test="gmtTransferModified != null"> </if>
gmt_transfer_modified, <if test="quantityPurchase != null">
</if> #{quantityPurchase,jdbcType=INTEGER},
<if test="quantityOutStock != null"> </if>
quantity_out_stock, <if test="gmtPurchaseModified != null">
</if> #{gmtPurchaseModified,jdbcType=TIMESTAMP},
<if test="gmtOutStockModified != null"> </if>
gmt_out_stock_modified, <if test="quantityTransfer != null">
</if> #{quantityTransfer,jdbcType=INTEGER},
</trim> </if>
values <if test="gmtTransferModified != null">
<trim prefix="(" suffix=")" suffixOverrides=","> #{gmtTransferModified,jdbcType=TIMESTAMP},
<if test="id != null"> </if>
#{id,jdbcType=INTEGER}, <if test="quantityOutStock != null">
</if> #{quantityOutStock,jdbcType=INTEGER},
<if test="bailunSku != null"> </if>
#{bailunSku,jdbcType=VARCHAR}, <if test="gmtOutStockModified != null">
</if> #{gmtOutStockModified,jdbcType=TIMESTAMP},
<if test="warehouseCode != null"> </if>
#{warehouseCode,jdbcType=VARCHAR}, </trim>
</if> on duplicate key update
<if test="quantityPurchase != null"> <trim suffixOverrides=",">
#{quantityPurchase,jdbcType=INTEGER}, <if test="id != null">
</if> id = #{id,jdbcType=INTEGER},
<if test="gmtPurchaseModified != null"> </if>
#{gmtPurchaseModified,jdbcType=TIMESTAMP}, <if test="bailunSku != null">
</if> bailun_sku = #{bailunSku,jdbcType=VARCHAR},
<if test="quantityTransfer != null"> </if>
#{quantityTransfer,jdbcType=INTEGER}, <if test="warehouseCode != null">
</if> warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
<if test="gmtTransferModified != null"> </if>
#{gmtTransferModified,jdbcType=TIMESTAMP}, <if test="quantityPurchase != null">
</if> quantity_purchase = #{quantityPurchase,jdbcType=INTEGER},
<if test="quantityOutStock != null"> </if>
#{quantityOutStock,jdbcType=INTEGER}, <if test="gmtPurchaseModified != null">
</if> gmt_purchase_modified = #{gmtPurchaseModified,jdbcType=TIMESTAMP},
<if test="gmtOutStockModified != null"> </if>
#{gmtOutStockModified,jdbcType=TIMESTAMP}, <if test="quantityTransfer != null">
</if> quantity_transfer = #{quantityTransfer,jdbcType=INTEGER},
</trim> </if>
on duplicate key update <if test="gmtTransferModified != null">
<trim suffixOverrides=","> gmt_transfer_modified = #{gmtTransferModified,jdbcType=TIMESTAMP},
<if test="id != null"> </if>
<if test="quantityOutStock != null">
quantity_out_stock = #{quantityOutStock,jdbcType=INTEGER},
</if>
<if test="gmtOutStockModified != null">
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<insert id="upsert" parameterType="com.bailuntec.domain.entity.DcMidTransit">
<!--
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)
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}
)
on duplicate key update
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},
</if> gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP}
<if test="gmtOutStockModified != null"> </insert>
gmt_out_stock_modified = #{gmtOutStockModified,jdbcType=TIMESTAMP}, <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcMidTransitExample"
</if> resultMap="BaseResultMap">
</trim> <!--
</insert> WARNING - @mbg.generated
<insert id="upsert" parameterType="com.bailuntec.domain.entity.DcMidTransit"> This element is automatically generated by MyBatis Generator, do not modify.
<!-- @project https://github.com/itfsw/mybatis-generator-plugin
WARNING - @mbg.generated -->
This element is automatically generated by MyBatis Generator, do not modify. select
@project https://github.com/itfsw/mybatis-generator-plugin <include refid="Base_Column_List"/>
--> from dc_mid_transit
insert into dc_mid_transit <if test="_parameter != null">
(id, bailun_sku, warehouse_code, quantity_purchase, gmt_purchase_modified, quantity_transfer, <include refid="Example_Where_Clause"/>
gmt_transfer_modified, quantity_out_stock, gmt_out_stock_modified) </if>
values <if test="orderByClause != null">
(#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, order by ${orderByClause}
#{quantityPurchase,jdbcType=INTEGER}, #{gmtPurchaseModified,jdbcType=TIMESTAMP}, </if>
#{quantityTransfer,jdbcType=INTEGER}, #{gmtTransferModified,jdbcType=TIMESTAMP}, limit 1
#{quantityOutStock,jdbcType=INTEGER}, #{gmtOutStockModified,jdbcType=TIMESTAMP} </select>
)
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}
</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 into dc_mid_transit(bailun_sku, warehouse_code, quantity_transfer, gmt_transfer_modified)
select bailun_sku, warehouse_code, sum(count), CURRENT_TIMESTAMP
from (
SELECT tb5.bailun_sku bailun_sku,
tb5.warehouse_code warehouse_code,
(tb5.count - IFNULL(tb4.count, 0)) AS count
FROM (
SELECT tb1.bailun_sku,
tb1.warehouse_code,
sum(tb1.count) count
FROM dc_base_transfer_bale tb1
LEFT JOIN dc_base_transfer_complete tb2 ON tb1.deleted = tb2.deleted
AND tb1.bailun_sku = tb2.bailun_sku
AND tb1.warehouse_code = tb2.warehouse_code
AND tb1.transfer_order_id = tb2.transfer_order_id
WHERE tb2.bailun_sku IS NULL
AND tb1.deleted = 0
GROUP BY bailun_sku,
warehouse_code
) tb5
LEFT JOIN (
SELECT bailun_sku,
warehouse_code,
sum(count) count
FROM (
SELECT tb1.bailun_sku,
tb1.warehouse_code,
max(tb1.count) count,
tb1.transfer_order_id
FROM dc_base_transfer_inbound tb1
LEFT JOIN dc_base_transfer_complete tb2 ON tb2.deleted = 0
AND tb1.bailun_sku = tb2.bailun_sku
AND tb1.warehouse_code = tb2.warehouse_code
AND tb1.transfer_order_id = tb2.transfer_order_id
WHERE tb2.bailun_sku IS NULL
AND tb1.deleted = 0
GROUP BY bailun_sku,
warehouse_code,
transfer_order_id
) tb3
GROUP BY bailun_sku,
warehouse_code
) tb4
ON tb5.bailun_sku = tb4.bailun_sku
AND tb5.warehouse_code = tb4.warehouse_code
WHERE (tb5.count - IFNULL(tb4.count, 0)) > 0
union
select bailun_sku, warehouse_code, sum(count) AS count
from dc_base_transfer_plan
where status = 1
and deleted = 0
group by bailun_sku, warehouse_code
) t
group by bailun_sku, warehouse_code
<insert id="calculateTransferTransit"> ON DUPLICATE KEY UPDATE quantity_transfer = VALUES(quantity_transfer),
insert into dc_mid_transit(bailun_sku, warehouse_code, quantity_transfer,gmt_transfer_modified) gmt_transfer_modified = VALUES(gmt_transfer_modified)
SELECT
tb5.bailun_sku bailun_sku,
tb5.warehouse_code warehouse_code,
( tb5.count - IFNULL( tb4.count, 0 ) ) AS count,
CURRENT_TIMESTAMP
FROM
(
SELECT
tb1.bailun_sku,
tb1.warehouse_code,
sum( tb1.count ) count
FROM
dc_base_transfer_bale tb1
LEFT JOIN dc_base_transfer_complete tb2 ON tb1.deleted = tb2.deleted
AND tb1.bailun_sku = tb2.bailun_sku
AND tb1.warehouse_code = tb2.warehouse_code
AND tb1.transfer_order_id = tb2.transfer_order_id
WHERE
tb2.bailun_sku IS NULL
AND tb1.deleted = 0
GROUP BY
bailun_sku,
warehouse_code
) tb5
LEFT JOIN (
SELECT
bailun_sku,
warehouse_code,
sum( count ) count
FROM
(
SELECT
tb1.bailun_sku,
tb1.warehouse_code,
max( tb1.count ) count,
tb1.transfer_order_id
FROM
dc_base_transfer_inbound tb1
LEFT JOIN dc_base_transfer_complete tb2 ON tb2.deleted = 0
AND tb1.bailun_sku = tb2.bailun_sku
AND tb1.warehouse_code = tb2.warehouse_code
AND tb1.transfer_order_id = tb2.transfer_order_id
WHERE
tb2.bailun_sku IS NULL
AND tb1.deleted = 0
GROUP BY
bailun_sku,
warehouse_code,
transfer_order_id
) tb3
GROUP BY
bailun_sku,
warehouse_code
) tb4
ON tb5.bailun_sku = tb4.bailun_sku
AND tb5.warehouse_code = tb4.warehouse_code
WHERE ( tb5.count - IFNULL( tb4.count, 0 ) ) > 0
ON DUPLICATE KEY UPDATE quantity_transfer = VALUES(quantity_transfer),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,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 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 (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
...@@ -558,7 +561,7 @@ ...@@ -558,7 +561,7 @@
ON DUPLICATE KEY UPDATE quantity_purchase = VALUES(quantity_purchase), gmt_purchase_modified = VALUES(gmt_purchase_modified) ON DUPLICATE KEY UPDATE quantity_purchase = VALUES(quantity_purchase), 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`,
...@@ -572,7 +575,7 @@ ...@@ -572,7 +575,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,
...@@ -601,32 +604,32 @@ ...@@ -601,32 +604,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,
......
...@@ -706,5 +706,7 @@ FROM ...@@ -706,5 +706,7 @@ FROM
AND tb5.transfer_order_id = tb4.transfer_order_id AND tb5.transfer_order_id = tb4.transfer_order_id
WHERE WHERE
( tb11.count - IFNULL( tb4.count, 0 ) ) > 0 ( tb11.count - IFNULL( tb4.count, 0 ) ) > 0
union select bailun_sku,warehouse_code,transfer_plan_order_id,null,update_time,count from dc_base_transfer_plan where status = 1 and deleted=0 AND bailun_sku = #{bailunSku}
AND warehouse_code = #{warehouseCode}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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