<?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="net.lab1024.sa.admin.module.business.receive.asnDetail.dao.AsnDetailDao">

    <!-- 查询结果列 -->
    <sql id="base_columns">
        t_asn_detail.asn_detail_id,
        t_asn_detail.asn_id,
        t_asn_detail.item_id,
        t_asn_detail.order_quantity,
        t_asn_detail.received_quantity,
        t_asn_detail.create_time,
        t_asn_detail.create_user_id,
        t_asn_detail.create_user_name,
        t_asn_detail.update_time
    </sql>

    <!-- 分页查询 -->
    <select id="queryPage" resultType="net.lab1024.sa.admin.module.business.receive.asnDetail.domain.vo.AsnDetailVO">
        SELECT
        <include refid="base_columns"/>
        FROM t_asn_detail
        <where>
            <!--入库单-->
            <if test="queryForm.asnId != null ">
                AND t_asn_detail.asn_id=#{queryForm.asnId}
            </if>
            <!--物料-->
            <if test="queryForm.itemId != null ">
                AND t_asn_detail.item_id=#{queryForm.itemId}
            </if>
        </where>
    </select>


</mapper>
