38 lines
1.4 KiB
XML
38 lines
1.4 KiB
XML
<?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.suisung.mall.shop.chain.mapper.ShopChainItemMapper">
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<sql id="Base_Column_List">
|
|
chain_item_id, chain_id, store_id, item_id, product_id, chain_item_quantity, chain_item_unit_price
|
|
</sql>
|
|
|
|
<select id="getChainProductList" resultType="java.util.Map">
|
|
SELECT
|
|
spi.item_id,
|
|
spb.product_image,
|
|
spb.product_name,
|
|
spb.product_id,
|
|
spi.item_spec,
|
|
spi.item_unit_price
|
|
FROM
|
|
shop_product_item spi
|
|
LEFT JOIN shop_product_base spb ON spi.product_id = spb.product_id
|
|
LEFT JOIN shop_product_assist_index spai ON spi.product_id = spai.product_id
|
|
LEFT JOIN shop_product_index spin ON spi.product_id = spin.product_id
|
|
<where>
|
|
<if test="params.kind_id!=null and params.kind_id!=0">
|
|
and spin.kind_id = #{params.kind_id}
|
|
</if>
|
|
|
|
<if test="params.store_id!=null and params.store_id!=0">
|
|
and spb.store_id = #{params.store_id}
|
|
</if>
|
|
<if test="params.product_id!=null and params.product_id!=0">
|
|
and spi.product_id = #{params.product_id}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
</mapper>
|