<?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.taais.biz.mapper.DataMapper">

    <select id="getIds" resultType="java.lang.Long">
        SELECT nextval('public.data_id_seq') AS sequence_value
        FROM
            generate_series(1, #{size})
    </select>

    <select id="getBatchData" resultType="com.taais.biz.domain.vo.BatchDataResult">
        select batch_num, count(1) as batch_size
        from public.data
        group by batch_num
        order by batch_num
    </select>

    <select id="getFormSelects" resultType="com.taais.biz.domain.vo.DataSelectVo">
        select ${field} as label, ${field} as value from data GROUP BY ${field}
    </select>

</mapper>
