| <?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.mzl.flower.mapper.payment.OrderSalesItemMapper"> | 
|   | 
|     <select id="selectSalesItemList" resultType="com.mzl.flower.dto.response.payment.OrderItemSalesListDTO"> | 
|         SELECT si.*, oi.flower_name, oi.flower_unit, oi.flower_color, oi.flower_cover, oi.flower_level | 
|             , oi.flower_category, oi.num, oi.supplier_name, oi.price, oi.total | 
|         FROM t_order_sales_item si | 
|         join t_order_item oi on oi.id = si.order_item_id | 
|         WHERE oi.deleted = 0 | 
|         <if test="condition.salesId != null and condition.salesId != ''"> | 
|             AND si.sales_id = #{condition.salesId} | 
|         </if> | 
|         <if test="condition.supplierId != null"> | 
|             AND oi.supplier_id = #{condition.supplierId} | 
|         </if> | 
|   | 
|         ORDER BY si.create_time desc | 
|     </select> | 
|   | 
|     <select id="getSupplierSalesCount" resultType="java.lang.Integer"> | 
|         SELECT count(1) | 
|         FROM t_order_sales_item si | 
|         join t_order_item oi on oi.id = si.order_item_id | 
|         WHERE oi.deleted = 0 | 
|         AND oi.supplier_id = #{supplierId} | 
|     </select> | 
| </mapper> |