<?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.nantian.cloud.jljc.mapper.TBbsTopicMapper">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.nantian.cloud.jljc.entity.TBbsTopic" id="tBbsTopicMap">
        <result property="id" column="id"/>
        <result property="userid" column="userid"/>
        <result property="sectionid" column="sectionid"/>
        <result property="title" column="title"/>
        <result property="content" column="content"/>
        <result property="updateTime" column="update_time"/>
        <result property="lastclickTime" column="lastclick_time"/>
        <result property="clickCount" column="click_count"/>
        <result property="replayCount" column="replay_count"/>
        <result property="delFlag" column="del_flag"/>
        <result property="state" column="state"/>
        <result column="dept_id" property="deptId"/>
    </resultMap>

    <sql id="Base_Column_List">
        id, userid, sectionid, title, content, update_time, lastclick_time, click_count, replay_count, del_flag, state
    </sql>

    <select id="getPage" resultType="com.nantian.cloud.jljc.entity.TBbsTopic">
        select <include refid="Base_Column_List"></include>
        from t_bbs_topic
        where del_flag = "1"
        <if test="query.title!=null and query.title!=''">
            and title like concat("%",#{query.title},"%")
        </if>
        <if test="query.content!=null and query.content!=''">
            and content like concat("%",#{query.content},"%")
        </if>
    </select>


</mapper>