<?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.wms.receive.asn.dao.AsnDao">

    <!-- 查询结果列 -->
    <sql id="base_columns">
        t_asn.asn_id,
        t_asn.asn_number,
        t_asn.customer_number,
        t_asn.order_type,
        t_asn.status,
        t_asn.customer_id,
        t_asn.address_id,
        t_asn.person,
        t_asn.telephone,
        t_asn.address,
        t_asn.order_quantity,
        t_asn.received_quantity,
        t_asn.order_date,
        t_asn.create_time
    </sql>

    <!-- 分页查询 -->
    <select id="queryPage" resultType="net.lab1024.sa.admin.module.business.wms.receive.asn.domain.vo.AsnVO">
        SELECT
        <include refid="base_columns"/>
        FROM t_asn
        <where>
            <!--客户订单号-->
            <if test="queryForm.customerNumber != null and queryForm.customerNumber != ''">
                AND t_asn.customer_number LIKE CONCAT(#{queryForm.customerNumber},'%')
            </if>
            <!--单据类型-->
            <if test="queryForm.orderType != null and queryForm.orderType != ''">
                AND t_asn.order_type=#{queryForm.orderType}
            </if>
            <!--状态-->
            <if test="queryForm.status != null and queryForm.status != ''">
                AND t_asn.status=#{queryForm.status}
            </if>
        </where>
        ORDER BY t_asn.asn_id DESC
    </select>


</mapper>
