|
|
@@ -9,7 +9,7 @@
|
|
|
</sql>
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
- <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.sale.OrderItem">
|
|
|
+ <resultMap id="BaseResultMap" type="com.dk.mdm.model.response.sale.OrderItemResponse">
|
|
|
<id column="item_id" property="itemId"/>
|
|
|
<result column="order_id" property="orderId" typeHandler="UuidTypeHandler"/>
|
|
|
<result column="item_index" property="itemIndex"/>
|
|
|
@@ -44,85 +44,64 @@
|
|
|
<sql id="Condition">
|
|
|
<where>
|
|
|
<if test="orderId != null and orderId != ''">
|
|
|
- AND order_id = #{orderId}
|
|
|
+ AND tpoi.order_id = #{orderId}::uuid
|
|
|
</if>
|
|
|
<if test="itemIndex != null">
|
|
|
- AND item_index = #{itemIndex}
|
|
|
+ AND tpoi.item_index = #{itemIndex}
|
|
|
</if>
|
|
|
<if test="skuId != null and skuId != ''">
|
|
|
- AND sku_id = #{skuId}
|
|
|
+ AND tpoi.sku_id = #{skuId}
|
|
|
</if>
|
|
|
<if test="itemQty != null">
|
|
|
- AND item_qty = #{itemQty}
|
|
|
+ AND tpoi.item_qty = #{itemQty}
|
|
|
</if>
|
|
|
<if test="priceStd != null">
|
|
|
- AND price_std = #{priceStd}
|
|
|
+ AND tpoi.price_std = #{priceStd}
|
|
|
</if>
|
|
|
<if test="amtStd != null">
|
|
|
- AND amt_std = #{amtStd}
|
|
|
+ AND tpoi.amt_std = #{amtStd}
|
|
|
</if>
|
|
|
<if test="priceSale != null">
|
|
|
- AND price_sale = #{priceSale}
|
|
|
+ AND tpoi.price_sale = #{priceSale}
|
|
|
</if>
|
|
|
<if test="itemAmt != null">
|
|
|
- AND item_amt = #{itemAmt}
|
|
|
+ AND tpoi.item_amt = #{itemAmt}
|
|
|
</if>
|
|
|
<if test="priceDiscount != null">
|
|
|
- AND price_discount = #{priceDiscount}
|
|
|
+ AND tpoi.price_discount = #{priceDiscount}
|
|
|
</if>
|
|
|
<if test="nonStdCode != null and nonStdCode != ''">
|
|
|
- AND non_std_code = #{nonStdCode}
|
|
|
+ AND tpoi.non_std_code = #{nonStdCode}
|
|
|
</if>
|
|
|
<if test="outStatus != null and outStatus != ''">
|
|
|
- AND out_status = #{outStatus}
|
|
|
+ AND tpoi.out_status = #{outStatus}
|
|
|
</if>
|
|
|
<if test="outingQty != null">
|
|
|
- AND outing_qty = #{outingQty}
|
|
|
+ AND tpoi.outing_qty = #{outingQty}
|
|
|
</if>
|
|
|
<if test="outingAmt != null">
|
|
|
- AND outing_amt = #{outingAmt}
|
|
|
+ AND tpoi.outing_amt = #{outingAmt}
|
|
|
</if>
|
|
|
<if test="outQty != null">
|
|
|
- AND out_qty = #{outQty}
|
|
|
+ AND tpoi.out_qty = #{outQty}
|
|
|
</if>
|
|
|
<if test="outAmt != null">
|
|
|
- AND out_amt = #{outAmt}
|
|
|
+ AND tpoi.out_amt = #{outAmt}
|
|
|
</if>
|
|
|
<if test="returnQty != null">
|
|
|
- AND return_qty = #{returnQty}
|
|
|
+ AND tpoi.return_qty = #{returnQty}
|
|
|
</if>
|
|
|
<if test="returnAmt != null">
|
|
|
- AND return_amt = #{returnAmt}
|
|
|
+ AND tpoi.return_amt = #{returnAmt}
|
|
|
</if>
|
|
|
<if test="remarks != null and remarks != ''">
|
|
|
- AND remarks = #{remarks}
|
|
|
+ AND tpoi.remarks = #{remarks}
|
|
|
</if>
|
|
|
<if test="flgValid != null">
|
|
|
- AND flg_valid = #{flgValid}
|
|
|
+ AND tpoi.flg_valid = #{flgValid}
|
|
|
</if>
|
|
|
<if test="cpId != null">
|
|
|
- AND cp_id = #{cpId}
|
|
|
- </if>
|
|
|
- <if test="opCreateTime != null">
|
|
|
- AND op_create_time = #{opCreateTime}
|
|
|
- </if>
|
|
|
- <if test="opCreateUserId != null and opCreateUserId != ''">
|
|
|
- AND op_create_user_id = #{opCreateUserId}
|
|
|
- </if>
|
|
|
- <if test="opUpdateTime != null">
|
|
|
- AND op_update_time = #{opUpdateTime}
|
|
|
- </if>
|
|
|
- <if test="opUpdateUserId != null and opUpdateUserId != ''">
|
|
|
- AND op_update_user_id = #{opUpdateUserId}
|
|
|
- </if>
|
|
|
- <if test="opAppCode != null and opAppCode != ''">
|
|
|
- AND op_app_code = #{opAppCode}
|
|
|
- </if>
|
|
|
- <if test="opTimestamp != null">
|
|
|
- AND op_timestamp = #{opTimestamp}
|
|
|
- </if>
|
|
|
- <if test="opDbUser != null and opDbUser != ''">
|
|
|
- AND op_db_user = #{opDbUser}
|
|
|
+ AND tpoi.cp_id = #{cpId}
|
|
|
</if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
@@ -137,9 +116,30 @@
|
|
|
|
|
|
<!-- 查询表t_psi_order_item,(条件查询+分页)列表 -->
|
|
|
<select id="selectByCond" resultMap="BaseResultMap">
|
|
|
- SELECT
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
- FROM t_psi_order_item
|
|
|
+ SELECT tpoi.item_id,
|
|
|
+ tpoi.order_id,
|
|
|
+ tpoi.item_index,
|
|
|
+ tpoi.sku_id,
|
|
|
+ tmgs.sku_code as "skuCode",
|
|
|
+ tmgs.sku_model as "skuModel",
|
|
|
+ tmgs.sku_name as "skuName",
|
|
|
+ tpoi.item_qty,
|
|
|
+ tpoi.price_std,
|
|
|
+ tpoi.amt_std,
|
|
|
+ tpoi.price_sale,
|
|
|
+ tpoi.item_amt,
|
|
|
+ tpoi.price_discount,
|
|
|
+ tpoi.non_std_code,
|
|
|
+ tpoi.out_status,
|
|
|
+ tpoi.outing_qty,
|
|
|
+ tpoi.outing_amt,
|
|
|
+ tpoi.out_qty,
|
|
|
+ tpoi.out_amt,
|
|
|
+ tpoi.return_qty,
|
|
|
+ tpoi.return_amt,
|
|
|
+ tpoi.remarks
|
|
|
+ FROM dkic_b.t_psi_order_item as tpoi
|
|
|
+ inner join dkic_b.t_mst_goods_sku tmgs on tpoi.sku_id = tmgs.sku_id
|
|
|
<include refid="Condition"/>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|