<?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.emr.dao.browseRecordsMapper">


    <select id="selectAll" resultType="com.emr.vo.browseRecords" parameterType="com.emr.vo.browseRecords">
      select * from browseRecords
      <where> 1=1
          <if test="patientId != null and patientId != ''">
           and  patient_id=#{patientId}
          </if>
          <if test="patientName != null and patientName != ''">
              AND patient_name=#{patientName}
          </if>
          <if test="browseName != null and browseName != ''">
              AND browse_name=#{browseName}
          </if>
          <if test="startTime1 != null and startTime1 != ''">
              AND browse_time > #{startTime1}
          </if>
          <if test="endTime1 != null and endTime1 != ''">
              AND browse_time &lt; #{endTime1}
          </if>
      </where>
    </select>
</mapper>