<?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.zjfsjhemr.mapper.ZjFsPatIndexViewMapper">


    <select id="listByCatalogDateRange" resultType="com.docus.server.zjfsjhemr.entity.ZjFsPatIndexView">
        select patient_id,
               inp_no,
               visit_id,
               admission_date_time,
               discharge_date_time,
               catalog_date,
               cataloger_id
        from jhemr.v_pat_index
        where catalog_date >= TO_DATE(#{startDate}, 'yyyy-mm-dd hh24:mi:ss')
          and catalog_date <![CDATA[<]]> TO_DATE(#{endDate}, 'yyyy-mm-dd hh24:mi:ss')
            ${where}
        order by catalog_date
    </select>
    <select id="maxCatalogDate" resultType="java.util.Date">
        select max(catalog_date) from jhemr.v_pat_index
    </select>
</mapper>
