| <?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.zy.asrs.mapper.OrderViewMapper"> | 
|   | 
|     <!-- 通用查询映射结果 --> | 
|     <resultMap id="BaseResultMap" type="com.zy.asrs.entity.OrderView"> | 
|         <id column="id" property="id"/> | 
|         <result column="uuid" property="uuid"/> | 
|         <result column="order_no" property="orderNo"/> | 
|         <result column="order_time" property="orderTime"/> | 
|         <result column="doc_type" property="docType"/> | 
|         <result column="item_id" property="itemId"/> | 
|         <result column="item_name" property="itemName"/> | 
|         <result column="allot_item_id" property="allotItemId"/> | 
|         <result column="def_number" property="defNumber"/> | 
|         <result column="number" property="number"/> | 
|         <result column="cstmr" property="cstmr"/> | 
|         <result column="cstmr_name" property="cstmrName"/> | 
|         <result column="tel" property="tel"/> | 
|         <result column="oper_memb" property="operMemb"/> | 
|         <result column="total_fee" property="totalFee"/> | 
|         <result column="discount" property="discount"/> | 
|         <result column="discount_fee" property="discountFee"/> | 
|         <result column="other_fee" property="otherFee"/> | 
|         <result column="act_fee" property="actFee"/> | 
|         <result column="pay_type" property="payType"/> | 
|         <result column="salesman" property="salesman"/> | 
|         <result column="account_day" property="accountDay"/> | 
|         <result column="post_fee_type" property="postFeeType"/> | 
|         <result column="post_fee" property="postFee"/> | 
|         <result column="pay_time" property="payTime"/> | 
|         <result column="send_time" property="sendTime"/> | 
|         <result column="ship_name" property="shipName"/> | 
|         <result column="ship_code" property="shipCode"/> | 
|         <result column="settle" property="settle"/> | 
|         <result column="status" property="status"/> | 
|         <result column="create_by" property="createBy"/> | 
|         <result column="create_time" property="createTime"/> | 
|         <result column="update_by" property="updateBy"/> | 
|         <result column="update_time" property="updateTime"/> | 
|         <result column="memo" property="memo"/> | 
|   | 
|         <result column="anfme" property="anfme"/> | 
|         <result column="qty" property="qty"/> | 
|         <result column="matnr" property="matnr"/> | 
|         <result column="three_code" property="threeCode"/> | 
|         <result column="maktx" property="maktx"/> | 
|         <result column="batch" property="batch"/> | 
|         <result column="process_sts" property="processSts"/> | 
|         <result column="report_qty" property="reportQty"/> | 
|         <result column="dev_no" property="devNo"/> | 
|   | 
|   | 
|     </resultMap> | 
|   | 
|     <sql id="viewConditionSql"> | 
|         <if test="matnr!=null and matnr!='' "> | 
|             and matnr like '%' + #{matnr} + '%' | 
|         </if> | 
|         <if test="maktx!=null and maktx!='' "> | 
|             and maktx like '%' + #{maktx} + '%' | 
|         </if> | 
|         <if test="orderNo!=null and orderNo!='' "> | 
|             and order_no like '%' + #{orderNo} + '%' | 
|         </if> | 
|         <if test="threeCode!=null and threeCode!='' "> | 
|             and three_code like '%' + #{threeCode} + '%' | 
|         </if> | 
|         <if test="docType!=null  "> | 
|             and doc_type = #{docType} | 
|         </if> | 
|         <if test="settle!=null "> | 
|             and settle = #{settle} | 
|         </if> | 
|     </sql> | 
|   | 
|     <select id="selectOrderView" parameterType="com.zy.asrs.entity.OrderViewParam" resultMap="BaseResultMap"> | 
|         select * from ( select *,ROW_NUMBER() over (order by create_time desc) as row | 
|         from agv_order_view aov | 
|         where 1=1 | 
|         <include refid="viewConditionSql"></include> | 
|         ) a | 
|         where a.row between ((#{curr}-1)*#{limit}+1) and (#{curr}*#{limit}) | 
|     </select> | 
|   | 
|     <select id="countOrderView" parameterType="com.zy.asrs.entity.OrderViewParam" resultType="Integer"> | 
|         select count(1) | 
|         from agv_order_view aov | 
|         where 1=1 | 
|         <include refid="viewConditionSql"></include> | 
|     </select> | 
|   | 
| </mapper> |