| | |
| | | <result property="carePerson" column="care_person"/> |
| | | <result property="casePersonAge" column="case_person_age"/> |
| | | <result property="reservedPhone" column="reserved_phone"/> |
| | | <result property="patientOverview" column="patient_overview"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/> |
| | | <result property="admitdate" column="admitdate"/> |
| | | <result property="reservedPhone" column="reserved_phone"/> |
| | | <result property="patientOverview" column="patient_overview"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectPatArchiveVo"> |
| | | select id, |
| | | notrequired_flag, |
| | | notrequiredreason, |
| | | patientOverview, |
| | | patientno, |
| | | patid_his, |
| | | age_unit, |
| | |
| | | <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> |
| | | <if test="idcardno != null and idcardno != ''">and idcardno = #{idcardno}</if> |
| | | <if test="sourcefrom != null ">and sourcefrom = #{sourcefrom}</if> |
| | | <if test="patientOverview != null ">and patient_overview = #{patientOverview}</if> |
| | | <if test="telcode != null and telcode != ''">and telcode = #{telcode}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | <if test="id != null and id != ''">and id = #{id}</if> |
| | |
| | | select |
| | | a.id, |
| | | a.age_unit, |
| | | a.patient_overview, |
| | | a.notrequired_flag, |
| | | a.notrequiredreason, |
| | | a.patientno, |
| | |
| | | <if test="carePerson != null ">care_person,</if> |
| | | <if test="casePersonAge != null ">case_person_age,</if> |
| | | <if test="reservedPhone != null ">reserved_phone,</if> |
| | | <if test="patientOverview != null ">patient_overview,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="patientno != null">#{patientno},</if> |
| | |
| | | <if test="carePerson != null ">#{carePerson},</if> |
| | | <if test="casePersonAge != null ">#{casePersonAge},</if> |
| | | <if test="reservedPhone != null ">#{reservedPhone},</if> |
| | | <if test="patientOverview != null ">#{patientOverview},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | insert into |
| | | pat_archive(name,viptype,sex,idcardno,birthdate,place_of_residence,age,age2,sourcefrom,archivetime,archiveby,telcode,relativetelcode,idcardtype,orgid,openid,dduserid,update_by,update_time |
| | | ,create_by,create_time,isupload,upload_time,pattype,nation,birthplace,native_place,patientno,patid_his,sd_flag,age_unit,age_unit2,notrequired_flag,notrequiredreason,care_facilities,case_path, |
| | | degree_of_education,marital_status,income,medicare_type,care_person,case_person_age,reserved_phone) |
| | | degree_of_education,marital_status,income,medicare_type,care_person,case_person_age,reserved_phone,patient_overview) |
| | | values |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | (#{item.name},#{item.viptype},#{item.sex},#{item.idcardno},#{item.birthdate},#{item.placeOfResidence},#{item.age},#{item.age2},#{item.sourcefrom},#{item.archivetime},#{item.archiveby} |
| | | ,#{item.telcode},#{item.archiveby},#{item.idcardtype},#{item.orgid},#{item.openid},#{item.dduserid},#{item.updateBy}, |
| | | #{item.updateTime},#{item.createBy},#{item.createTime},#{item.isupload},#{item.uploadTime},#{item.pattype},#{item.nation},#{item.birthplace},#{item.nativePlace},#{item.patientno}, |
| | | #{item.patidHis},#{item.sdFlag},#{item.ageUnit},#{item.ageUnit2},#{item.notrequiredFlag},#{item.notrequiredreason} |
| | | ,#{item.careFacilities},#{item.casePath},#{item.degreeOfEducation},#{item.maritalStatus},#{item.income},#{item.medicareType},#{item.carePerson},#{item.casePersonAge},#{item.reservedPhone}) |
| | | ,#{item.careFacilities},#{item.casePath},#{item.degreeOfEducation},#{item.maritalStatus},#{item.income},#{item.medicareType},#{item.carePerson},#{item.casePersonAge},#{item.reservedPhone},#{item.patientOverview}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | |
| | | <if test="carePerson != null ">care_person = #{carePerson},</if> |
| | | <if test="casePersonAge != null ">case_person_age = #{casePersonAge},</if> |
| | | <if test="reservedPhone != null ">reserved_phone = #{reservedPhone},</if> |
| | | <if test="patientOverview != null ">patient_overview = #{patientOverview},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | a.viptype, |
| | | a.pattype, |
| | | a.reserved_phone, |
| | | a.patient_overview, |
| | | COALESCE(( |
| | | SELECT string_agg(d.tagname, ', ') |
| | | FROM pat_archivetag d |
| | |
| | | a.reserved_phone, |
| | | a.upload_time, |
| | | a.pattype, |
| | | a.patient_overview, |
| | | d.bed_no, |
| | | d.starttime, |
| | | d.endtime, |
| | |
| | | a.create_time, |
| | | a.isupload, |
| | | a.upload_time, |
| | | a.patient_overview, |
| | | a.reserved_phone, |
| | | COALESCE(( |
| | | SELECT string_agg(dd.tagname, ', ') |
| | |
| | | a.notrequired_flag, |
| | | a.notrequiredreason, |
| | | a.patid_his, |
| | | a.patient_overview, |
| | | a.sd_flag, |
| | | a.patientno, |
| | | a.sex, |
| | |
| | | a.create_time, |
| | | a.isupload, |
| | | a.upload_time, |
| | | a.patient_overview, |
| | | a.pattype, |
| | | a.reserved_phone, |
| | | d.bed_no, |
| | |
| | | a.isupload, |
| | | a.reserved_phone, |
| | | a.upload_time, |
| | | a.patient_overview, |
| | | rt.tagname, |
| | | ROW_NUMBER() OVER (PARTITION BY a.idcardno ORDER BY a.update_time DESC) AS rn, |
| | | a.pattype |
| | |
| | | a.isupload, |
| | | a.upload_time, |
| | | a.reserved_phone, |
| | | a.patient_overview, |
| | | COALESCE(( |
| | | SELECT string_agg(dd.tagname, ', ') |
| | | FROM pat_archivetag dd |