SalesmanQuotationLineMapper.xml 2.62 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.procurement.mappers.quotation.SalesmanQuotationLineMapper">

    <resultMap id="SalesmanQuotationLine" type="com.lframework.xingyun.sc.procurement.entity.SalesmanQuotationLine">
        <id column="id" property="id"/>
        <result column="quotation_id" property="quotationId"/>
        <result column="product_id" property="productId"/>
        <result column="product_name" property="productName"/>
        <result column="product_code" property="productCode"/>
        <result column="product_type" property="productType"/>
        <result column="fixed_attrition_rate" property="fixedAttritionRate"/>
        <result column="material_type" property="materialType"/>
        <result column="quantity" property="quantity"/>
        <result column="purchase_price" property="purchasePrice"/>
        <result column="estimated_loss" property="estimatedLoss"/>
        <result column="application_attrition" property="applicationAttrition"/>
        <result column="item_id" property="itemId"/>
        <result column="create_by_id" property="createById"/>
        <result column="create_by" property="createBy"/>
        <result column="update_by_id" property="updateById"/>
        <result column="update_by" property="updateBy"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>

    <sql id="SalesmanQuotationLineSql">
        SELECT
            tb.id,
            tb.quotation_id,
            tb.product_id,
            br.product_name,
            br.code AS product_code,
            br.type AS product_type,
            br.attrition_rate AS fixed_attrition_rate,
            tb.material_type,
            tb.quantity,
            tb.purchase_price,
            tb.estimated_loss,
            tb.application_attrition,
            tb.item_id,
            tb.create_by_id,
            tb.create_by,
            tb.update_by_id,
            tb.update_by,
            tb.create_time,
            tb.update_time
        FROM procurement_salesman_quotation_line tb
        LEFT JOIN base_data_breed_relationship br ON br.id = tb.product_id
    </sql>

    <select id="query" resultMap="SalesmanQuotationLine">
        <include refid="SalesmanQuotationLineSql"/>
        <where>
            <if test="vo.quotationId != null and vo.quotationId != ''">
                AND tb.quotation_id = #{vo.quotationId}
            </if>
        </where>
        ORDER BY tb.create_time ASC
    </select>
</mapper>