商品接口完善

This commit is contained in:
zhh
2018-05-25 15:36:34 +08:00
parent 8e48c839ff
commit c9e591ca64
9 changed files with 186 additions and 19 deletions

View File

@@ -0,0 +1,18 @@
<?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.PmsProductCategoryDao">
<resultMap id="listWithChildrenMap" type="com.macro.mall.dto.PmsProductCategoryWithChildrenItem"
extends="com.macro.mall.mapper.PmsProductCategoryMapper.BaseResultMap">
<collection property="children" resultMap="com.macro.mall.mapper.PmsProductCategoryMapper.BaseResultMap"
columnPrefix="child_"></collection>
</resultMap>
<select id="listWithChildren" resultMap="listWithChildrenMap">
select
c1.id,
c1.name,
c2.id child_id,
c2.name child_name
from pms_product_category c1 left join pms_product_category c2 on c1.id = c2.parent_id
where c1.parent_id = 0
</select>
</mapper>