| | |
| | | <resultMap id="topicsResultMap" type="org.springblade.modules.discuss.entity.TopicsEntity"> |
| | | <result property="id" column="id" /> |
| | | <result property="discussContent" column="discuss_content" /> |
| | | <result property="option" column="option" /> |
| | | <result property="optionRange" column="option_range" /> |
| | | <result property="sort" column="sort" /> |
| | | <result property="optionContent" column="option_content" /> |
| | | <result property="optionDetail" column="option_detail" /> |
| | |
| | | <resultMap type="org.springblade.modules.discuss.dto.TopicsDTO" id="TopicsDTOResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="discussContent" column="discuss_content" /> |
| | | <result property="option" column="option" /> |
| | | <result property="optionRange" column="option_range" /> |
| | | <result property="sort" column="sort" /> |
| | | <result property="optionContent" column="option_content" /> |
| | | <result property="optionDetail" column="option_detail" /> |
| | |
| | | <result property="publicDiscussId" column="public_discuss_id" /> |
| | | <result property="parentId" column="parent_id" /> |
| | | <result property="level" column="level" /> |
| | | |
| | | <collection property="children" column="id" javaType="int" select="selectStlCount"> |
| | | <collection property="children" column="id" javaType="list" ofType="org.springblade.modules.discuss.dto.TopicsDTO" select="selectStlCount"> |
| | | </collection> |
| | | |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectStlCount" resultMap="TopicsDTOResult"> |
| | | <select id="selectStlCount" parameterType="int" resultType="org.springblade.modules.discuss.dto.TopicsDTO"> |
| | | <include refid="selectTopics"/> |
| | | where parent_id = #{id} |
| | | <where> |
| | | <if test="id != null "> parent_id = #{id}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | |
| | | select |
| | | id, |
| | | discuss_content, |
| | | option, |
| | | option_range, |
| | | sort, |
| | | option_content, |
| | | option_detail, |
| | |
| | | <where> |
| | | <if test="id != null "> and id = #{id}</if> |
| | | <if test="discussContent != null and discussContent != ''"> and discuss_content = #{discussContent}</if> |
| | | <if test="option != null "> and option = #{option}</if> |
| | | <if test="optionRange != null "> and option_range = #{optionRange}</if> |
| | | <if test="sort != null "> and sort = #{sort}</if> |
| | | <if test="optionContent != null and optionContent != ''"> and option_content = #{optionContent}</if> |
| | | <if test="optionDetail != null and optionDetail != ''"> and option_detail = #{optionDetail}</if> |
| | |
| | | <if test="updateTime != null "> and update_time = #{updateTime}</if> |
| | | <if test="deleteFlag != null "> and delete_flag = #{deleteFlag}</if> |
| | | <if test="publicDiscussId != null "> and public_discuss_id = #{publicDiscussId}</if> |
| | | <if test="parentId != null "> and parent_id = #{parentId}</if> |
| | | <if test="level != null "> and level = #{level}</if> |
| | | and delete_flag = 0 |
| | | </where> |
| | | </select> |
| | | |