emis-service/emis-biz/src/main/resources/mapper/EmisTmsCostFeeMapper.xml

465 lines
31 KiB
XML

<?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.xdadan.erp.emis.mapper.EmisTmsCostFeeMapper">
<resultMap type="EmisTmsCostFee" id="EmisTmsCostFeeResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" />
<result property="costNo" column="cost_no" />
<result property="costName" column="cost_name" />
<result property="batchNo" column="batch_no" />
<result property="feeType" column="fee_type" />
<result property="splitType" column="split_type" />
<result property="transType" column="trans_type" />
<result property="transSignNo" column="trans_sign_no" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="sendPlace" column="send_place" />
<result property="destPlace" column="dest_place" />
<result property="costFee" column="cost_fee" />
<result property="usdCostFee" column="usd_cost_fee" />
<result property="billMonth" column="bill_month" />
<result property="tradeDate" column="trade_date" />
<result property="sendPieceSum" column="send_piece_sum" />
<result property="pieceNumber" column="piece_number" />
<result property="totalWeight" column="total_weight" />
<result property="totalVolume" column="total_volume" />
<result property="blConfirmCenter" column="bl_confirm_center" />
<result property="realPieceNumber" column="real_piece_number" />
<result property="realTotalWeight" column="real_total_weight" />
<result property="realTotalVolume" column="real_total_volume" />
<result property="confirmCenterDate" column="confirm_center_date" />
<result property="confirmCenterNote" column="confirm_center_note" />
<result property="confirmCenterManCode" column="confirm_center_man_code" />
<result property="confirmCenterCode" column="confirm_center_code" />
<result property="blConfirmSite" column="bl_confirm_site" />
<result property="confirmSiteDate" column="confirm_site_date" />
<result property="confirmSiteManCode" column="confirm_site_man_code" />
<result property="confirmSiteNote" column="confirm_site_note" />
<result property="confirmSiteCode" column="confirm_site_code" />
<result property="blHasCalc" column="bl_has_calc" />
<result property="calcDate" column="calc_date" />
</resultMap>
<resultMap type="EmisTmsCostFee" id="ThinCostFeeResult">
<result property="id" column="id" />
<result property="costNo" column="cost_no" />
<result property="costName" column="cost_name" />
<result property="batchNo" column="batch_no" />
<result property="feeType" column="fee_type" />
<result property="splitType" column="split_type" />
<result property="transType" column="trans_type" />
<result property="transSignNo" column="trans_sign_no" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="sendPlace" column="send_place" />
<result property="destPlace" column="dest_place" />
<result property="costFee" column="cost_fee" />
<result property="usdCostFee" column="usd_cost_fee" />
<result property="billMonth" column="bill_month" />
<result property="tradeDate" column="trade_date" />
<result property="sendPieceSum" column="send_piece_sum" />
<result property="pieceNumber" column="piece_number" />
<result property="totalWeight" column="total_weight" />
<result property="totalVolume" column="total_volume" />
</resultMap>
<resultMap type="CostFeeWaybillRel" id="CostFeeWaybillRelResult">
<result property="id" column="id" />
<result property="costNo" column="cost_no" />
<result property="billCode" column="bill_code" />
<result property="batchVolume" column="batch_volume" />
<result property="batchParcelQty" column="batch_parcel_qty" />
<result property="batchWeight" column="batch_weight" />
<association property="costFeeDetail"
column="cost_no"
select="selectThinCostFeeByCostNo"
fetchType="lazy"
/>
<association property="waybillDetail"
column="bill_code"
select="selectThinWaybillInfoByCostFeeCalc"
fetchType="lazy"
/>
</resultMap>
<select id="selectCostFeeRelListByBillCode" parameterType="String" resultMap="CostFeeWaybillRelResult">
SELECT
distinct
c.cost_no,
a.bill_code,
b.batch_no
FROM
emis_tms_site_batch_dtl a,
emis_tms_site_batch b,
emis_tms_cost_fee c
WHERE
a.del_flag = '0'
and b.del_flag='0'
and c.del_flag='0'
and a.batch_no=b.batch_no
and a.batch_no=c.batch_no
AND a.bill_code = #{billCode}
</select>
<select id="selectCostFeeRelListByCostNo" parameterType="String" resultMap="CostFeeWaybillRelResult">
SELECT
distinct
c.cost_no,
a.bill_code,
a.batch_weight,
a.batch_volume,
a.batch_parcel_qty,
b.batch_no
FROM
emis_tms_site_batch_dtl a,
emis_tms_site_batch b,
emis_tms_cost_fee c
WHERE
a.del_flag = '0'
and b.del_flag='0'
and c.del_flag='0'
and a.batch_no=b.batch_no
and a.batch_no=c.batch_no
AND c.cost_no = #{costNo}
</select>
<!-- 成本运算获取最小化运单信息 -->
<select id="selectThinWaybillInfoByCostFeeCalc" parameterType="String" resultType="EmisWaybill">
SELECT
a.id,
a.bill_code as billCode,
a.total_volume as totalVolume,
a.parcel_qty parcelQty,
a.bill_weight as billWeight,
a.volume_weight as volumeWeight,
a.settlement_weight as settlementWeight,
a.freight as freight,
a.bl_virtual as blVirtual,
a.virtual_remark as virtualRemark,
a.master_bill_code as masterBillCode,
a.send_date as sendDate,
a.take_piece_employee_code as takePieceEmployeeCode,
a.send_site_code as sendSiteCode,
a.dispatch_man_code as dispatchManCode,
a.dispatch_man_code as dispatchManCode,
a.dispatch_underling_site_code as dispatchUnderlingSiteCode,
a.dispatch_date as dispatchDate
FROM emis_waybill a
WHERE a.del_flag = '0' and bill_code=#{billCode}
</select>
<select id="selectThinWaybillListByMainBillCode" parameterType="String" resultType="EmisWaybill">
SELECT
a.id,
a.bill_code as billCode,
a.total_volume as totalVolume,
a.parcel_qty parcelQty,
a.bill_weight as billWeight,
a.volume_weight as volumeWeight,
a.settlement_weight as settlementWeight,
a.freight as freight,
a.bl_virtual as blVirtual,
a.virtual_remark as virtualRemark,
a.master_bill_code as masterBillCode,
a.send_date as sendDate,
a.take_piece_employee_code as takePieceEmployeeCode,
a.send_site_code as sendSiteCode,
a.dispatch_man_code as dispatchManCode,
a.dispatch_man_code as dispatchManCode,
a.dispatch_underling_site_code as dispatchUnderlingSiteCode,
a.dispatch_date as dispatchDate
FROM emis_waybill a
WHERE a.del_flag = '0' and master_bill_code=#{mainbillCode}
</select>
<select id="selectThinCostFeeByCostNo" parameterType="String" resultMap="ThinCostFeeResult">
select
id, cost_no, cost_name, batch_no, fee_type, split_type, trans_type, trans_sign_no, supplier_code, supplier_name, send_place, dest_place, cost_fee, usd_cost_fee, bill_month, trade_date, send_piece_sum, piece_number, total_weight, total_volume, bl_confirm_center, real_piece_number, real_total_weight, real_total_volume
from emis_tms_cost_fee a
where a.cost_no = #{costNo}
</select>
<sql id="selectEmisTmsCostFeeVo">
select id, cost_no, cost_name, batch_no, fee_type, split_type, trans_type, trans_sign_no, supplier_code, supplier_name, send_place, dest_place, cost_fee, usd_cost_fee, bill_month, trade_date, send_piece_sum, piece_number, total_weight, total_volume, bl_confirm_center, real_piece_number, real_total_weight, real_total_volume, confirm_center_date, confirm_center_note, confirm_center_man_code, confirm_center_code, bl_confirm_site, confirm_site_date, confirm_site_man_code, confirm_site_note, confirm_site_code, bl_has_calc, calc_date, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_tms_cost_fee
</sql>
<select id="selectEmisTmsCostFeeList" parameterType="EmisTmsCostFee" resultMap="EmisTmsCostFeeResult">
select id, cost_no, cost_name, batch_no, fee_type, split_type, trans_type, trans_sign_no, supplier_code, supplier_name, send_place, dest_place, cost_fee, usd_cost_fee, bill_month, trade_date, send_piece_sum, piece_number, total_weight, total_volume, bl_confirm_center, real_piece_number, real_total_weight, real_total_volume, confirm_center_date, confirm_center_note, confirm_center_man_code, confirm_center_code, bl_confirm_site, confirm_site_date, confirm_site_man_code, confirm_site_note, confirm_site_code, bl_has_calc, calc_date, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_tms_cost_fee a
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="costNo != null and costNo != ''"> and cost_no = #{costNo}</if>
<if test="costName != null and costName != ''"> and cost_name like concat('%', #{costName}, '%')</if>
<if test="batchNo != null and batchNo != ''"> and FIND_IN_SET(batch_no,#{batchNo}) </if>
<if test="feeType != null and feeType != ''"> and fee_type = #{feeType}</if>
<if test="splitType != null and splitType != ''"> and split_type = #{splitType}</if>
<if test="transType != null and transType != ''"> and trans_type=#{transType}</if>
<if test="transSignNo != null and transSignNo != ''"> and FIND_IN_SET(trans_sign_no,#{transSignNo})</if>
<if test="supplierCode != null and supplierCode != ''"> and supplier_code=#{supplierCode} </if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="sendPlace != null and sendPlace != ''"> and send_place=#{sendPlace}</if>
<if test="destPlace != null and destPlace != ''"> and dest_place=#{destPlace}</if>
<if test="costFee != null "> and cost_fee = #{costFee}</if>
<if test="billMonth != null and billMonth != ''"> and bill_month=#{billMonth}</if>
<if test="tradeDate != null "> and trade_date = #{tradeDate}</if>
<if test="sendPieceSum != null "> and send_piece_sum = #{sendPieceSum}</if>
<if test="pieceNumber != null "> and piece_number = #{pieceNumber}</if>
<if test="totalWeight != null "> and total_weight = #{totalWeight}</if>
<if test="totalVolume != null "> and total_volume = #{totalVolume}</if>
<if test="blConfirmCenter != null and blConfirmCenter != ''"> and bl_confirm_center = #{blConfirmCenter}</if>
<if test="realPieceNumber != null "> and real_piece_number = #{realPieceNumber}</if>
<if test="realTotalWeight != null "> and real_total_weight = #{realTotalWeight}</if>
<if test="realTotalVolume != null "> and real_total_volume = #{realTotalVolume}</if>
<if test="confirmCenterDate != null "> and confirm_center_date = #{confirmCenterDate}</if>
<if test="confirmCenterNote != null and confirmCenterNote != ''"> and confirm_center_note like concat('%', #{confirmCenterNote}, '%')</if>
<if test="confirmCenterManCode != null and confirmCenterManCode != ''"> and confirm_center_man_code = #{confirmCenterManCode}</if>
<if test="confirmCenterCode != null and confirmCenterCode != ''"> and confirm_center_code = #{confirmCenterCode}</if>
<if test="blConfirmSite != null and blConfirmSite != ''"> and bl_confirm_site = #{blConfirmSite}</if>
<if test="confirmSiteDate != null "> and confirm_site_date = #{confirmSiteDate}</if>
<if test="confirmSiteManCode != null and confirmSiteManCode != ''"> and confirm_site_man_code = #{confirmSiteManCode}</if>
<if test="confirmSiteNote != null and confirmSiteNote != ''"> and confirm_site_note like concat('%', #{confirmSiteNote}, '%')</if>
<if test="confirmSiteCode != null and confirmSiteCode != ''"> and confirm_site_code = #{confirmSiteCode}</if>
<if test="blHasCalc != null and blHasCalc != ''"> and bl_has_calc=#{blHasCalc}</if>
<if test="calcDate != null "> and calc_date = #{calcDate}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="createSite != null and createSite != ''"> and create_site = #{createSite}</if>
<if test="updateSite != null and updateSite != ''"> and update_site = #{updateSite}</if>
<if test="billCode != null and billCode != ''">
and exists (
select 1 from emis_tms_site_batch_dtl etsbd where etsbd.batch_no=a.batch_no and FIND_IN_SET(etsbd.bill_code,#{billCode})
)
</if>
<if test="params.beginTradeDate != null and params.beginTradeDate != ''">
and trade_date <![CDATA[ >= ]]> #{params.beginTradeDate}
</if>
<if test="params.endTradeDate != null and params.endTradeDate != ''">
and trade_date <![CDATA[ <= ]]> #{params.endTradeDate}
</if>
</where>
order by create_time desc
</select>
<select id="checkUnique" parameterType="EmisTmsCostFee" resultType="int">
select count(1) from emis_tms_cost_fee
where del_flag='0'
and batch_no = #{batchNo}
and supplier_code = #{supplierCode}
limit 1
</select>
<select id="selectWaitDoCalcCostFeeList" parameterType="EmisTmsCostFee" resultMap="EmisTmsCostFeeResult">
select id, cost_no, cost_name, batch_no, fee_type, split_type, trans_type, trans_sign_no, supplier_code, supplier_name, send_place, dest_place, cost_fee, usd_cost_fee, bill_month, trade_date, send_piece_sum, piece_number, total_weight, total_volume, bl_confirm_center, real_piece_number, real_total_weight, real_total_volume, confirm_center_date, confirm_center_note, confirm_center_man_code, confirm_center_code, bl_confirm_site, confirm_site_date, confirm_site_man_code, confirm_site_note, confirm_site_code, bl_has_calc, calc_date, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_tms_cost_fee a
where a.bl_has_calc = '0' and a.del_flag='0'
limit 300
</select>
<select id="selectEmisTmsCostFeeById" parameterType="Long" resultMap="EmisTmsCostFeeResult">
select id, cost_no, cost_name, batch_no, fee_type, split_type, trans_type, trans_sign_no, supplier_code, supplier_name, send_place, dest_place, cost_fee, usd_cost_fee, bill_month, trade_date, send_piece_sum, piece_number, total_weight, total_volume, bl_confirm_center, real_piece_number, real_total_weight, real_total_volume, confirm_center_date, confirm_center_note, confirm_center_man_code, confirm_center_code, bl_confirm_site, confirm_site_date, confirm_site_man_code, confirm_site_note, confirm_site_code, bl_has_calc, calc_date, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_tms_cost_fee a
where a.id = #{id}
</select>
<select id="selectEmisTmsCostFeeByCostNo" parameterType="String" resultMap="EmisTmsCostFeeResult">
select id, cost_no, cost_name, batch_no, fee_type, split_type, trans_type, trans_sign_no, supplier_code, supplier_name, send_place, dest_place, cost_fee, usd_cost_fee, bill_month, trade_date, send_piece_sum, piece_number, total_weight, total_volume, bl_confirm_center, real_piece_number, real_total_weight, real_total_volume, confirm_center_date, confirm_center_note, confirm_center_man_code, confirm_center_code, bl_confirm_site, confirm_site_date, confirm_site_man_code, confirm_site_note, confirm_site_code, bl_has_calc, calc_date, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_tms_cost_fee a
where a.cost_no = #{costNo}
</select>
<select id="selectEmisTmsCostFeeByBatchNo" parameterType="String" resultMap="EmisTmsCostFeeResult">
select id, cost_no, cost_name, batch_no, fee_type, split_type, trans_type, trans_sign_no, supplier_code, supplier_name, send_place, dest_place, cost_fee, usd_cost_fee, bill_month, trade_date, send_piece_sum, piece_number, total_weight, total_volume, bl_confirm_center, real_piece_number, real_total_weight, real_total_volume, confirm_center_date, confirm_center_note, confirm_center_man_code, confirm_center_code, bl_confirm_site, confirm_site_date, confirm_site_man_code, confirm_site_note, confirm_site_code, bl_has_calc, calc_date, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_tms_cost_fee a
where a.batch_no = #{batchNo} limit 1
</select>
<select id="selectEmisTmsCostFeeByBatchIds" parameterType="Long[]" resultMap="EmisTmsCostFeeResult">
select c.id, c.cost_no, c.cost_name, c.batch_no, c.fee_type, c.split_type, c.trans_type, c.trans_sign_no,
c.supplier_code, c.supplier_name, c.send_place, c.dest_place, c.cost_fee, c.usd_cost_fee, c.bill_month,
c.trade_date, c.send_piece_sum, c.piece_number, c.total_weight, c.total_volume, c.bl_confirm_center,
c.real_piece_number, c.real_total_weight, c.real_total_volume, c.confirm_center_date, c.confirm_center_note,
c.confirm_center_man_code, c.confirm_center_code, c.bl_confirm_site, c.confirm_site_date,
c.confirm_site_man_code, c.confirm_site_note, c.confirm_site_code, c.bl_has_calc, c.calc_date, c.remark,
c.del_flag, c.create_by, c.create_time, c.update_by, c.update_time, c.create_site, c.update_site
from emis_tms_cost_fee c
inner join emis_tms_site_batch b on c.batch_no = b.batch_no
where
c.del_flag='0' and
b.id in
<foreach collection="array" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<insert id="insertEmisTmsCostFee" parameterType="EmisTmsCostFee" useGeneratedKeys="true" keyProperty="id">
insert into emis_tms_cost_fee
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="costNo != null and costNo != ''">cost_no,</if>
<if test="costName != null and costName != ''">cost_name,</if>
<if test="batchNo != null and batchNo != ''">batch_no,</if>
<if test="feeType != null and feeType != ''">fee_type,</if>
<if test="splitType != null and splitType != ''">split_type,</if>
<if test="transType != null and transType != ''">trans_type,</if>
<if test="transSignNo != null and transSignNo != ''">trans_sign_no,</if>
<if test="supplierCode != null and supplierCode != ''">supplier_code,</if>
<if test="supplierName != null and supplierName != ''">supplier_name,</if>
<if test="sendPlace != null and sendPlace != ''">send_place,</if>
<if test="destPlace != null and destPlace != ''">dest_place,</if>
<if test="costFee != null">cost_fee,</if>
<if test="usdCostFee != null">usd_cost_fee,</if>
<if test="billMonth != null and billMonth != ''">bill_month,</if>
<if test="tradeDate != null">trade_date,</if>
<if test="sendPieceSum != null">send_piece_sum,</if>
<if test="pieceNumber != null">piece_number,</if>
<if test="totalWeight != null">total_weight,</if>
<if test="totalVolume != null">total_volume,</if>
<if test="blConfirmCenter != null and blConfirmCenter != ''">bl_confirm_center,</if>
<if test="realPieceNumber != null">real_piece_number,</if>
<if test="realTotalWeight != null">real_total_weight,</if>
<if test="realTotalVolume != null">real_total_volume,</if>
<if test="confirmCenterDate != null">confirm_center_date,</if>
<if test="confirmCenterNote != null and confirmCenterNote != ''">confirm_center_note,</if>
<if test="confirmCenterManCode != null and confirmCenterManCode != ''">confirm_center_man_code,</if>
<if test="confirmCenterCode != null and confirmCenterCode != ''">confirm_center_code,</if>
<if test="blConfirmSite != null and blConfirmSite != ''">bl_confirm_site,</if>
<if test="confirmSiteDate != null">confirm_site_date,</if>
<if test="confirmSiteManCode != null and confirmSiteManCode != ''">confirm_site_man_code,</if>
<if test="confirmSiteNote != null and confirmSiteNote != ''">confirm_site_note,</if>
<if test="confirmSiteCode != null and confirmSiteCode != ''">confirm_site_code,</if>
<if test="blHasCalc != null and blHasCalc != ''">bl_has_calc,</if>
<if test="calcDate != null">calc_date,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="costNo != null and costNo != ''">#{costNo},</if>
<if test="costName != null and costName != ''">#{costName},</if>
<if test="batchNo != null and batchNo != ''">#{batchNo},</if>
<if test="feeType != null and feeType != ''">#{feeType},</if>
<if test="splitType != null and splitType != ''">#{splitType},</if>
<if test="transType != null and transType != ''">#{transType},</if>
<if test="transSignNo != null and transSignNo != ''">#{transSignNo},</if>
<if test="supplierCode != null and supplierCode != ''">#{supplierCode},</if>
<if test="supplierName != null and supplierName != ''">#{supplierName},</if>
<if test="sendPlace != null and sendPlace != ''">#{sendPlace},</if>
<if test="destPlace != null and destPlace != ''">#{destPlace},</if>
<if test="costFee != null">#{costFee},</if>
<if test="usdCostFee != null">#{usdCostFee},</if>
<if test="billMonth != null and billMonth != ''">#{billMonth},</if>
<if test="tradeDate != null">#{tradeDate},</if>
<if test="sendPieceSum != null">#{sendPieceSum},</if>
<if test="pieceNumber != null">#{pieceNumber},</if>
<if test="totalWeight != null">#{totalWeight},</if>
<if test="totalVolume != null">#{totalVolume},</if>
<if test="blConfirmCenter != null and blConfirmCenter != ''">#{blConfirmCenter},</if>
<if test="realPieceNumber != null">#{realPieceNumber},</if>
<if test="realTotalWeight != null">#{realTotalWeight},</if>
<if test="realTotalVolume != null">#{realTotalVolume},</if>
<if test="confirmCenterDate != null">#{confirmCenterDate},</if>
<if test="confirmCenterNote != null and confirmCenterNote != ''">#{confirmCenterNote},</if>
<if test="confirmCenterManCode != null and confirmCenterManCode != ''">#{confirmCenterManCode},</if>
<if test="confirmCenterCode != null and confirmCenterCode != ''">#{confirmCenterCode},</if>
<if test="blConfirmSite != null and blConfirmSite != ''">#{blConfirmSite},</if>
<if test="confirmSiteDate != null">#{confirmSiteDate},</if>
<if test="confirmSiteManCode != null and confirmSiteManCode != ''">#{confirmSiteManCode},</if>
<if test="confirmSiteNote != null and confirmSiteNote != ''">#{confirmSiteNote},</if>
<if test="confirmSiteCode != null and confirmSiteCode != ''">#{confirmSiteCode},</if>
<if test="blHasCalc != null and blHasCalc != ''">#{blHasCalc},</if>
<if test="calcDate != null">#{calcDate},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim>
</insert>
<update id="updateEmisTmsCostFee" parameterType="EmisTmsCostFee">
update emis_tms_cost_fee
<trim prefix="SET" suffixOverrides=",">
<if test="costNo != null and costNo != ''">cost_no = #{costNo},</if>
<if test="costName != null and costName != ''">cost_name = #{costName},</if>
<if test="batchNo != null and batchNo != ''">batch_no = #{batchNo},</if>
<if test="feeType != null and feeType != ''">fee_type = #{feeType},</if>
<if test="splitType != null and splitType != ''">split_type = #{splitType},</if>
<if test="transType != null and transType != ''">trans_type = #{transType},</if>
<if test="transSignNo != null and transSignNo != ''">trans_sign_no = #{transSignNo},</if>
<if test="supplierCode != null and supplierCode != ''">supplier_code = #{supplierCode},</if>
<if test="supplierName != null and supplierName != ''">supplier_name = #{supplierName},</if>
<if test="sendPlace != null and sendPlace != ''">send_place = #{sendPlace},</if>
<if test="destPlace != null and destPlace != ''">dest_place = #{destPlace},</if>
<if test="costFee != null">cost_fee = #{costFee},</if>
<if test="usdCostFee != null">usd_cost_fee = #{usdCostFee},</if>
<if test="billMonth != null and billMonth != ''">bill_month = #{billMonth},</if>
<if test="tradeDate != null">trade_date = #{tradeDate},</if>
<if test="sendPieceSum != null">send_piece_sum = #{sendPieceSum},</if>
<if test="pieceNumber != null">piece_number = #{pieceNumber},</if>
<if test="totalWeight != null">total_weight = #{totalWeight},</if>
<if test="totalVolume != null">total_volume = #{totalVolume},</if>
<if test="blConfirmCenter != null and blConfirmCenter != ''">bl_confirm_center = #{blConfirmCenter},</if>
<if test="realPieceNumber != null">real_piece_number = #{realPieceNumber},</if>
<if test="realTotalWeight != null">real_total_weight = #{realTotalWeight},</if>
<if test="realTotalVolume != null">real_total_volume = #{realTotalVolume},</if>
<if test="confirmCenterDate != null">confirm_center_date = #{confirmCenterDate},</if>
<if test="confirmCenterNote != null and confirmCenterNote != ''">confirm_center_note = #{confirmCenterNote},</if>
<if test="confirmCenterManCode != null and confirmCenterManCode != ''">confirm_center_man_code = #{confirmCenterManCode},</if>
<if test="confirmCenterCode != null and confirmCenterCode != ''">confirm_center_code = #{confirmCenterCode},</if>
<if test="blConfirmSite != null and blConfirmSite != ''">bl_confirm_site = #{blConfirmSite},</if>
<if test="confirmSiteDate != null">confirm_site_date = #{confirmSiteDate},</if>
<if test="confirmSiteManCode != null and confirmSiteManCode != ''">confirm_site_man_code = #{confirmSiteManCode},</if>
<if test="confirmSiteNote != null and confirmSiteNote != ''">confirm_site_note = #{confirmSiteNote},</if>
<if test="confirmSiteCode != null and confirmSiteCode != ''">confirm_site_code = #{confirmSiteCode},</if>
<if test="blHasCalc != null and blHasCalc != ''">bl_has_calc = #{blHasCalc},</if>
<if test="calcDate != null">calc_date = #{calcDate},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisTmsCostFeeById" parameterType="Long">
update emis_tms_cost_fee set del_flag='1' where id = #{id}
</delete>
<delete id="deleteEmisTmsCostFeeByIds" parameterType="String">
update emis_tms_cost_fee set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>