<?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.pcloud.book.weixinclock.dao.impl.WeixinClockShareWordDaoImpl" >
    <resultMap id="BaseResultMap" type="com.pcloud.book.weixinclock.entity.WeixinClockShareWord">
        <id column="id" property="id" jdbcType="BIGINT" />
        <result column="share_word" property="shareWord" jdbcType="VARCHAR" />
    </resultMap>

    <sql id="Base_Column_List" >
        id, share_word
    </sql>
    
    <select id="getRoundWord" resultType="string">
        SELECT share_word
        FROM weixin_clock_share_word AS t1 JOIN (
          SELECT ROUND(RAND() * ((SELECT MAX(id) FROM weixin_clock_share_word)-(SELECT MIN(id) FROM weixin_clock_share_word))+(SELECT MIN(id) FROM weixin_clock_share_word)) AS id) AS t2
        WHERE t1.id >= t2.id
        ORDER BY t1.id LIMIT 1;
    </select>
</mapper>