<?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.zyd.blog.persistence.mapper.SysNoticeMapper">
	<resultMap id="rm" type="com.zyd.blog.persistence.beans.SysNotice">
		<result property="id" jdbcType="BIGINT" column="id"/>
		<result property="userId" jdbcType="BIGINT" column="user_id"/>
		<result property="status" jdbcType="VARCHAR" column="status"/>
		<result property="title" jdbcType="VARCHAR" column="title"/>
		<result property="content" jdbcType="VARCHAR" column="content"/>
		<result property="createTime" jdbcType="TIMESTAMP" column="create_time"/>
		<result property="updateTime" jdbcType="TIMESTAMP" column="update_time"/>
	</resultMap>

	<select id="findPageBreakByCondition" parameterType="com.zyd.blog.business.vo.NoticeConditionVO" resultMap="rm">
		SELECT
			t.*
		FROM
			sys_notice t
		WHERE
			1 = 1
		<if test="status != null and status != ''">
			AND t.status = #{status}
		</if>
		ORDER BY
			t.create_time DESC
	</select>
</mapper>

