2025-05-28 11:07:39 +08:00
|
|
|
<?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">
|
2025-06-03 16:40:30 +08:00
|
|
|
<mapper namespace="com.wzj.soopin.order.mapper.OrderItemMapper">
|
|
|
|
|
2025-09-26 16:02:36 +08:00
|
|
|
<select id="selectByEntity" parameterType="OrderItem" resultType="OrderItem" >
|
|
|
|
select * from oms_order_item
|
2025-06-03 16:40:30 +08:00
|
|
|
<where>
|
2025-05-28 11:07:39 +08:00
|
|
|
<if test="orderId != null "> and order_id = #{orderId}</if>
|
|
|
|
<if test="productId != null "> and product_id = #{productId}</if>
|
|
|
|
<if test="outProductId != null and outProductId != ''"> and out_product_id = #{outProductId}</if>
|
|
|
|
<if test="skuId != null "> and sku_id = #{skuId}</if>
|
|
|
|
<if test="outSkuId != null and outSkuId != ''"> and out_sku_id = #{outSkuId}</if>
|
|
|
|
<if test="productSnapshotId != null "> and product_snapshot_id = #{productSnapshotId}</if>
|
|
|
|
<if test="skuSnapshotId != null "> and sku_snapshot_id = #{skuSnapshotId}</if>
|
|
|
|
<if test="pic != null and pic != ''"> and pic = #{pic}</if>
|
|
|
|
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
|
|
|
<if test="salePrice != null "> and sale_price = #{salePrice}</if>
|
|
|
|
<if test="purchasePrice != null "> and purchase_price = #{purchasePrice}</if>
|
|
|
|
<if test="quantity != null "> and quantity = #{quantity}</if>
|
|
|
|
<if test="productCategoryId != null "> and product_category_id = #{productCategoryId}</if>
|
|
|
|
<if test="spData != null and spData != ''"> and sp_data = #{spData}</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
2025-06-09 11:41:28 +08:00
|
|
|
|
2025-09-26 16:02:36 +08:00
|
|
|
<select id="selectOrderItem" parameterType="OrderItem" resultType="OrderItem">
|
2025-06-09 11:41:28 +08:00
|
|
|
SELECT * FROM oms_order_item
|
|
|
|
<where>
|
|
|
|
<if test="query.orderId != null and query.orderId != ''">
|
|
|
|
AND order_id LIKE CONCAT('%', #{query.orderId}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="query.productId != null">
|
|
|
|
AND product_id LIKE CONCAT('%', CAST(#{query.productId} AS CHAR), '%')
|
|
|
|
</if>
|
|
|
|
<if test="query.outProductId != null and query.outProductId != ''">
|
|
|
|
AND out_product_id LIKE CONCAT('%', #{query.outProductId}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="query.skuId != null">
|
|
|
|
AND sku_id LIKE CONCAT('%', CAST(#{query.skuId} AS CHAR), '%')
|
|
|
|
</if>
|
|
|
|
<if test="query.outSkuId != null and query.outSkuId != ''">
|
|
|
|
AND out_sku_id LIKE CONCAT('%', #{query.outSkuId}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="query.productSnapshotId != null">
|
|
|
|
AND product_snapshot_id LIKE CONCAT('%', CAST(#{query.productSnapshotId} AS CHAR), '%')
|
|
|
|
</if>
|
|
|
|
<if test="query.skuSnapshotId != null">
|
|
|
|
AND sku_snapshot_id LIKE CONCAT('%', CAST(#{query.skuSnapshotId} AS CHAR), '%')
|
|
|
|
</if>
|
|
|
|
<if test="query.pic != null and query.pic != ''">
|
|
|
|
AND pic LIKE CONCAT('%', #{query.pic}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="query.productNameLike != null and query.productNameLike != ''">
|
|
|
|
AND product_name LIKE CONCAT('%', #{query.productNameLike}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="query.salePrice != null">
|
|
|
|
AND sale_price = #{query.salePrice}
|
|
|
|
</if>
|
|
|
|
<if test="query.purchasePrice != null">
|
|
|
|
AND purchase_price = #{query.purchasePrice}
|
|
|
|
</if>
|
|
|
|
<if test="query.quantity != null">
|
|
|
|
AND quantity = #{query.quantity}
|
|
|
|
</if>
|
|
|
|
<if test="query.productCategoryId != null">
|
|
|
|
AND product_category_id = #{query.productCategoryId}
|
|
|
|
</if>
|
|
|
|
<if test="query.spData != null and query.spData != ''">
|
|
|
|
AND sp_data LIKE CONCAT('%', #{query.spData}, '%')
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
2025-09-26 16:02:36 +08:00
|
|
|
|
|
|
|
<select id="selectMerchatOrderPage" resultType="com.wzj.soopin.order.domain.vo.MerchantOrderVO">
|
|
|
|
SELECT o.id AS orderId,
|
|
|
|
o.order_sn AS orderSn,
|
|
|
|
o.member_id AS memberId,
|
|
|
|
o.member_username AS memberUsername,
|
|
|
|
o.merchant_note AS merchantNote,
|
|
|
|
o.pay_type AS payType,
|
|
|
|
o.status AS status,
|
|
|
|
o.aftersale AS aftersale,
|
|
|
|
oi.id AS orderItemId,
|
|
|
|
oi.product_id AS productId,
|
|
|
|
oi.sku_id AS skuId,
|
|
|
|
oi.product_snapshot_id AS productSnapshotId,
|
|
|
|
ppc.name AS productCategoryName,
|
|
|
|
oi.sku_snapshot_id AS skuSnapshotId,
|
|
|
|
oi.pic AS pic,
|
|
|
|
oi.product_name AS productName,
|
|
|
|
oi.sale_price AS salePrice,
|
|
|
|
oi.quantity AS quantity,
|
|
|
|
oi.product_category_id AS productCategoryId,
|
|
|
|
oi.sp_data AS spData,
|
|
|
|
oi.tenant_id AS tenantId,
|
|
|
|
oi.tenant_name AS tenantName
|
|
|
|
FROM oms_order_item oi
|
|
|
|
LEFT JOIN oms_order o ON oi.order_id = o.id
|
|
|
|
LEFT JOIN pms_product_category ppc ON oi.product_category_id = ppc.id
|
|
|
|
LEFT JOIN oms_verification_codes vc ON oi.id = vc.order_item_id
|
|
|
|
where oi.tenant_id = #{query.tenantId}
|
|
|
|
<if test="query.orderId != null">
|
|
|
|
AND o.id = #{query.orderId}
|
|
|
|
</if>
|
|
|
|
<if test="query.productId != null">
|
|
|
|
AND oi.product_id = #{query.productId}
|
|
|
|
</if>
|
|
|
|
<if test="query.outProductId != null">
|
|
|
|
AND oi.out_product_id = #{query.outProductId}
|
|
|
|
</if>
|
|
|
|
<if test="query.skuId != null">
|
|
|
|
AND oi.sku_id = #{query.skuId}
|
|
|
|
</if>
|
|
|
|
<if test="query.outSkuId != null">
|
|
|
|
AND oi.out_sku_id = #{query.outSkuId}
|
|
|
|
</if>
|
|
|
|
<if test="query.productSnapshotId != null">
|
|
|
|
AND oi.product_snapshot_id = #{query.productSnapshotId}
|
|
|
|
</if>
|
|
|
|
<if test="query.skuSnapshotId != null">
|
|
|
|
AND oi.sku_snapshot_id = #{query.skuSnapshotId}
|
|
|
|
</if>
|
|
|
|
<if test="query.salePrice != null">
|
|
|
|
AND oi.sale_price = #{query.salePrice}
|
|
|
|
</if>
|
|
|
|
<if test="query.productCategoryId != null">
|
|
|
|
AND oi.product_category_id = #{query.productCategoryId}
|
|
|
|
</if>
|
|
|
|
<if test="query.productCategoryId != null">
|
|
|
|
AND oi.product_category_id = #{query.productCategoryId}
|
|
|
|
</if>
|
|
|
|
<if test="query.productCategoryId != null">
|
|
|
|
AND oi.product_category_id = #{query.productCategoryId}
|
|
|
|
</if>
|
|
|
|
</select>
|
2025-05-28 11:07:39 +08:00
|
|
|
</mapper>
|