tingshu/service/service-album/target/classes/mapper/BaseAttributeMapper.xml

30 lines
1.1 KiB
XML
Raw Normal View History

2025-07-18 16:53:56 +08:00
<?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.atguigu.tingshu.album.mapper.BaseAttributeMapper">
<resultMap id="baseAttributeResultMap" type="com.atguigu.tingshu.model.album.BaseAttribute" autoMapping="true">
<id property="id" column="id"/>
<collection property="attributeValueList" ofType="com.atguigu.tingshu.model.album.BaseAttributeValue" autoMapping="true">
<id property="id" column="base_attribute_value_id"/>
</collection>
</resultMap>
<select id="findAttribute" resultMap="baseAttributeResultMap">
select ba.id,
ba.attribute_name,
bav.id base_attribute_value_id,
bav.attribute_id,
bav.value_name
from base_attribute ba
inner join base_attribute_value bav on bav.attribute_id = ba.id and bav.is_deleted = 0
where ba.category1_id = #{category1Id}
and ba.is_deleted = 0
</select>
</mapper>