商品分类及属性接口修改

This commit is contained in:
zhh
2018-05-23 17:30:54 +08:00
parent 96fc15e003
commit 424cbe0df5
12 changed files with 190 additions and 12 deletions

View File

@@ -0,0 +1,15 @@
<?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.macro.mall.dao.PmsProductAttributeDao">
<select id="getProductAttrInfo" resultType="com.macro.mall.dto.ProductAttrInfo">
SELECT
pa.id attributeId,
pac.id attributeCategoryId
FROM
pms_product_category_attribute_relation pcar
LEFT JOIN pms_product_attribute pa ON pa.id = pcar.product_attribute_id
LEFT JOIN pms_product_attribute_category pac ON pa.product_attribute_category_id = pac.id
WHERE
pcar.product_category_id = #{id}
</select>
</mapper>

View File

@@ -0,0 +1,12 @@
<?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.macro.mall.dao.PmsProductCategoryAttributeRelationDao">
<!--批量新增回写主键支持-->
<insert id="insertList">
INSERT INTO pms_product_category_attribute_relation (product_category_id, product_attribute_id) VALUES
<foreach collection="list" separator="," item="item" index="index">
(#{item.productCategoryId,jdbcType=BIGINT},
#{item.productAttributeId,jdbcType=BIGINT})
</foreach>
</insert>
</mapper>