123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <?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.diagbot.mapper.ArRechomeMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.diagbot.entity.ArRechome">
- <id column="BASYID" property="basyid" />
- <result column="BRBABH" property="brbabh" />
- <result column="YLFKLB" property="ylfklb" />
- <result column="BRBAXM" property="brbaxm" />
- <result column="BRBAXB" property="brbaxb" />
- <result column="BRCSRQ" property="brcsrq" />
- <result column="BRCSDZ" property="brcsdz" />
- <result column="BRDQNL" property="brdqnl" />
- <result column="BRNLDW" property="brnldw" />
- <result column="BRBAXX" property="brbaxx" />
- <result column="BRBARH" property="brbarh" />
- <result column="BRBAJG" property="brbajg" />
- <result column="BRBAMZ" property="brbamz" />
- <result column="BRHYZK" property="brhyzk" />
- <result column="BRBASF" property="brbasf" />
- <result column="BRSFZH" property="brsfzh" />
- <result column="BRBAGJ" property="brbagj" />
- <result column="HKDZQH" property="hkdzqh" />
- <result column="BRHKDZ" property="brhkdz" />
- <result column="HKDZYB" property="hkdzyb" />
- <result column="GZDWMC" property="gzdwmc" />
- <result column="GZDWDH" property="gzdwdh" />
- <result column="GZDWYB" property="gzdwyb" />
- <result column="LXDZQH" property="lxdzqh" />
- <result column="BRLXDZ" property="brlxdz" />
- <result column="BRLXDH" property="brlxdh" />
- <result column="LXDZYB" property="lxdzyb" />
- <result column="SFZFPB" property="sfzfpb" />
- <result column="BAZTPB" property="baztpb" />
- <result column="BALRRQ" property="balrrq" />
- <result column="LRRYID" property="lrryid" />
- <result column="XGYHDM" property="xgyhdm" />
- <result column="XGCZSJ" property="xgczsj" />
- <result column="BRJKKH" property="brjkkh" />
- <result column="BRBAZY" property="brbazy" />
- </resultMap>
- <!-- 住院记录列表 -->
- <select id="getBAZYList" parameterType="java.util.Map" resultType="com.diagbot.dto.BABLDTO">
- select
- t1.BRBAXM,t1.BASYID,t2.BRZYID
- from AR_RECHOME t1,BR_RECINHOS t2
- where t1.BASYID=t2.BASYID
- </select>
- <!-- 病案首页基础信息 -->
- <select id="getBABLDetail" parameterType="com.diagbot.vo.BABLVO" resultType="com.diagbot.dto.BABLDetailDTO">
- SELECT
- t1.BRBAXB,
- t1.BRBAXX,
- t1.BRBARH,
- t2.MJZZDMC,
- t2.ZYZYZDMC,
- t2.ZYQTZDMC
- FROM
- AR_RECHOME t1,
- (
- SELECT
- tt.BASYID,
- listAgg ( tt.MJZZDMC, ',' ) within GROUP ( ORDER BY tt.MJZZDMC ) AS MJZZDMC,
- listAgg ( tt.ZYZYZDMC, ',' ) within GROUP ( ORDER BY tt.ZYZYZDMC ) AS ZYZYZDMC,
- listAgg ( tt.ZYQTZDMC, ',' ) within GROUP ( ORDER BY tt.ZYQTZDMC ) AS ZYQTZDMC
- FROM
- (
- SELECT
- BASYID,
- ZDLBDM,
- ZCZDPB,
- CASE
- WHEN ZDLBDM = '1' THEN
- t.ZDJBMC
- END AS MJZZDMC,
- CASE
- WHEN ZDLBDM = '2'
- AND ZCZDPB = '1' THEN
- t.ZDJBMC
- END AS ZYZYZDMC,
- CASE
- WHEN ZDLBDM = '2'
- AND ZCZDPB = '2' THEN
- t.ZDJBMC
- END AS ZYQTZDMC
- FROM
- (
- SELECT
- BASYID,
- ZDLBDM,
- ZCZDPB,
- LISTAGG ( ZDJBMC, ',' ) within GROUP ( ORDER BY ZDJBMC ) ZDJBMC
- FROM
- BR_RECDIAGNOSE
- where 1=1
- <if test="basyid != null and basyid != ''">
- and BASYID=#{basyid}
- </if>
- GROUP BY
- BASYID,
- ZDLBDM,
- ZCZDPB
- ) t
- ) tt
- GROUP BY
- BASYID
- ) t2
- WHERE
- t1.BASYID = t2.BASYID
- <if test="basyid != null and basyid != ''">
- and t1.BASYID=#{basyid}
- </if>
- </select>
- </mapper>
|