订单相关
This commit is contained in:
50
src/main/resources/mapper/OrderItemMapper.xml
Normal file
50
src/main/resources/mapper/OrderItemMapper.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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.aida.seller.module.order.mapper.OrderItemMapper">
|
||||
|
||||
<select id="selectAssetsPage" resultType="com.aida.seller.module.order.vo.AssetsItemVO">
|
||||
SELECT
|
||||
soi.listing_id,
|
||||
soi.listing_name,
|
||||
soi.thumbnail_url,
|
||||
soi.price,
|
||||
soi.create_time
|
||||
FROM seller_order_item soi
|
||||
INNER JOIN seller_orders so ON soi.order_id = so.id
|
||||
INNER JOIN seller_listing l ON soi.listing_id = l.id
|
||||
WHERE soi.deleted = 0
|
||||
AND so.deleted = 0
|
||||
AND so.buyer_id = #{dto.buyerId}
|
||||
AND so.status = 1
|
||||
<if test="dto.categories != null and dto.categories.size() > 0">
|
||||
<foreach collection="dto.categories" item="cat">
|
||||
AND JSON_CONTAINS(soi.product_category, #{cat})
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="dto.designFor != null and dto.designFor != '' and dto.designFor != 'all'">
|
||||
AND l.design_for = #{dto.designFor}
|
||||
</if>
|
||||
ORDER BY soi.create_time DESC
|
||||
LIMIT #{offset}, #{size}
|
||||
</select>
|
||||
|
||||
<select id="selectAssetsCount" resultType="java.lang.Long">
|
||||
SELECT COUNT(*)
|
||||
FROM seller_order_item soi
|
||||
INNER JOIN seller_orders so ON soi.order_id = so.id
|
||||
INNER JOIN seller_listing l ON soi.listing_id = l.id
|
||||
WHERE soi.deleted = 0
|
||||
AND so.deleted = 0
|
||||
AND so.buyer_id = #{dto.buyerId}
|
||||
AND so.status = 1
|
||||
<if test="dto.categories != null and dto.categories.size() > 0">
|
||||
<foreach collection="dto.categories" item="cat">
|
||||
AND JSON_CONTAINS(soi.product_category, #{cat})
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="dto.designFor != null and dto.designFor != '' and dto.designFor != 'all'">
|
||||
AND l.design_for = #{dto.designFor}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user