<?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.orangesale.cn.mapper.MessageMapper">

    <insert id="insertMessage" parameterType="com.orangesale.cn.entity.OrangeMessage">
        insert into orange_message(content) values (#{content})
    </insert>

    <update id="updateMessage">
        update orange_message set used='YES'
    </update>
    <select id="getMessage" resultType="com.orangesale.cn.entity.OrangeMessage">
        select content from orange_message where used='NO'
    </select>
</mapper>