<?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.thinkgem.jeesite.modules.homepage.dao.NoticeDao">

    <select id="getNotice" resultType="com.thinkgem.jeesite.modules.homepage.entity.NoticeEntity" parameterType="com.thinkgem.jeesite.modules.homepage.bean.NoticeRequest">
        SELECT
            a.id,
            a.title,
            a.image,
            a.keywords,
            a.description,
            a.weight,
            a.hits,
            a.is_flow,
            a.is_tip,
            a.create_by,
            a.create_date,
            a.update_by,
            a.update_date,
            b.content
        FROM
            cms_article a
        LEFT JOIN cms_article_data b ON a.id = b.id
        WHERE
        <if test='noticeType=="F"'>
            a.is_flow = 'Y'
        </if>
        <if test='noticeType=="T"'>
            a.is_tip = 'Y'
        </if>
        <if test='noticeType!="T" and noticeType!="F"'>
            1=2
        </if>
        ORDER BY
            a.weight DESC
    </select>
</mapper>