<?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.ydzyy.mapper.YdZyyPacsViewMapper">


    <select id="pacsViews" resultType="com.docus.server.ydzyy.entity.YdZyyPacsView">
        select
            REMARK,
            REGISTER_NUM,
            NP_NO,
            ACCNO,
            CREATETIMESTR,
            REPORTDOC,
            REPORTNAME,
            NAME,
            ADUITTIME,
            FILEPATH,
            STATUSCHGTIME,
            SENDDATE,
            IDCARD
        from dbo.View_Paperless
        where (ADUITTIME is not null and ADUITTIME != '')
        <if test="condition.changeTimeStart != null and condition.changeTimeStart != ''">
            and STATUSCHGTIME >= #{condition.changeTimeStart}
        </if>
        <if test="condition.changeTimeEnd != null and condition.changeTimeEnd != ''">
            and STATUSCHGTIME <![CDATA[<=]]> #{condition.changeTimeEnd}
        </if>
        <if test="condition.sendDateStart != null and condition.sendDateStart != ''">
            and SENDDATE >= #{condition.sendDateStart}
        </if>
        <if test="condition.sendDateEnd != null and condition.sendDateEnd != ''">
            and SENDDATE <![CDATA[<=]]> #{condition.sendDateEnd}
        </if>
        <if test="condition.inpNo != null and condition.inpNo != ''">
            and NP_NO = #{condition.inpNo}
        </if>
        <if test="condition.idCard != null and condition.idCard != ''">
            and IDCARD = #{condition.idCard}
        </if>
        <if test="condition.remark != null and condition.remark != ''">
            and REMARK=#{condition.remark}
        </if>
        order by CREATETIMESTR asc
    </select>
</mapper>
