liusheng
5 天以前 cc479e6a056785103996cc7ea67dbd5faa3e800e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?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.ruoyi.inhospvisit.mapper.VisitArchiveMapper">
 
    <!--
      ============================================================================
      出入院随访模块自带的 pat_archive 只读查询。
      ============================================================================
      与 smartor 的 mapper/smartor/PatArchiveMapper.xml 的 selectPatArchiveByPatid 等价。
      原实现(PatArchiveMapper.xml:272-275):
          <include refid="selectPatArchiveVo"/>
          where id = #{id} and del_flag=0
 
      ⚠️ 必须保留的原语义(写错会直接改变分支走向):
         · where 条件是 id = ? 【and del_flag = 0】—— 已删除的档案会被判为"查不到",
           从而走 {"患者基本信息为空"} 分支。早期草稿曾以为没有 del_flag 过滤,已修正。
 
      ⚠️ 与原实现的【唯一差异】:只 SELECT 随访侧真正读到的列(原实现是整份列清单,70+ 列)。
         随访组装对 PatArchive 的 getter 访问集合恰好是这 9 个:
             age id idcardno name notrequiredFlag notrequiredreason relativetelcode sex telcode
         这里多带 createTime 仅用于排查,不影响任何分支。
      ============================================================================
    -->
 
    <resultMap type="com.ruoyi.common.core.service.dto.VisitArchiveRow" id="VisitArchiveRowResult">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="idcardno" column="idcardno"/>
        <result property="telcode" column="telcode"/>
        <result property="relativetelcode" column="relativetelcode"/>
        <result property="sex" column="sex"/>
        <result property="age" column="age"/>
        <result property="birthdate" column="birthdate"/>
        <result property="notrequiredFlag" column="notrequired_flag"/>
        <result property="notrequiredreason" column="notrequiredreason"/>
        <result property="createTime" column="create_time"/>
    </resultMap>
 
    <select id="selectByPatid" parameterType="Long" resultMap="VisitArchiveRowResult">
        select id,
               name,
               idcardno,
               telcode,
               relativetelcode,
               sex,
               age,
               birthdate,
               notrequired_flag,
               notrequiredreason,
               create_time
        from pat_archive
        where id = #{patid} and del_flag = 0
    </select>
 
</mapper>