<?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.applet.dao.impl.AppletGroupStatementDaoImpl">

    <resultMap type="com.pcloud.book.applet.entity.AppletGroupStatement" id="AppletGroupStatementMap">
        <result property="id" column="id" jdbcType="INTEGER"/>
        <result property="statement" column="statement" jdbcType="VARCHAR"/>
        <result property="type" column="type" jdbcType="INTEGER"/>
        <result property="duration" column="duration" jdbcType="DECIMAL"/>
    </resultMap>

    <select id="getAll" resultMap="AppletGroupStatementMap">
        select
          id, statement,type,duration
        from book.applet_group_statement
    </select>

    <select id="getRandom" parameterType="integer" resultMap="AppletGroupStatementMap">
        SELECT id, statement,type, duration
        FROM book.applet_group_statement
        ORDER BY  RAND()
        LIMIT #{count}
    </select>


</mapper>