<?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.maintain.business.mapper.ErpMaterialPutawayInfoMapper">

    <resultMap type="com.maintain.business.domain.vo.ErpMaterialPutawayInfoVo" id="ErpMaterialPutawayInfoResult">
        <result property="id" column="id"/>
        <result property="putawayId" column="putaway_id"/>
        <result property="materialTypeId" column="material_type_id"/>
        <result property="materialTypeName" column="material_type_name"/>
        <result property="warehouseLocationId" column="warehouse_location_id"/>
        <result property="warehouseLocationType" column="warehouse_location_type"/>
        <result property="vendorId" column="vendor_id"/>
        <result property="vendorName" column="vendor_name"/>
        <result property="materialId" column="material_id"/>
        <result property="materialCode" column="material_code"/>
        <result property="materialName" column="material_name"/>
        <result property="materialSpecifications" column="material_specifications"/>
        <result property="materialUnit" column="material_unit"/>
        <result property="materialWarrantyPeriod" column="material_warranty_period"/>
        <result property="referencePrice" column="reference_price"/>
        <result property="sellingPrice" column="selling_price"/>
        <result property="putawayNumber" column="putaway_number"/>
        <result property="putawayPrice" column="putaway_price"/>
        <result property="putawayMoney" column="putaway_money"/>
        <result property="returnedNumber" column="returned_number"/>
        <result property="state" column="state"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="orderNumber" column="order_number"/>
        <result property="arrivalNumber" column="arrival_number"/>
        <result property="putawayCode" column="putaway_code"/>
        <result property="putawayType" column="putaway_type"/>
    </resultMap>

    <sql id="materialPutawayInfoResultVoSql">
        SELECT
            empi.id, empi.vendor_id, empi.vendor_name, empi.material_id, empi.material_code, empi.material_name,
            empi.material_specifications, empi.material_unit, empi.material_warranty_period, empi.reference_price,
            empi.selling_price, empi.putaway_number, empi.putaway_price, empi.putaway_money, empi.is_returns, empi.returned_number,
            empi.state, empi.create_by, empi.create_time, emp.order_number, emp.arrival_number, emp.putaway_code,
            emp.putaway_type
        FROM erp_material_putaway_info empi
        LEFT JOIN erp_material_putaway emp ON empi.putaway_id = emp.id
    </sql>
    <select id="customQueryPageList" resultType="com.maintain.business.domain.vo.ErpMaterialPutawayInfoVo">
        <include refid="materialPutawayInfoResultVoSql" />
        ${ew.getCustomSqlSegment}
    </select>

    <select id="customQueryList" resultType="com.maintain.business.domain.vo.ErpMaterialPutawayInfoVo">
        <include refid="materialPutawayInfoResultVoSql" />
        ${ew.getCustomSqlSegment}
    </select>


</mapper>
