<?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.docus.server.bl.infrastructure.mapper.BlTBasicMapper">

    <select id="getTBasicListView" resultType="com.docus.server.record.common.pojo.dto.TBasicDTO">
        SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his_basic`
        WHERE  update_time between #{startDate}  and  #{endDate}
        order by update_time asc
        LIMIT #{offset}, #{pageSize}
    </select>


    <!--  mysql
    <select id="list" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
        SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his`.`his_dept`
        WHERE  update_time between #{startDate}  and  #{endDate}
        order by update_time asc
            LIMIT (#{pageNum}  - 1) *  #{pageSize} , #{pageSize}
    </select>
    -->


    <!--  mssqsql
    <select id="list" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
            select top pageSize `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name
            from (select row_number()
            over(order by sno asc) as rownumber,*
            from student) temp_row
            where rownumber>((pageNum-1)*pageSize);
    </select>
    -->

    <!--  oracle
    <select id="list" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
            SELECT * FROM
            (SELECT tt.*,ROWNUM AS RN FROM
            (SELECT t.* FROM ${tableName} t
            where 1=1
            ORDER BY t.createTime DESC,t.id ) tt
            WHERE tt.ROWNUM <= #{pageNum}*#{pageSize}
            ) rs
            WHERE rs.RN > #{pageNum-1}*#{pageSize}
    </select>
    -->


</mapper>
