forest/src/main/java/mapper/TopicMapper.xml

39 lines
2.2 KiB
XML
Raw Normal View History

<?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.rymcu.vertical.mapper.TopicMapper">
<resultMap id="BaseResultMap" type="com.rymcu.vertical.entity.Topic">
<!--
WARNING - @mbg.generated
-->
<id column="id" property="idTopic"/>
<id column="topic_title" property="topicTitle"/>
<id column="topic_uri" property="topicUri"/>
<id column="topic_description" property="topicDescription"/>
<id column="topic_type" property="topicType"/>
<id column="topic_sort" property="topicSort"/>
<id column="topic_icon_path" property="topicIconPath"/>
<id column="topic_nva" property="topicNva"/>
<id column="topic_tag_count" property="topicTagCount"/>
<id column="topic_status" property="topicStatus"/>
<id column="created_time" property="createdTime"/>
<id column="updated_time" property="updatedTime"/>
</resultMap>
2019-12-03 17:38:34 +08:00
<resultMap id="DTOResultMap" type="com.rymcu.vertical.dto.admin.TopicDTO">
<id column="id" property="idTopic"/>
<id column="topic_title" property="topicTitle"/>
<id column="topic_uri" property="topicUri"/>
<id column="topic_description" property="topicDescription"/>
<id column="topic_icon_path" property="topicIconPath"/>
<id column="topic_tag_count" property="topicTagCount"/>
<id column="topic_status" property="topicStatus"/>
</resultMap>
<select id="selectTopicNav" resultMap="BaseResultMap">
select id,topic_title,topic_uri,topic_icon_path from vertical_topic where topic_nva = 0 and topic_status = 0 order by topic_sort
</select>
2019-12-03 17:38:34 +08:00
<select id="selectTopicByTopicUri" resultMap="DTOResultMap">
select id,topic_title,topic_uri,topic_icon_path,topic_description,topic_tag_count,topic_status from vertical_topic where topic_uri = #{topicUri}
</select>
<select id="selectTopicTag" resultType="com.rymcu.vertical.dto.admin.TagDTO">
select * from vertical_tag vt left join vertical_topic_tag vtt on vt.id = vtt.id_tag where vtt.id_topic = #{idTopic}
</select>
</mapper>