<?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.bonus.sgzb.app.mapper.SysNoticeMapper">


    <select id="getList" resultType="com.bonus.sgzb.app.domain.SysNotice">
        select notice_id as noticeId,
               notice_title as noticeTitle,
               notice_type as noticeType,
               notice_content as noticeContent,
               status as status,
               create_by as createBy,
               create_time as createTime,
               update_by as updateBy,
               update_time as updateTime,
               remark as remark
        from sys_notice
        where status = '0'
        <if test="keyword != null  and keyword != ''">
         and notice_title like concat('%',#{keyword},'%')
        </if>
        order by create_time desc
    </select>
    <select id="getById" resultType="com.bonus.sgzb.app.domain.SysNotice">
        select notice_id as noticeId,
               notice_title as noticeTitle,
               notice_type as noticeType,
               notice_content as noticeContent,
               status as status,
               create_by as createBy,
               create_time as createTime,
               update_by as updateBy,
               update_time as updateTime,
               remark as remark
        from sys_notice
        where status = '0' and notice_id = #{noticeId}
    </select>
</mapper>
