|
@@ -98,6 +98,8 @@
|
|
|
<result column="use_place" property="usePlace"/>
|
|
<result column="use_place" property="usePlace"/>
|
|
|
<result column="discount" property="discount"/>
|
|
<result column="discount" property="discount"/>
|
|
|
<result column="sup_id" property="supId"/>
|
|
<result column="sup_id" property="supId"/>
|
|
|
|
|
+ <result column="canOutingQty" property="canOutingQty"/>
|
|
|
|
|
+
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 通用条件列 -->
|
|
<!-- 通用条件列 -->
|
|
@@ -696,4 +698,55 @@
|
|
|
limit #{end} offset #{start}
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 销售出库页面选择源单 -->
|
|
|
|
|
+ <select id="selectBySaleOut" resultMap="BaseResultMapResponse">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ <include refid="Base_Column_List_Response"/>,
|
|
|
|
|
+ tmc.cus_code as "cusCode",
|
|
|
|
|
+ tmc.cus_name as "cusName",
|
|
|
|
|
+ tmc.cus_phone as "cusPhone",
|
|
|
|
|
+ tmc.address_full as "addressFull",
|
|
|
|
|
+ tmsc.channel_name as "channelName",
|
|
|
|
|
+ tmgs.sku_code AS "skuCode",
|
|
|
|
|
+ tmgs.sku_model AS "skuModel",
|
|
|
|
|
+ tmgs.sku_name AS "skuName",
|
|
|
|
|
+ tmgb.brand_name AS "brandName",
|
|
|
|
|
+ tmgb.short_name AS "shortName"
|
|
|
|
|
+ FROM dkic_b.t_psi_order_item t
|
|
|
|
|
+ LEFT JOIN dkic_b.t_psi_order as tpo ON t.order_id = tpo.order_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_customer tmc ON tmc.cus_id = tpo.cus_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_sale_channel tmsc ON tpo.sales_channel = tmsc.channel_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_goods_sku tmgs ON tmgs.sku_id = t.sku_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = tmgs.brand_id
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ t.cp_id = #{cpId}
|
|
|
|
|
+ and t.item_qty - t.outing_qty - t.out_qty > 0
|
|
|
|
|
+ <if test="orderNo != null">
|
|
|
|
|
+ AND tpo.order_no like concat('%', my_ex.likequery(#{orderNo}) , '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ order by t.op_create_time desc
|
|
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
|
|
+ limit #{end} offset #{start}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 销售出库页面选择源单个数 -->
|
|
|
|
|
+ <select id="selectBySaleOutByCound" resultMap="BaseResultMapResponse">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ count(1)
|
|
|
|
|
+ FROM dkic_b.t_psi_order_item t
|
|
|
|
|
+ LEFT JOIN dkic_b.t_psi_order as tpo ON t.order_id = tpo.order_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_customer tmc ON tmc.cus_id = tpo.cus_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_sale_channel tmsc ON tpo.sales_channel = tmsc.channel_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_goods_sku tmgs ON tmgs.sku_id = t.sku_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = tmgs.brand_id
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ t.cp_id = #{cpId}
|
|
|
|
|
+ and t.item_qty - t.outing_qty - t.out_qty > 0
|
|
|
|
|
+ <if test="orderNo != null">
|
|
|
|
|
+ AND tpo.order_no like concat('%', my_ex.likequery(#{orderNo}) , '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
</mapper>
|
|
</mapper>
|