Commit 67a5fb69 by wutong

计算物流头程费从物流单维度改为物流-调拨单维度

parent 9b39ab6b
......@@ -70,6 +70,15 @@ public class DcMidCostFirstOrder {
private Integer quantity;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_mid_cost_first_order.transfer_order_id
*
* @mbg.generated
*/
private String transferOrderId;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_mid_cost_first_order
*
......@@ -88,6 +97,7 @@ public class DcMidCostFirstOrder {
sb.append(", channelOrderId=").append(channelOrderId);
sb.append(", weightRatio=").append(weightRatio);
sb.append(", quantity=").append(quantity);
sb.append(", transferOrderId=").append(transferOrderId);
sb.append("]");
return sb.toString();
}
......@@ -116,7 +126,8 @@ public class DcMidCostFirstOrder {
&& (this.getWarehouseCode() == null ? other.getWarehouseCode() == null : this.getWarehouseCode().equals(other.getWarehouseCode()))
&& (this.getChannelOrderId() == null ? other.getChannelOrderId() == null : this.getChannelOrderId().equals(other.getChannelOrderId()))
&& (this.getWeightRatio() == null ? other.getWeightRatio() == null : this.getWeightRatio().equals(other.getWeightRatio()))
&& (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()));
&& (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()))
&& (this.getTransferOrderId() == null ? other.getTransferOrderId() == null : this.getTransferOrderId().equals(other.getTransferOrderId()));
}
/**
......@@ -136,6 +147,7 @@ public class DcMidCostFirstOrder {
result = prime * result + ((getChannelOrderId() == null) ? 0 : getChannelOrderId().hashCode());
result = prime * result + ((getWeightRatio() == null) ? 0 : getWeightRatio().hashCode());
result = prime * result + ((getQuantity() == null) ? 0 : getQuantity().hashCode());
result = prime * result + ((getTransferOrderId() == null) ? 0 : getTransferOrderId().hashCode());
return result;
}
}
\ No newline at end of file
......@@ -819,6 +819,76 @@ public class DcMidCostFirstOrderExample {
addCriterion("quantity not between", value1, value2, "quantity");
return (Criteria) this;
}
public Criteria andTransferOrderIdIsNull() {
addCriterion("transfer_order_id is null");
return (Criteria) this;
}
public Criteria andTransferOrderIdIsNotNull() {
addCriterion("transfer_order_id is not null");
return (Criteria) this;
}
public Criteria andTransferOrderIdEqualTo(String value) {
addCriterion("transfer_order_id =", value, "transferOrderId");
return (Criteria) this;
}
public Criteria andTransferOrderIdNotEqualTo(String value) {
addCriterion("transfer_order_id <>", value, "transferOrderId");
return (Criteria) this;
}
public Criteria andTransferOrderIdGreaterThan(String value) {
addCriterion("transfer_order_id >", value, "transferOrderId");
return (Criteria) this;
}
public Criteria andTransferOrderIdGreaterThanOrEqualTo(String value) {
addCriterion("transfer_order_id >=", value, "transferOrderId");
return (Criteria) this;
}
public Criteria andTransferOrderIdLessThan(String value) {
addCriterion("transfer_order_id <", value, "transferOrderId");
return (Criteria) this;
}
public Criteria andTransferOrderIdLessThanOrEqualTo(String value) {
addCriterion("transfer_order_id <=", value, "transferOrderId");
return (Criteria) this;
}
public Criteria andTransferOrderIdLike(String value) {
addCriterion("transfer_order_id like", value, "transferOrderId");
return (Criteria) this;
}
public Criteria andTransferOrderIdNotLike(String value) {
addCriterion("transfer_order_id not like", value, "transferOrderId");
return (Criteria) this;
}
public Criteria andTransferOrderIdIn(List<String> values) {
addCriterion("transfer_order_id in", values, "transferOrderId");
return (Criteria) this;
}
public Criteria andTransferOrderIdNotIn(List<String> values) {
addCriterion("transfer_order_id not in", values, "transferOrderId");
return (Criteria) this;
}
public Criteria andTransferOrderIdBetween(String value1, String value2) {
addCriterion("transfer_order_id between", value1, value2, "transferOrderId");
return (Criteria) this;
}
public Criteria andTransferOrderIdNotBetween(String value1, String value2) {
addCriterion("transfer_order_id not between", value1, value2, "transferOrderId");
return (Criteria) this;
}
}
/**
......
package com.bailuntec.domain.pojo;
import lombok.Data;
@Data
public class CostFirstOrder {
private String channelOrderId;
private String transferOrderId;
}
......@@ -6,6 +6,7 @@ import com.bailuntec.domain.example.DcBaseCostFirstExample;
import com.bailuntec.domain.example.DcBaseSkuExample;
import com.bailuntec.domain.example.DcMidCostFirstExample;
import com.bailuntec.domain.example.DcMidCostFirstOrderExample;
import com.bailuntec.domain.pojo.CostFirstOrder;
import com.bailuntec.mapper.*;
import com.bailuntec.support.PointJob;
import com.bailuntec.utils.SessionUtil;
......@@ -35,12 +36,12 @@ public class CalculateCostFirstJob extends PointJob {
do {
try {
DcBaseCostFirstMapper dcBaseCostFirstMapper = SessionUtil.getSession().getMapper(DcBaseCostFirstMapper.class);
//拿到物流单号, 将物流单中每个SKU的费用算出来
List<String> channelOrderIdList = dcBaseCostFirstMapper.listChannelOrderId(jobPointLog.getPageIndex() * jobPointLog.getPageSize(), jobPointLog.getPageSize());
//拿到物流单号,调拨单号, 将物流单-调拨单中每个SKU的费用算出来
List<CostFirstOrder> channelOrderIdList = dcBaseCostFirstMapper.listChannelOrderId(jobPointLog.getPageIndex() * jobPointLog.getPageSize(), jobPointLog.getPageSize());
if (channelOrderIdList != null && channelOrderIdList.size() > 0) {
for (String channelOrderId : channelOrderIdList) {
for (CostFirstOrder costFirstOrder : channelOrderIdList) {
DcBaseCostFirstMapper dcBaseCostFirstMapperFor = SessionUtil.getSession().getMapper(DcBaseCostFirstMapper.class);
List<DcBaseCostFirst> dcBaseCostFirsts = dcBaseCostFirstMapperFor.selectByExample(DcBaseCostFirstExample.newAndCreateCriteria().andChannelOrderIdEqualTo(channelOrderId).example());
List<DcBaseCostFirst> dcBaseCostFirsts = dcBaseCostFirstMapperFor.selectByExample(DcBaseCostFirstExample.newAndCreateCriteria().andChannelOrderIdEqualTo(costFirstOrder.getChannelOrderId()).andTransferOrderIdEqualTo(costFirstOrder.getTransferOrderId()).example());
handleChannelOrderSku(dcBaseCostFirsts);
}
}
......@@ -100,6 +101,7 @@ public class CalculateCostFirstJob extends PointJob {
dcMidCostFirstOrder.setBailunSku(dcBaseCostFirst.getBailunSku());
dcMidCostFirstOrder.setWarehouseCode(dcBaseCostFirst.getWarehouseCode());
dcMidCostFirstOrder.setChannelOrderId(dcBaseCostFirst.getChannelOrderId());
dcMidCostFirstOrder.setTransferOrderId(dcBaseCostFirst.getTransferOrderId());
dcMidCostFirstOrder.setQuantity(dcBaseCostFirst.getQuantity());
dcMidCostFirstOrder.setWeightRatio(skuWeightRatio);
//将费用算到单个SKU上
......
......@@ -2,6 +2,7 @@ package com.bailuntec.mapper;
import com.bailuntec.domain.entity.DcBaseCostFirst;
import com.bailuntec.domain.example.DcBaseCostFirstExample;
import com.bailuntec.domain.pojo.CostFirstOrder;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -122,7 +123,8 @@ public interface DcBaseCostFirstMapper {
*/
int upsertSelective(DcBaseCostFirst record);
List<CostFirstOrder> listChannelOrderId(@Param("v1") Integer v1, @Param("v2") Integer v2);
int countChannelOrder();
List<String> listChannelOrderId(@Param("v1") Integer v1, @Param("v2") Integer v2);
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bailuntec.mapper.DcBaseCostFirstMapper">
<resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="channel_order_id" jdbcType="VARCHAR" property="channelOrderId"/>
<result column="channel_id" jdbcType="INTEGER" property="channelId"/>
<result column="box_id" jdbcType="VARCHAR" property="boxId"/>
<result column="cost_first" jdbcType="DECIMAL" property="costFirst"/>
<result column="cost_goods_clearance" jdbcType="DECIMAL" property="costGoodsClearance"/>
<result column="cost_duty" jdbcType="DECIMAL" property="costDuty"/>
<result column="cost_customs_clearance" jdbcType="DECIMAL" property="costCustomsClearance"/>
<result column="cost_weight" jdbcType="DECIMAL" property="costWeight"/>
<result column="cost_fuel" jdbcType="DECIMAL" property="costFuel"/>
<result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode"/>
<result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku"/>
<result column="quantity" jdbcType="INTEGER" property="quantity"/>
<result column="sku_weight" jdbcType="DECIMAL" property="skuWeight"/>
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
<resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="channel_order_id" jdbcType="VARCHAR" property="channelOrderId" />
<result column="channel_id" jdbcType="INTEGER" property="channelId" />
<result column="box_id" jdbcType="VARCHAR" property="boxId" />
<result column="cost_first" jdbcType="DECIMAL" property="costFirst" />
<result column="cost_goods_clearance" jdbcType="DECIMAL" property="costGoodsClearance" />
<result column="cost_duty" jdbcType="DECIMAL" property="costDuty" />
<result column="cost_customs_clearance" jdbcType="DECIMAL" property="costCustomsClearance" />
<result column="cost_weight" jdbcType="DECIMAL" property="costWeight" />
<result column="cost_fuel" jdbcType="DECIMAL" property="costFuel" />
<result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode" />
<result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku" />
<result column="quantity" jdbcType="INTEGER" property="quantity" />
<result column="sku_weight" jdbcType="DECIMAL" property="skuWeight" />
<result column="transfer_order_id" jdbcType="VARCHAR" property="transferOrderId" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</where>
</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, channel_order_id, channel_id, box_id, cost_first, cost_goods_clearance, cost_duty,
cost_customs_clearance, cost_weight, cost_fuel, warehouse_code, bailun_sku, quantity,
sku_weight
</sql>
<select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseCostFirstExample"
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_base_cost_first
<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>
</trim>
</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_base_cost_first
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_base_cost_first
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcBaseCostFirstExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from dc_base_cost_first
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into dc_base_cost_first (id, channel_order_id, channel_id,
box_id, cost_first, cost_goods_clearance,
cost_duty, cost_customs_clearance, cost_weight,
cost_fuel, warehouse_code, bailun_sku,
quantity, sku_weight)
values (#{id,jdbcType=INTEGER}, #{channelOrderId,jdbcType=VARCHAR}, #{channelId,jdbcType=INTEGER},
#{boxId,jdbcType=VARCHAR}, #{costFirst,jdbcType=DECIMAL}, #{costGoodsClearance,jdbcType=DECIMAL},
#{costDuty,jdbcType=DECIMAL}, #{costCustomsClearance,jdbcType=DECIMAL}, #{costWeight,jdbcType=DECIMAL},
#{costFuel,jdbcType=DECIMAL}, #{warehouseCode,jdbcType=VARCHAR}, #{bailunSku,jdbcType=VARCHAR},
#{quantity,jdbcType=INTEGER}, #{skuWeight,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into dc_base_cost_first
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="channelOrderId != null">
channel_order_id,
</if>
<if test="channelId != null">
channel_id,
</if>
<if test="boxId != null">
box_id,
</if>
<if test="costFirst != null">
cost_first,
</if>
<if test="costGoodsClearance != null">
cost_goods_clearance,
</if>
<if test="costDuty != null">
cost_duty,
</if>
<if test="costCustomsClearance != null">
cost_customs_clearance,
</if>
<if test="costWeight != null">
cost_weight,
</if>
<if test="costFuel != null">
cost_fuel,
</if>
<if test="warehouseCode != null">
warehouse_code,
</if>
<if test="bailunSku != null">
bailun_sku,
</if>
<if test="quantity != null">
quantity,
</if>
<if test="skuWeight != null">
sku_weight,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="channelOrderId != null">
#{channelOrderId,jdbcType=VARCHAR},
</if>
<if test="channelId != null">
#{channelId,jdbcType=INTEGER},
</if>
<if test="boxId != null">
#{boxId,jdbcType=VARCHAR},
</if>
<if test="costFirst != null">
#{costFirst,jdbcType=DECIMAL},
</if>
<if test="costGoodsClearance != null">
#{costGoodsClearance,jdbcType=DECIMAL},
</if>
<if test="costDuty != null">
#{costDuty,jdbcType=DECIMAL},
</if>
<if test="costCustomsClearance != null">
#{costCustomsClearance,jdbcType=DECIMAL},
</if>
<if test="costWeight != null">
#{costWeight,jdbcType=DECIMAL},
</if>
<if test="costFuel != null">
#{costFuel,jdbcType=DECIMAL},
</if>
<if test="warehouseCode != null">
#{warehouseCode,jdbcType=VARCHAR},
</if>
<if test="bailunSku != null">
#{bailunSku,jdbcType=VARCHAR},
</if>
<if test="quantity != null">
#{quantity,jdbcType=INTEGER},
</if>
<if test="skuWeight != null">
#{skuWeight,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bailuntec.domain.example.DcBaseCostFirstExample"
resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from dc_base_cost_first
<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_base_cost_first
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.channelOrderId != null">
channel_order_id = #{record.channelOrderId,jdbcType=VARCHAR},
</if>
<if test="record.channelId != null">
channel_id = #{record.channelId,jdbcType=INTEGER},
</if>
<if test="record.boxId != null">
box_id = #{record.boxId,jdbcType=VARCHAR},
</if>
<if test="record.costFirst != null">
cost_first = #{record.costFirst,jdbcType=DECIMAL},
</if>
<if test="record.costGoodsClearance != null">
cost_goods_clearance = #{record.costGoodsClearance,jdbcType=DECIMAL},
</if>
<if test="record.costDuty != null">
cost_duty = #{record.costDuty,jdbcType=DECIMAL},
</if>
<if test="record.costCustomsClearance != null">
cost_customs_clearance = #{record.costCustomsClearance,jdbcType=DECIMAL},
</if>
<if test="record.costWeight != null">
cost_weight = #{record.costWeight,jdbcType=DECIMAL},
</if>
<if test="record.costFuel != null">
cost_fuel = #{record.costFuel,jdbcType=DECIMAL},
</if>
<if test="record.warehouseCode != null">
warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
</if>
<if test="record.bailunSku != null">
bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
</if>
<if test="record.quantity != null">
quantity = #{record.quantity,jdbcType=INTEGER},
</if>
<if test="record.skuWeight != null">
sku_weight = #{record.skuWeight,jdbcType=DECIMAL},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</foreach>
</where>
</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>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dc_base_cost_first
set id = #{record.id,jdbcType=INTEGER},
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, channel_order_id, channel_id, box_id, cost_first, cost_goods_clearance, cost_duty,
cost_customs_clearance, cost_weight, cost_fuel, warehouse_code, bailun_sku, quantity,
sku_weight, transfer_order_id
</sql>
<select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseCostFirstExample" 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_base_cost_first
<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_base_cost_first
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_base_cost_first
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcBaseCostFirstExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from dc_base_cost_first
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into dc_base_cost_first (id, channel_order_id, channel_id,
box_id, cost_first, cost_goods_clearance,
cost_duty, cost_customs_clearance, cost_weight,
cost_fuel, warehouse_code, bailun_sku,
quantity, sku_weight, transfer_order_id
)
values (#{id,jdbcType=INTEGER}, #{channelOrderId,jdbcType=VARCHAR}, #{channelId,jdbcType=INTEGER},
#{boxId,jdbcType=VARCHAR}, #{costFirst,jdbcType=DECIMAL}, #{costGoodsClearance,jdbcType=DECIMAL},
#{costDuty,jdbcType=DECIMAL}, #{costCustomsClearance,jdbcType=DECIMAL}, #{costWeight,jdbcType=DECIMAL},
#{costFuel,jdbcType=DECIMAL}, #{warehouseCode,jdbcType=VARCHAR}, #{bailunSku,jdbcType=VARCHAR},
#{quantity,jdbcType=INTEGER}, #{skuWeight,jdbcType=DECIMAL}, #{transferOrderId,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into dc_base_cost_first
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="channelOrderId != null">
channel_order_id,
</if>
<if test="channelId != null">
channel_id,
</if>
<if test="boxId != null">
box_id,
</if>
<if test="costFirst != null">
cost_first,
</if>
<if test="costGoodsClearance != null">
cost_goods_clearance,
</if>
<if test="costDuty != null">
cost_duty,
</if>
<if test="costCustomsClearance != null">
cost_customs_clearance,
</if>
<if test="costWeight != null">
cost_weight,
</if>
<if test="costFuel != null">
cost_fuel,
</if>
<if test="warehouseCode != null">
warehouse_code,
</if>
<if test="bailunSku != null">
bailun_sku,
</if>
<if test="quantity != null">
quantity,
</if>
<if test="skuWeight != null">
sku_weight,
</if>
<if test="transferOrderId != null">
transfer_order_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="channelOrderId != null">
#{channelOrderId,jdbcType=VARCHAR},
</if>
<if test="channelId != null">
#{channelId,jdbcType=INTEGER},
</if>
<if test="boxId != null">
#{boxId,jdbcType=VARCHAR},
</if>
<if test="costFirst != null">
#{costFirst,jdbcType=DECIMAL},
</if>
<if test="costGoodsClearance != null">
#{costGoodsClearance,jdbcType=DECIMAL},
</if>
<if test="costDuty != null">
#{costDuty,jdbcType=DECIMAL},
</if>
<if test="costCustomsClearance != null">
#{costCustomsClearance,jdbcType=DECIMAL},
</if>
<if test="costWeight != null">
#{costWeight,jdbcType=DECIMAL},
</if>
<if test="costFuel != null">
#{costFuel,jdbcType=DECIMAL},
</if>
<if test="warehouseCode != null">
#{warehouseCode,jdbcType=VARCHAR},
</if>
<if test="bailunSku != null">
#{bailunSku,jdbcType=VARCHAR},
</if>
<if test="quantity != null">
#{quantity,jdbcType=INTEGER},
</if>
<if test="skuWeight != null">
#{skuWeight,jdbcType=DECIMAL},
</if>
<if test="transferOrderId != null">
#{transferOrderId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bailuntec.domain.example.DcBaseCostFirstExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from dc_base_cost_first
<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_base_cost_first
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.channelOrderId != null">
channel_order_id = #{record.channelOrderId,jdbcType=VARCHAR},
</if>
<if test="record.channelId != null">
channel_id = #{record.channelId,jdbcType=INTEGER},
</if>
<if test="record.boxId != null">
box_id = #{record.boxId,jdbcType=VARCHAR},
</if>
<if test="record.costFirst != null">
cost_first = #{record.costFirst,jdbcType=DECIMAL},
</if>
<if test="record.costGoodsClearance != null">
cost_goods_clearance = #{record.costGoodsClearance,jdbcType=DECIMAL},
</if>
<if test="record.costDuty != null">
cost_duty = #{record.costDuty,jdbcType=DECIMAL},
</if>
<if test="record.costCustomsClearance != null">
cost_customs_clearance = #{record.costCustomsClearance,jdbcType=DECIMAL},
</if>
<if test="record.costWeight != null">
cost_weight = #{record.costWeight,jdbcType=DECIMAL},
</if>
<if test="record.costFuel != null">
cost_fuel = #{record.costFuel,jdbcType=DECIMAL},
</if>
<if test="record.warehouseCode != null">
warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
</if>
<if test="record.bailunSku != null">
bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
</if>
<if test="record.quantity != null">
quantity = #{record.quantity,jdbcType=INTEGER},
sku_weight = #{record.skuWeight,jdbcType=DECIMAL}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dc_base_cost_first
<set>
<if test="channelOrderId != null">
channel_order_id = #{channelOrderId,jdbcType=VARCHAR},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=INTEGER},
</if>
<if test="boxId != null">
box_id = #{boxId,jdbcType=VARCHAR},
</if>
<if test="costFirst != null">
cost_first = #{costFirst,jdbcType=DECIMAL},
</if>
<if test="costGoodsClearance != null">
cost_goods_clearance = #{costGoodsClearance,jdbcType=DECIMAL},
</if>
<if test="costDuty != null">
cost_duty = #{costDuty,jdbcType=DECIMAL},
</if>
<if test="costCustomsClearance != null">
cost_customs_clearance = #{costCustomsClearance,jdbcType=DECIMAL},
</if>
<if test="costWeight != null">
cost_weight = #{costWeight,jdbcType=DECIMAL},
</if>
<if test="costFuel != null">
cost_fuel = #{costFuel,jdbcType=DECIMAL},
</if>
<if test="warehouseCode != null">
warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
</if>
<if test="bailunSku != null">
bailun_sku = #{bailunSku,jdbcType=VARCHAR},
</if>
<if test="quantity != null">
quantity = #{quantity,jdbcType=INTEGER},
</if>
<if test="skuWeight != null">
sku_weight = #{skuWeight,jdbcType=DECIMAL},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dc_base_cost_first
set channel_order_id = #{channelOrderId,jdbcType=VARCHAR},
</if>
<if test="record.skuWeight != null">
sku_weight = #{record.skuWeight,jdbcType=DECIMAL},
</if>
<if test="record.transferOrderId != null">
transfer_order_id = #{record.transferOrderId,jdbcType=VARCHAR},
</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_base_cost_first
set id = #{record.id,jdbcType=INTEGER},
channel_order_id = #{record.channelOrderId,jdbcType=VARCHAR},
channel_id = #{record.channelId,jdbcType=INTEGER},
box_id = #{record.boxId,jdbcType=VARCHAR},
cost_first = #{record.costFirst,jdbcType=DECIMAL},
cost_goods_clearance = #{record.costGoodsClearance,jdbcType=DECIMAL},
cost_duty = #{record.costDuty,jdbcType=DECIMAL},
cost_customs_clearance = #{record.costCustomsClearance,jdbcType=DECIMAL},
cost_weight = #{record.costWeight,jdbcType=DECIMAL},
cost_fuel = #{record.costFuel,jdbcType=DECIMAL},
warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
quantity = #{record.quantity,jdbcType=INTEGER},
sku_weight = #{record.skuWeight,jdbcType=DECIMAL},
transfer_order_id = #{record.transferOrderId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dc_base_cost_first
<set>
<if test="channelOrderId != null">
channel_order_id = #{channelOrderId,jdbcType=VARCHAR},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=INTEGER},
</if>
<if test="boxId != null">
box_id = #{boxId,jdbcType=VARCHAR},
</if>
<if test="costFirst != null">
cost_first = #{costFirst,jdbcType=DECIMAL},
</if>
<if test="costGoodsClearance != null">
cost_goods_clearance = #{costGoodsClearance,jdbcType=DECIMAL},
</if>
<if test="costDuty != null">
cost_duty = #{costDuty,jdbcType=DECIMAL},
</if>
<if test="costCustomsClearance != null">
cost_customs_clearance = #{costCustomsClearance,jdbcType=DECIMAL},
</if>
<if test="costWeight != null">
cost_weight = #{costWeight,jdbcType=DECIMAL},
</if>
<if test="costFuel != null">
cost_fuel = #{costFuel,jdbcType=DECIMAL},
</if>
<if test="warehouseCode != null">
warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
</if>
<if test="bailunSku != null">
bailun_sku = #{bailunSku,jdbcType=VARCHAR},
</if>
<if test="quantity != null">
quantity = #{quantity,jdbcType=INTEGER},
sku_weight = #{skuWeight,jdbcType=DECIMAL}
where id = #{id,jdbcType=INTEGER}
</update>
<insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
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_base_cost_first
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="channelOrderId != null">
channel_order_id,
</if>
<if test="channelId != null">
channel_id,
</if>
<if test="boxId != null">
box_id,
</if>
<if test="costFirst != null">
cost_first,
</if>
<if test="costGoodsClearance != null">
cost_goods_clearance,
</if>
<if test="costDuty != null">
cost_duty,
</if>
<if test="costCustomsClearance != null">
cost_customs_clearance,
</if>
<if test="costWeight != null">
cost_weight,
</if>
<if test="costFuel != null">
cost_fuel,
</if>
<if test="warehouseCode != null">
warehouse_code,
</if>
<if test="bailunSku != null">
bailun_sku,
</if>
<if test="quantity != null">
quantity,
</if>
<if test="skuWeight != null">
sku_weight,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="channelOrderId != null">
#{channelOrderId,jdbcType=VARCHAR},
</if>
<if test="channelId != null">
#{channelId,jdbcType=INTEGER},
</if>
<if test="boxId != null">
#{boxId,jdbcType=VARCHAR},
</if>
<if test="costFirst != null">
#{costFirst,jdbcType=DECIMAL},
</if>
<if test="costGoodsClearance != null">
#{costGoodsClearance,jdbcType=DECIMAL},
</if>
<if test="costDuty != null">
#{costDuty,jdbcType=DECIMAL},
</if>
<if test="costCustomsClearance != null">
#{costCustomsClearance,jdbcType=DECIMAL},
</if>
<if test="costWeight != null">
#{costWeight,jdbcType=DECIMAL},
</if>
<if test="costFuel != null">
#{costFuel,jdbcType=DECIMAL},
</if>
<if test="warehouseCode != null">
#{warehouseCode,jdbcType=VARCHAR},
</if>
<if test="bailunSku != null">
#{bailunSku,jdbcType=VARCHAR},
</if>
<if test="quantity != null">
#{quantity,jdbcType=INTEGER},
</if>
<if test="skuWeight != null">
#{skuWeight,jdbcType=DECIMAL},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="channelOrderId != null">
channel_order_id = #{channelOrderId,jdbcType=VARCHAR},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=INTEGER},
</if>
<if test="boxId != null">
box_id = #{boxId,jdbcType=VARCHAR},
</if>
<if test="costFirst != null">
cost_first = #{costFirst,jdbcType=DECIMAL},
</if>
<if test="costGoodsClearance != null">
cost_goods_clearance = #{costGoodsClearance,jdbcType=DECIMAL},
</if>
<if test="costDuty != null">
cost_duty = #{costDuty,jdbcType=DECIMAL},
</if>
<if test="costCustomsClearance != null">
cost_customs_clearance = #{costCustomsClearance,jdbcType=DECIMAL},
</if>
<if test="costWeight != null">
cost_weight = #{costWeight,jdbcType=DECIMAL},
</if>
<if test="costFuel != null">
cost_fuel = #{costFuel,jdbcType=DECIMAL},
</if>
<if test="warehouseCode != null">
warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
</if>
<if test="bailunSku != null">
bailun_sku = #{bailunSku,jdbcType=VARCHAR},
</if>
<if test="quantity != null">
quantity = #{quantity,jdbcType=INTEGER},
</if>
<if test="skuWeight != null">
sku_weight = #{skuWeight,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
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_base_cost_first
(id, channel_order_id, channel_id, box_id, cost_first, cost_goods_clearance, cost_duty,
cost_customs_clearance, cost_weight, cost_fuel, warehouse_code, bailun_sku, quantity,
sku_weight)
values
(#{id,jdbcType=INTEGER}, #{channelOrderId,jdbcType=VARCHAR}, #{channelId,jdbcType=INTEGER},
#{boxId,jdbcType=VARCHAR}, #{costFirst,jdbcType=DECIMAL}, #{costGoodsClearance,jdbcType=DECIMAL},
#{costDuty,jdbcType=DECIMAL}, #{costCustomsClearance,jdbcType=DECIMAL}, #{costWeight,jdbcType=DECIMAL},
#{costFuel,jdbcType=DECIMAL}, #{warehouseCode,jdbcType=VARCHAR}, #{bailunSku,jdbcType=VARCHAR},
#{quantity,jdbcType=INTEGER}, #{skuWeight,jdbcType=DECIMAL})
on duplicate key update
</if>
<if test="skuWeight != null">
sku_weight = #{skuWeight,jdbcType=DECIMAL},
</if>
<if test="transferOrderId != null">
transfer_order_id = #{transferOrderId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dc_base_cost_first
set channel_order_id = #{channelOrderId,jdbcType=VARCHAR},
channel_id = #{channelId,jdbcType=INTEGER},
box_id = #{boxId,jdbcType=VARCHAR},
cost_first = #{costFirst,jdbcType=DECIMAL},
cost_goods_clearance = #{costGoodsClearance,jdbcType=DECIMAL},
cost_duty = #{costDuty,jdbcType=DECIMAL},
cost_customs_clearance = #{costCustomsClearance,jdbcType=DECIMAL},
cost_weight = #{costWeight,jdbcType=DECIMAL},
cost_fuel = #{costFuel,jdbcType=DECIMAL},
warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
bailun_sku = #{bailunSku,jdbcType=VARCHAR},
quantity = #{quantity,jdbcType=INTEGER},
sku_weight = #{skuWeight,jdbcType=DECIMAL},
transfer_order_id = #{transferOrderId,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
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_base_cost_first
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="channelOrderId != null">
channel_order_id,
</if>
<if test="channelId != null">
channel_id,
</if>
<if test="boxId != null">
box_id,
</if>
<if test="costFirst != null">
cost_first,
</if>
<if test="costGoodsClearance != null">
cost_goods_clearance,
</if>
<if test="costDuty != null">
cost_duty,
</if>
<if test="costCustomsClearance != null">
cost_customs_clearance,
</if>
<if test="costWeight != null">
cost_weight,
</if>
<if test="costFuel != null">
cost_fuel,
</if>
<if test="warehouseCode != null">
warehouse_code,
</if>
<if test="bailunSku != null">
bailun_sku,
</if>
<if test="quantity != null">
quantity,
</if>
<if test="skuWeight != null">
sku_weight,
</if>
<if test="transferOrderId != null">
transfer_order_id,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="channelOrderId != null">
#{channelOrderId,jdbcType=VARCHAR},
</if>
<if test="channelId != null">
#{channelId,jdbcType=INTEGER},
</if>
<if test="boxId != null">
#{boxId,jdbcType=VARCHAR},
</if>
<if test="costFirst != null">
#{costFirst,jdbcType=DECIMAL},
</if>
<if test="costGoodsClearance != null">
#{costGoodsClearance,jdbcType=DECIMAL},
</if>
<if test="costDuty != null">
#{costDuty,jdbcType=DECIMAL},
</if>
<if test="costCustomsClearance != null">
#{costCustomsClearance,jdbcType=DECIMAL},
</if>
<if test="costWeight != null">
#{costWeight,jdbcType=DECIMAL},
</if>
<if test="costFuel != null">
#{costFuel,jdbcType=DECIMAL},
</if>
<if test="warehouseCode != null">
#{warehouseCode,jdbcType=VARCHAR},
</if>
<if test="bailunSku != null">
#{bailunSku,jdbcType=VARCHAR},
</if>
<if test="quantity != null">
#{quantity,jdbcType=INTEGER},
</if>
<if test="skuWeight != null">
#{skuWeight,jdbcType=DECIMAL},
</if>
<if test="transferOrderId != null">
#{transferOrderId,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="channelOrderId != null">
channel_order_id = #{channelOrderId,jdbcType=VARCHAR},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=INTEGER},
</if>
<if test="boxId != null">
box_id = #{boxId,jdbcType=VARCHAR},
</if>
<if test="costFirst != null">
cost_first = #{costFirst,jdbcType=DECIMAL},
</if>
<if test="costGoodsClearance != null">
cost_goods_clearance = #{costGoodsClearance,jdbcType=DECIMAL},
</if>
<if test="costDuty != null">
cost_duty = #{costDuty,jdbcType=DECIMAL},
</if>
<if test="costCustomsClearance != null">
cost_customs_clearance = #{costCustomsClearance,jdbcType=DECIMAL},
</if>
<if test="costWeight != null">
cost_weight = #{costWeight,jdbcType=DECIMAL},
</if>
<if test="costFuel != null">
cost_fuel = #{costFuel,jdbcType=DECIMAL},
</if>
<if test="warehouseCode != null">
warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
</if>
<if test="bailunSku != null">
bailun_sku = #{bailunSku,jdbcType=VARCHAR},
</if>
<if test="quantity != null">
quantity = #{quantity,jdbcType=INTEGER},
sku_weight = #{skuWeight,jdbcType=DECIMAL}
</insert>
<select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseCostFirstExample"
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_base_cost_first
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="listChannelOrderId" resultType="string">
SELECT channel_order_id FROM `dc_base_cost_first` WHERE cost_first>0 GROUP BY channel_order_id ORDER BY channel_order_id asc limit #{v1}, #{v2};
</if>
<if test="skuWeight != null">
sku_weight = #{skuWeight,jdbcType=DECIMAL},
</if>
<if test="transferOrderId != null">
transfer_order_id = #{transferOrderId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBaseCostFirst">
<!--
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_base_cost_first
(id, channel_order_id, channel_id, box_id, cost_first, cost_goods_clearance, cost_duty,
cost_customs_clearance, cost_weight, cost_fuel, warehouse_code, bailun_sku, quantity,
sku_weight, transfer_order_id)
values
(#{id,jdbcType=INTEGER}, #{channelOrderId,jdbcType=VARCHAR}, #{channelId,jdbcType=INTEGER},
#{boxId,jdbcType=VARCHAR}, #{costFirst,jdbcType=DECIMAL}, #{costGoodsClearance,jdbcType=DECIMAL},
#{costDuty,jdbcType=DECIMAL}, #{costCustomsClearance,jdbcType=DECIMAL}, #{costWeight,jdbcType=DECIMAL},
#{costFuel,jdbcType=DECIMAL}, #{warehouseCode,jdbcType=VARCHAR}, #{bailunSku,jdbcType=VARCHAR},
#{quantity,jdbcType=INTEGER}, #{skuWeight,jdbcType=DECIMAL}, #{transferOrderId,jdbcType=VARCHAR}
)
on duplicate key update
id = #{id,jdbcType=INTEGER},
channel_order_id = #{channelOrderId,jdbcType=VARCHAR},
channel_id = #{channelId,jdbcType=INTEGER},
box_id = #{boxId,jdbcType=VARCHAR},
cost_first = #{costFirst,jdbcType=DECIMAL},
cost_goods_clearance = #{costGoodsClearance,jdbcType=DECIMAL},
cost_duty = #{costDuty,jdbcType=DECIMAL},
cost_customs_clearance = #{costCustomsClearance,jdbcType=DECIMAL},
cost_weight = #{costWeight,jdbcType=DECIMAL},
cost_fuel = #{costFuel,jdbcType=DECIMAL},
warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
bailun_sku = #{bailunSku,jdbcType=VARCHAR},
quantity = #{quantity,jdbcType=INTEGER},
sku_weight = #{skuWeight,jdbcType=DECIMAL},
transfer_order_id = #{transferOrderId,jdbcType=VARCHAR}
</insert>
<select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseCostFirstExample" 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_base_cost_first
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="listChannelOrderId" resultType="com.bailuntec.domain.pojo.CostFirstOrder">
SELECT channel_order_id,transfer_order_id FROM `dc_base_cost_first` WHERE cost_first>0 GROUP BY channel_order_id,transfer_order_id ORDER BY transfer_order_id asc limit #{v1}, #{v2};
</select>
<select id="countChannelOrder" resultType="int">
SELECT COUNT(*) FROM (SELECT channel_order_id FROM `dc_base_cost_first` WHERE cost_first>0 GROUP BY channel_order_id) tb;
<select id="countChannelOrder" resultType="int">
SELECT COUNT(*) FROM (SELECT channel_order_id,transfer_order_id FROM `dc_base_cost_first` WHERE cost_first>0 GROUP BY channel_order_id,transfer_order_id) tb;
</select>
</mapper>
\ No newline at end of file
......@@ -5,7 +5,6 @@ import com.bailuntec.domain.example.DcMidCostFirstOrderExample;
import com.bailuntec.domain.pojo.MidCostFirst;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
public interface DcMidCostFirstOrderMapper {
......@@ -124,8 +123,7 @@ public interface DcMidCostFirstOrderMapper {
*/
int upsertSelective(DcMidCostFirstOrder record);
int countSkuWarehouse();
List<MidCostFirst> listSkuWarehouse(@Param("v1")int v1, @Param("v2")int v2);
List<MidCostFirst> listSkuWarehouse(@Param("v1") int v1, @Param("v2") int v2);
}
\ No newline at end of file
......@@ -13,6 +13,7 @@
<result column="channel_order_id" jdbcType="VARCHAR" property="channelOrderId" />
<result column="weight_ratio" jdbcType="DECIMAL" property="weightRatio" />
<result column="quantity" jdbcType="INTEGER" property="quantity" />
<result column="transfer_order_id" jdbcType="VARCHAR" property="transferOrderId" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
......@@ -85,7 +86,8 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, cost_first, bailun_sku, warehouse_code, channel_order_id, weight_ratio, quantity
id, cost_first, bailun_sku, warehouse_code, channel_order_id, weight_ratio, quantity,
transfer_order_id
</sql>
<select id="selectByExample" parameterType="com.bailuntec.domain.example.DcMidCostFirstOrderExample" resultMap="BaseResultMap">
<!--
......@@ -148,10 +150,10 @@
-->
insert into dc_mid_cost_first_order (id, cost_first, bailun_sku,
warehouse_code, channel_order_id, weight_ratio,
quantity)
quantity, transfer_order_id)
values (#{id,jdbcType=INTEGER}, #{costFirst,jdbcType=DECIMAL}, #{bailunSku,jdbcType=VARCHAR},
#{warehouseCode,jdbcType=VARCHAR}, #{channelOrderId,jdbcType=VARCHAR}, #{weightRatio,jdbcType=DECIMAL},
#{quantity,jdbcType=INTEGER})
#{quantity,jdbcType=INTEGER}, #{transferOrderId,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcMidCostFirstOrder">
<!--
......@@ -181,6 +183,9 @@
<if test="quantity != null">
quantity,
</if>
<if test="transferOrderId != null">
transfer_order_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -204,6 +209,9 @@
<if test="quantity != null">
#{quantity,jdbcType=INTEGER},
</if>
<if test="transferOrderId != null">
#{transferOrderId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bailuntec.domain.example.DcMidCostFirstOrderExample" resultType="java.lang.Long">
......@@ -244,6 +252,9 @@
<if test="record.quantity != null">
quantity = #{record.quantity,jdbcType=INTEGER},
</if>
<if test="record.transferOrderId != null">
transfer_order_id = #{record.transferOrderId,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -261,7 +272,8 @@
warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
channel_order_id = #{record.channelOrderId,jdbcType=VARCHAR},
weight_ratio = #{record.weightRatio,jdbcType=DECIMAL},
quantity = #{record.quantity,jdbcType=INTEGER}
quantity = #{record.quantity,jdbcType=INTEGER},
transfer_order_id = #{record.transferOrderId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -291,6 +303,9 @@
<if test="quantity != null">
quantity = #{quantity,jdbcType=INTEGER},
</if>
<if test="transferOrderId != null">
transfer_order_id = #{transferOrderId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -305,7 +320,8 @@
warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
channel_order_id = #{channelOrderId,jdbcType=VARCHAR},
weight_ratio = #{weightRatio,jdbcType=DECIMAL},
quantity = #{quantity,jdbcType=INTEGER}
quantity = #{quantity,jdbcType=INTEGER},
transfer_order_id = #{transferOrderId,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcMidCostFirstOrder">
......@@ -337,6 +353,9 @@
<if test="quantity != null">
quantity,
</if>
<if test="transferOrderId != null">
transfer_order_id,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -361,6 +380,9 @@
<if test="quantity != null">
#{quantity,jdbcType=INTEGER},
</if>
<if test="transferOrderId != null">
#{transferOrderId,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
......@@ -385,6 +407,9 @@
<if test="quantity != null">
quantity = #{quantity,jdbcType=INTEGER},
</if>
<if test="transferOrderId != null">
transfer_order_id = #{transferOrderId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<insert id="upsert" parameterType="com.bailuntec.domain.entity.DcMidCostFirstOrder">
......@@ -394,12 +419,12 @@
@project https://github.com/itfsw/mybatis-generator-plugin
-->
insert into dc_mid_cost_first_order
(id, cost_first, bailun_sku, warehouse_code, channel_order_id, weight_ratio, quantity
)
(id, cost_first, bailun_sku, warehouse_code, channel_order_id, weight_ratio, quantity,
transfer_order_id)
values
(#{id,jdbcType=INTEGER}, #{costFirst,jdbcType=DECIMAL}, #{bailunSku,jdbcType=VARCHAR},
#{warehouseCode,jdbcType=VARCHAR}, #{channelOrderId,jdbcType=VARCHAR}, #{weightRatio,jdbcType=DECIMAL},
#{quantity,jdbcType=INTEGER})
#{quantity,jdbcType=INTEGER}, #{transferOrderId,jdbcType=VARCHAR})
on duplicate key update
id = #{id,jdbcType=INTEGER},
cost_first = #{costFirst,jdbcType=DECIMAL},
......@@ -407,7 +432,8 @@
warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
channel_order_id = #{channelOrderId,jdbcType=VARCHAR},
weight_ratio = #{weightRatio,jdbcType=DECIMAL},
quantity = #{quantity,jdbcType=INTEGER}
quantity = #{quantity,jdbcType=INTEGER},
transfer_order_id = #{transferOrderId,jdbcType=VARCHAR}
</insert>
<select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcMidCostFirstOrderExample" resultMap="BaseResultMap">
<!--
......
......@@ -10,5 +10,5 @@ EVENT_RDB_STORAGE_PASSWORD=#7kfnymAM$Y9-Ntf
ZOOKEEPER_SERVER=172.31.255.120:2181
NAME_SPACE=data-center
JOB_NAME=mid-calculate-cost-first
JOB_CRON=0 33 7,20 * * ? *
JOB_CRON=0 33 7,12,20 * * ? *
SHARDING_TOTAL_COUNT=1
\ No newline at end of file
import com.bailuntec.domain.entity.DcBaseCostFirst;
import com.bailuntec.domain.example.DcBaseCostFirstExample;
import com.bailuntec.domain.pojo.CostFirstOrder;
import com.bailuntec.job.CalculateCostFirstJob;
import com.bailuntec.listener.CalculateCostFirstListener;
import com.bailuntec.mapper.DcBaseCostFirstMapper;
......@@ -16,11 +17,11 @@ public class CostFirstTest {
try {
DcBaseCostFirstMapper dcBaseCostFirstMapper = SessionUtil.getSession().getMapper(DcBaseCostFirstMapper.class);
//拿到物流单号, 将物流单中每个SKU的费用算出来
List<String> channelOrderIdList = dcBaseCostFirstMapper.listChannelOrderId(200, 2);
List<CostFirstOrder> channelOrderIdList = dcBaseCostFirstMapper.listChannelOrderId(200, 2);
if (channelOrderIdList != null && channelOrderIdList.size() > 0) {
for (String channelOrderId : channelOrderIdList) {
for (CostFirstOrder costFirstOrder : channelOrderIdList) {
DcBaseCostFirstMapper dcBaseCostFirstMapperFor = SessionUtil.getSession().getMapper(DcBaseCostFirstMapper.class);
List<DcBaseCostFirst> dcBaseCostFirsts = dcBaseCostFirstMapperFor.selectByExample(DcBaseCostFirstExample.newAndCreateCriteria().andChannelOrderIdEqualTo(channelOrderId).example());
List<DcBaseCostFirst> dcBaseCostFirsts = dcBaseCostFirstMapperFor.selectByExample(DcBaseCostFirstExample.newAndCreateCriteria().andChannelOrderIdEqualTo(costFirstOrder.getChannelOrderId()).andTransferOrderIdEqualTo(costFirstOrder.getTransferOrderId()).example());
costFirstJob.handleChannelOrderSku(dcBaseCostFirsts);
}
}
......@@ -30,7 +31,8 @@ public class CostFirstTest {
} finally {
SessionUtil.closeSession();
}
CalculateCostFirstListener calculateCostFirstListener = new CalculateCostFirstListener();
calculateCostFirstListener.afterJobExecuted(null);
}
@Test
public void test1() {
......
table-name=dc_base_oms_sku
table-name=dc_mid_cost_first_order
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