|  | @@ -2,4 +2,72 @@
 | 
	
		
			
				|  |  |  <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
	
		
			
				|  |  |  <mapper namespace="org.jeecg.modules.documents.orderData.mapper.SyOrderDataMapper">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    <select id="queryList" resultType="org.jeecg.modules.documents.orderData.entity.SyOrderData" >
 | 
	
		
			
				|  |  | +        SELECT
 | 
	
		
			
				|  |  | +            a.id,
 | 
	
		
			
				|  |  | +            order_number,
 | 
	
		
			
				|  |  | +            order_date,
 | 
	
		
			
				|  |  | +            business_type_value,
 | 
	
		
			
				|  |  | +            business_type_text,
 | 
	
		
			
				|  |  | +            sales_type_value,
 | 
	
		
			
				|  |  | +            sales_type_text,
 | 
	
		
			
				|  |  | +            customer_abbreviation,
 | 
	
		
			
				|  |  | +            customer_name,
 | 
	
		
			
				|  |  | +            exchange_rate,
 | 
	
		
			
				|  |  | +            sales_department,
 | 
	
		
			
				|  |  | +            salesman,
 | 
	
		
			
				|  |  | +            currency_value,
 | 
	
		
			
				|  |  | +            currency_text,
 | 
	
		
			
				|  |  | +            brand_side,
 | 
	
		
			
				|  |  | +            third_party,
 | 
	
		
			
				|  |  | +            deposit_ratio,
 | 
	
		
			
				|  |  | +            deposit,
 | 
	
		
			
				|  |  | +            collaborative_route,
 | 
	
		
			
				|  |  | +            order_remarks,
 | 
	
		
			
				|  |  | +            price_remarks,
 | 
	
		
			
				|  |  | +            customer_order_number,
 | 
	
		
			
				|  |  | +            whole_order_total,
 | 
	
		
			
				|  |  | +            end_customer,
 | 
	
		
			
				|  |  | +            term_of_payment,
 | 
	
		
			
				|  |  | +            order_change_description,
 | 
	
		
			
				|  |  | +            a.memo,
 | 
	
		
			
				|  |  | +            supplier,
 | 
	
		
			
				|  |  | +            account,
 | 
	
		
			
				|  |  | +            dilivery,
 | 
	
		
			
				|  |  | +            garment_factory,
 | 
	
		
			
				|  |  | +            garment_nmb
 | 
	
		
			
				|  |  | +        FROM
 | 
	
		
			
				|  |  | +            sy_order_data a
 | 
	
		
			
				|  |  | +            <if test="(sy.isProduct != null and sy.isProduct != '') or (sy.dilivery != null and sy.dilivery != '')">
 | 
	
		
			
				|  |  | +        left join sy_order_data_item b on a.id=b.sy_order_data_id
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +        WHERE 1=1
 | 
	
		
			
				|  |  | +            <if test="sy.orderNumber != null and sy.orderNumber !=''">
 | 
	
		
			
				|  |  | +                AND order_number = #{sy.orderNumber}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +             <if test="sy.customerAbbreviation != null and sy.customerAbbreviation !=''">
 | 
	
		
			
				|  |  | +                 AND customer_abbreviation = #{sy.customerAbbreviation}
 | 
	
		
			
				|  |  | +             </if>
 | 
	
		
			
				|  |  | +             <if test="sy.orderDate !=null and sy.orderDate !=''">
 | 
	
		
			
				|  |  | +                 AND order_date = #{sy.orderDate}
 | 
	
		
			
				|  |  | +             </if>
 | 
	
		
			
				|  |  | +             <if test="sy.account != null and sy.account !=''">
 | 
	
		
			
				|  |  | +                 AND account = #{sy.account}
 | 
	
		
			
				|  |  | +             </if>
 | 
	
		
			
				|  |  | +             <if test="(sy.dilivery != null and sy.dilivery != '') and (sy.dilivery == '0' or sy.dilivery ==0)">
 | 
	
		
			
				|  |  | +                 AND b.surplus_num <![CDATA[ < ]]> b.quantity
 | 
	
		
			
				|  |  | +             </if>
 | 
	
		
			
				|  |  | +            <if test="(sy.dilivery != null and sy.dilivery != '') and (sy.dilivery == '1' or sy.dilivery ==1)">
 | 
	
		
			
				|  |  | +                AND b.surplus_num <![CDATA[ >= ]]> b.quantity
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +             <if test="(sy.isProduct != null and sy.isProduct != '') and (sy.isProduct == '0' or sy.isProduct ==0) ">
 | 
	
		
			
				|  |  | +                 AND b.inventory_code like '19%'
 | 
	
		
			
				|  |  | +             </if>
 | 
	
		
			
				|  |  | +             <if test="(sy.isProduct != null and sy.isProduct != '') and (sy.isProduct == '1' or sy.isProduct == 1) ">
 | 
	
		
			
				|  |  | +                 AND b.inventory_code not like '19%'
 | 
	
		
			
				|  |  | +             </if>
 | 
	
		
			
				|  |  | +        ORDER BY
 | 
	
		
			
				|  |  | +            order_date DESC
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  </mapper>
 |