<?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.ErpMaterialPickingInfoMapper">

    <resultMap type="com.maintain.business.domain.vo.ErpMaterialPickingInfoVo" id="ErpMaterialPickingInfoResult">
        <result property="id" column="id"/>
        <result property="repairFormId" column="repair_form_id"/>
        <result property="pickingId" column="picking_id"/>
        <result property="warehouseId" column="warehouse_id"/>
        <result property="warehouseName" column="warehouse_name"/>
        <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="collectNumber" column="collect_number"/>
        <result property="price" column="price"/>
        <result property="money" column="money"/>
        <result property="state" column="state"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="returnNumber" column="return_number"/>
        <result property="repairNumber" column="repair_number"/>
        <result property="outNumber" column="out_number"/>
    </resultMap>
    <sql id="info">
        SELECT
            empi.id, empi.repair_form_id, empi.picking_id, empi.warehouse_id, empi.warehouse_name, 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.collect_number,
            empi.price, empi.money, empi.state, empi.create_by, empi.create_time, emp.return_number, emp.repair_number, emp.out_number
        FROM erp_material_picking_info empi
        LEFT JOIN erp_material_picking emp ON empi.picking_id = emp.id
    </sql>

    <select id="customQueryPageList" resultType="com.maintain.business.domain.vo.ErpMaterialPickingInfoVo">
        <include refid="info" />
        ${ew.getCustomSqlSegment}
    </select>

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


</mapper>
