...
|
...
|
@@ -253,4 +253,83 @@ |
|
|
#{item}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
|
|
|
<select id="selectProductStockNotZeroCount" resultType="java.lang.Integer">
|
|
|
select count(p.id)
|
|
|
from product p
|
|
|
where 1 = 1
|
|
|
and p.id in (
|
|
|
select distinct product_id
|
|
|
from storage_price s
|
|
|
where 1 = 1
|
|
|
and s.status = #{status}
|
|
|
and s.seller_uid in
|
|
|
<foreach item="sellerItem" index="index" collection="sellerList" open="(" separator="," close=")">
|
|
|
#{sellerItem}
|
|
|
</foreach>
|
|
|
<if test="product.storageId != null and product.storageId > 0">
|
|
|
and s.storage_id = #{product.storageId}
|
|
|
</if>
|
|
|
<if test="product.skup != null and product.skup > 0">
|
|
|
and s.skup = #{product.skup}
|
|
|
</if>
|
|
|
)
|
|
|
<if test="product.id != null and product.id > 0">
|
|
|
and p.id = #{product.id}
|
|
|
</if>
|
|
|
<if test="product.productName != null and product.productName != '' ">
|
|
|
and p.product_name like concat('%', #{product.productName}, '%')
|
|
|
</if>
|
|
|
<if test="product.maxSortId != null and product.maxSortId > 0">
|
|
|
and p.max_sort_id = #{product.maxSortId}
|
|
|
</if>
|
|
|
<if test="product.midSortId != null and product.midSortId > 0">
|
|
|
and p.mid_sort_id = #{product.midSortId}
|
|
|
</if>
|
|
|
<if test="product.brandId != null and product.brandId > 0">
|
|
|
and p.brand_id = #{product.brandId}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
|
|
|
<select id="selectProductStockNotZeroList" resultMap="BaseResultMap">
|
|
|
select p.id, p.brand_id, p.product_name, p.max_sort_id, p.mid_sort_id
|
|
|
from product p
|
|
|
where 1 = 1
|
|
|
and p.id in (
|
|
|
select distinct product_id
|
|
|
from storage_price s
|
|
|
where 1 = 1
|
|
|
and s.status = #{status}
|
|
|
and s.seller_uid in
|
|
|
<foreach item="sellerItem" index="index" collection="sellerList" open="(" separator="," close=")">
|
|
|
#{sellerItem}
|
|
|
</foreach>
|
|
|
<if test="product.storageId != null and product.storageId > 0">
|
|
|
and s.storage_id = #{product.storageId}
|
|
|
</if>
|
|
|
<if test="product.skup != null and product.skup > 0">
|
|
|
and s.skup = #{product.skup}
|
|
|
</if>
|
|
|
)
|
|
|
<if test="product.id != null and product.id > 0">
|
|
|
and p.id = #{product.id}
|
|
|
</if>
|
|
|
<if test="product.productName != null and product.productName != '' ">
|
|
|
and p.product_name like concat('%', #{product.productName}, '%')
|
|
|
</if>
|
|
|
<if test="product.maxSortId != null and product.maxSortId > 0">
|
|
|
and p.max_sort_id = #{product.maxSortId}
|
|
|
</if>
|
|
|
<if test="product.midSortId != null and product.midSortId > 0">
|
|
|
and p.mid_sort_id = #{product.midSortId}
|
|
|
</if>
|
|
|
<if test="product.brandId != null and product.brandId > 0">
|
|
|
and p.brand_id = #{product.brandId}
|
|
|
</if>
|
|
|
limit #{start}, #{rows}
|
|
|
</select>
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|