<?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.hc.gpbusiness.mapper.WebNewsMapper">

    <resultMap type="com.hc.gpbusiness.model.WebNews" id="WebNewsMap">
        <result property="newsId" column="news_id" jdbcType="INTEGER"/>
        <result property="newsTitle" column="news_title" jdbcType="VARCHAR"/>
        <result property="newsLogo" column="news_logo" jdbcType="VARCHAR"/>
        <result property="newsContent" column="news_content" jdbcType="VARCHAR"/>
        <result property="newsUrl" column="news_url" jdbcType="VARCHAR"/>
        <result property="moduleId" column="module_id" jdbcType="INTEGER"/>
        <result property="typeId" column="type_id" jdbcType="INTEGER"/>
        <result property="flag" column="flag" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="BIGINT"/>
        <result property="updateTime" column="update_time" jdbcType="BIGINT"/>
    </resultMap>

    <sql id="Base_Column_List">
           news_id,
           news_title,
           news_logo,
           news_content,
           module_id,
           type_id,
           flag,
           create_time,
           update_time
        </sql>

    <select id="queryNewsByModuleId" resultMap="WebNewsMap">
       SELECT
           news_id,
           news_title,
           news_logo,
           news_content,
           news_url,
           module_id,
           type_id,
           flag,
           create_time,
           update_time
       FROM web_news
       WHERE module_id = #{moduleId} order by create_time desc
    </select>

</mapper>