<?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.younike.system.mapper.CateDimensionMapper">

    <!--根据分类id查询分类维度列表-->
    <select id="listByCategoryId" resultType="com.younike.system.domain.vo.CateDimensionVo">
        SELECT
        cd.id,
        cd.dimension_id,
        cd.category_id,
        d.name AS dimensionName
        FROM cate_dimension cd
        LEFT JOIN dimension d ON cd.dimension_id = d.dimension_id AND d.del_flag = '0'
        WHERE cd.del_flag = '0'
        AND cd.category_id = #{categoryId}
    </select>

    <select id="listScoreByCategoryId" resultType="com.younike.system.domain.vo.CateDimensionVo">
        SELECT
            cd.id,
            cd.dimension_id,
            cd.category_id,
            d.name AS dimensionName
        FROM cate_dimension cd
        LEFT JOIN dimension d ON cd.dimension_id = d.dimension_id AND d.del_flag = '0'
        LEFT JOIN
        WHERE cd.del_flag = '0'
        AND cd.category_id = #{categoryId}
    </select>

</mapper>