<?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.hotent.portal.persistence.dao.PortalWeixinMaterialDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hotent.portal.model.PortalWeixinMaterial">
        <id column="ID_" property="id" />
        <result column="appid" property="appid" />
        <result column="title" property="title" />
        <result column="author" property="author" />
        <result column="digest" property="digest" />
        <result column="content" property="content" />
        <result column="content_source_url" property="contentSourceUrl" />
        <result column="thumb_media_id" property="thumbMediaId" />
        <result column="show_cover_pic" property="showCoverPic" />
        <result column="url" property="url" />
        <result column="need_open_comment" property="needOpenComment" />
        <result column="thumb_url" property="thumbUrl" />
        <result column="only_fans_can_comment" property="onlyFansCanComment" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="pull_time" property="pullTime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ID_, appid, title, author, digest, content_source_url, thumb_media_id, show_cover_pic, url, need_open_comment, thumb_url, only_fans_can_comment, create_time, update_time, pull_time
    </sql>
    
    <select id="getByAppid"   parameterType="java.lang.String" resultMap="BaseResultMap">
		SELECT 
		<include refid="Base_Column_List" />
		FROM portal_weixin_material 
		WHERE 
		appid=#{appId}  ORDER BY create_time DESC
	</select>
	
	<delete id="delByAppid" parameterType="java.lang.String">
		DELETE FROM portal_weixin_material WHERE appid=#{appId}
	</delete>

</mapper>
