<?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="TdtgFaqInfoMapper" >
  <resultMap id="BaseResultMap" type="com.wechat.model.dbEntity.TdtgFaqInfo" >
    <id column="FAQ_ID" property="faqId" jdbcType="INTEGER" />
    <result column="TITLE" property="title" jdbcType="VARCHAR" />
    <result column="KEYWORD" property="keyword" jdbcType="VARCHAR" />
    <result column="MSG_TYPE" property="msgType" jdbcType="INTEGER" />
    <result column="NEWS_DESC" property="newsDesc" jdbcType="VARCHAR" />
    <result column="NEWS_PICURL" property="newsPicurl" jdbcType="VARCHAR" />
    <result column="NEWS_URL" property="newsUrl" jdbcType="VARCHAR" />
    <result column="VERSION_NO" property="versionNo" jdbcType="INTEGER" />
    <result column="DESCRIPTION" property="description" jdbcType="VARCHAR" />
    <result column="DEL_FLG" property="delFlg" jdbcType="INTEGER" />
    <result column="CREATOR" property="creator" jdbcType="VARCHAR" />
    <result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP" />
    <result column="LAST_MODIFIER" property="lastModifier" jdbcType="VARCHAR" />
    <result column="LAST_MODIFY_TIME" property="lastModifyTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="com.wechat.model.dbEntity.TdtgFaqInfo" extends="BaseResultMap" >
    <result column="CONTENT" property="content" jdbcType="LONGVARCHAR" />
    <result column="NEWS_CONTENT" property="newsContent" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    FAQ_ID, TITLE, KEYWORD, MSG_TYPE, NEWS_DESC, NEWS_PICURL, NEWS_URL, VERSION_NO, DESCRIPTION, 
    DEL_FLG, CREATOR, CREATE_TIME, LAST_MODIFIER, LAST_MODIFY_TIME
  </sql>
  <sql id="Blob_Column_List" >
    CONTENT, NEWS_CONTENT
  </sql>
  <select id="selectFaqList" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from T_TDTG_FAQ_INFO
    where KEYWORD = #{keyWord}
      and DEL_FLG = 0
  </select>
  
  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from T_TDTG_FAQ_INFO
    where faq_id = #{id}
      and DEL_FLG = 0
  </select>
 
</mapper>