SampleFeedbackTrackingDetailMapper.xml 4.64 KB
<?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.lframework.xingyun.sc.mappers.SampleFeedbackTrackingDetailMapper">

    <resultMap id="SampleFeedbackTrackingDetail" type="com.lframework.xingyun.sc.entity.SampleFeedbackTrackingDetail">
        <id column="id" property="id"/>
        <result column="feedback_id" property="feedbackId"/>
        <result column="tracking_id" property="trackingId"/>
        <result column="order_id" property="orderId"/>
        <result column="order_spec_id" property="orderSpecId"/>
        <result column="shipment_order_id" property="shipmentOrderId"/>
        <result column="shipment_detail_id" property="shipmentDetailId"/>
        <result column="brand" property="brand"/>
        <result column="thickness" property="thickness"/>
        <result column="thickness_tol_pos" property="thicknessTolPos"/>
        <result column="thickness_tol_neg" property="thicknessTolNeg"/>
        <result column="width" property="width"/>
        <result column="width_tol_pos" property="widthTolPos"/>
        <result column="width_tol_neg" property="widthTolNeg"/>
        <result column="length" property="length"/>
        <result column="length_tol_pos" property="lengthTolPos"/>
        <result column="length_tol_neg" property="lengthTolNeg"/>
        <result column="status" property="status"/>
        <result column="shipment_date" property="shipmentDate"/>
        <result column="quantity" property="quantity"/>
        <result column="yield_batch_no" property="yieldBatchNo"/>
        <result column="create_by_id" property="createById"/>
        <result column="update_by_id" property="updateById"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>

    <sql id="SampleFeedbackTrackingDetail_sql">
        SELECT
            tb.id,
            tb.feedback_id,
            tb.tracking_id,
            tb.order_id,
            tb.order_spec_id,
            tb.shipment_order_id,
            tb.shipment_detail_id,
            tb.brand,
            tb.thickness,
            tb.thickness_tol_pos,
            tb.thickness_tol_neg,
            tb.width,
            tb.width_tol_pos,
            tb.width_tol_neg,
            tb.length,
            tb.length_tol_pos,
            tb.length_tol_neg,
            tb.status,
            tb.shipment_date,
            tb.quantity,
            tb.yield_batch_no,
            tb.create_by_id,
            tb.update_by_id,
            tb.create_time,
            tb.update_time
        FROM sample_feedback_tracking_detail AS tb
    </sql>

    <select id="query" resultMap="SampleFeedbackTrackingDetail">
        <include refid="SampleFeedbackTrackingDetail_sql"/>
        <where>
            <if test="vo.feedbackId != null and vo.feedbackId != ''">
                AND tb.feedback_id = #{vo.feedbackId}
            </if>
            <if test="vo.trackingId != null and vo.trackingId != ''">
                AND tb.tracking_id = #{vo.trackingId}
            </if>
        </where>
    </select>

    <insert id="batchAdd">
        INSERT INTO sample_feedback_tracking_detail (
        id,
        feedback_id,
        tracking_id,
        order_id,
        order_spec_id,
        shipment_order_id,
        shipment_detail_id,
        brand,
        thickness,
        thickness_tol_pos,
        thickness_tol_neg,
        width,
        width_tol_pos,
        width_tol_neg,
        length,
        length_tol_pos,
        length_tol_neg,
        status,
        shipment_date,
        quantity,
        yield_batch_no,
        create_by_id,
        update_by_id,
        create_time,
        update_time
        ) VALUES
        <foreach collection="list" item="item" separator=",">
            (
            #{item.id},
            #{item.feedbackId},
            #{item.trackingId},
            #{item.orderId},
            #{item.orderSpecId},
            #{item.shipmentOrderId},
            #{item.shipmentDetailId},
            #{item.brand},
            #{item.thickness},
            #{item.thicknessTolPos},
            #{item.thicknessTolNeg},
            #{item.width},
            #{item.widthTolPos},
            #{item.widthTolNeg},
            #{item.length},
            #{item.lengthTolPos},
            #{item.lengthTolNeg},
            #{item.status},
            #{item.shipmentDate},
            #{item.quantity},
            #{item.yieldBatchNo},
            #{item.createById},
            #{item.updateById},
            #{item.createTime},
            #{item.updateTime}
            )
        </foreach>
    </insert>
</mapper>