商品接口修改

This commit is contained in:
zhh
2018-06-06 17:24:38 +08:00
parent a97a2fe7bc
commit 2b0372f46d
2 changed files with 8 additions and 49 deletions

View File

@@ -13,17 +13,14 @@
</collection>
<collection property="productAttributeValueList" columnPrefix="attribute_" resultMap="com.macro.mall.mapper.PmsProductAttributeValueMapper.BaseResultMap">
</collection>
<collection property="subjectList" column="{productId=id}" select="selectSubjectByProductId">
</collection>
<collection property="prefrenceAreaList" column="{productId=id}" select="selectPrefrenceAreaByProductId">
</collection>
<collection property="subjectProductRelationList" column="{productId=id}" select="selectSubjectProductRelationByProductId"/>
<collection property="prefrenceAreaProductRelationList" column="{productId=id}" select="selectPrefrenceAreaProductRelationByProductId"/>
</resultMap>
<select id="getUpdateInfo" resultMap="updateInfoMap">
SELECT *,
pc.parent_id cateParentId,
ac.name productAttributeCategoryName,
l.id ladder_id,l.product_id ladder_product_id,l.discount ladder_discount,l.count ladder_count,l.price ladder_price,
pf.id full_id,pf.product_id full_product_id,pf.full_price full_full_price,pf.reduce_price full_reduce_price,
m.id member_id,m.product_id member_product_id,m.member_level_id member_member_level_id,m.member_price member_member_price,m.member_level_name member_member_level_name,
@@ -31,7 +28,6 @@
a.id attribute_id,a.product_id attribute_product_id,a.product_attribute_id attribute_product_attribute_id,a.value attribute_value
FROM pms_product p
LEFT JOIN pms_product_category pc on pc.id = p.product_category_id
LEFT JOIN pms_product_attribute_category ac ON p.product_attribute_category_id= ac.id
LEFT JOIN pms_product_ladder l ON p.id = l.product_id
LEFT JOIN pms_product_full_reduction pf ON pf.product_id=p.id
LEFT JOIN pms_member_price m ON m.product_id = p.id
@@ -39,16 +35,11 @@
LEFT JOIN pms_product_attribute_value a ON a.product_id=p.id
WHERE p.id=#{id};
</select>
<select id="selectSubjectByProductId" resultMap="com.macro.mall.mapper.CmsSubjectMapper.BaseResultMap">
SELECT s.*
FROM cms_subject_product_relation spr
LEFT JOIN cms_subject s ON spr.subject_id = s.id
WHERE spr.product_id = #{productId}
<select id="selectSubjectProductRelationByProductId" resultMap="com.macro.mall.mapper.CmsSubjectProductRelationMapper.BaseResultMap">
select * from cms_subject_product_relation where product_id=#{productId}
</select>
<select id="selectPrefrenceAreaByProductId" resultMap="com.macro.mall.mapper.CmsPrefrenceAreaMapper.BaseResultMap">
SELECT p.*
FROM cms_prefrence_area_product_relation ppr
LEFT JOIN cms_prefrence_area p ON ppr.prefrence_area_id=p.id
WHERE ppr.product_id=#{productId}
<select id="selectPrefrenceAreaProductRelationByProductId" resultMap="com.macro.mall.mapper.CmsPrefrenceAreaProductRelationMapper.BaseResultMap">
select * from cms_prefrence_area_product_relation where product_id=#{productId}
</select>
</mapper>