|  |  | 
 |  |  |             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> | 
 |  |  |             <if test="viptype != null ">and viptype = #{viptype}</if> | 
 |  |  |             <if test="pattype != null ">and pattype = #{pattype}</if> | 
 |  |  |             <if test="patientno != null ">and patientno = CAST(#{patientno} AS INTEGER)</if> | 
 |  |  |             <if test="patientno != null ">and patientno = #{patientno}</if> | 
 |  |  |             <if test="patidHis != null ">and patid_his = #{patidHis}</if> | 
 |  |  |             <if test="sdFlag != null ">and sd_flag = #{sdFlag}</if> | 
 |  |  |             <if test="ageUnit != null ">and age_unit = #{ageUnit}</if> | 
 |  |  | 
 |  |  |         healthy_inhosp b | 
 |  |  |         <where> | 
 |  |  |  | 
 |  |  |             <if test="startOutHospTime != null ">and to_char(b.endtime,'YYMMDD') >= | 
 |  |  |                 to_char(#{startOutHospTime}::date,'YYMMDD') | 
 |  |  |             <if test="startOutHospTime != null "> | 
 |  |  |                 and to_char(b.endtime, 'YYYY-MM-DD HH24:MI:SS') >=to_char(#{startOutHospTime},'YYYY-MM-DD HH24:MI:SS') | 
 |  |  |             </if> | 
 |  |  |             <if test="endOutHospTime != null ">and to_char(b.endtime,'YYMMDD') <= | 
 |  |  |                 to_char(#{endOutHospTime}::date,'YYMMDD') | 
 |  |  |             <if test="endOutHospTime != null "> | 
 |  |  |                 and to_char(b.endtime, 'YYYY-MM-DD HH24:MI:SS') <= to_char(#{endOutHospTime},'YYYY-MM-DD HH24:MI:SS') | 
 |  |  |             </if> | 
 |  |  |             <if test="startInHospTime != null ">and to_char(b.starttime,'YYMMDD') >= | 
 |  |  |                 to_char(#{startInHospTime}::date,'%y%m%d') | 
 |  |  |             <if test="startInHospTime != null "> | 
 |  |  |                 and to_char(starttime, 'YYYY-MM-DD HH24:MI:SS') >= to_char(#{startInHospTime},'YYYY-MM-DD HH24:MI:SS') | 
 |  |  |             </if> | 
 |  |  |             <if test="endInHospTime != null ">and to_char(b.starttime,'YYMMDD') <= | 
 |  |  |                 to_char(#{endInHospTime}::date,'YYMMDD') | 
 |  |  |             <if test="endInHospTime != null "> | 
 |  |  |                 and to_char(starttime, 'YYYY-MM-DD HH24:MI:SS') <=to_char(#{endInHospTime},'YYYY-MM-DD HH24:MI:SS') | 
 |  |  |             </if> | 
 |  |  |             <if test="inhospno != null ">and b.inhospno = #{inhospno}</if> | 
 |  |  |             <if test="fuflag != null ">and b.fuflag = #{fuflag}</if> | 
 |  |  | 
 |  |  |         from healthy_outhosp | 
 |  |  |         <where> | 
 |  |  |  | 
 |  |  |             <if test="beginTime != null ">and to_char( admitdate,'YYMMDD') >= | 
 |  |  |                 to_char(#{beginTime}::date,'YYMMDD') | 
 |  |  |             <if test="beginTime != null "> | 
 |  |  |                 and to_char(admitdate, 'YYYY-MM-DD HH24:MI:SS') >= to_char(#{beginTime}, 'YYYY-MM-DD HH24:MI:SS') | 
 |  |  |             </if> | 
 |  |  |             <if test="endTime != null ">and to_char( admitdate,'YYMMDD') <= | 
 |  |  |                 to_char(#{endTime}::date,'YYMMDD') | 
 |  |  |             <if test="endTime != null "> | 
 |  |  |                 and to_char(admitdate, 'YYYY-MM-DD HH24:MI:SS') <= to_char(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') | 
 |  |  |             </if> | 
 |  |  |  | 
 |  |  |         </where> |