From 562a960261b75d70abd65aa10528f09aeece94e8 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 24 九月 2024 09:49:23 +0800
Subject: [PATCH] 代码提交
---
smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml | 155 ++++++++++++++++++++++++++++++++++++---------------
1 files changed, 109 insertions(+), 46 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
index 8e1b6fc..3813194 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
@@ -1,58 +1,93 @@
<?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">
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.smartor.mapper.PatMedOuthospMapper">
-
- <resultMap type="PatMedOuthosp" id="PatMedOuthospResult">
- <result property="id" column="id" />
- <result property="serialnum" column="serialnum" />
- <result property="patid" column="patid" />
- <result property="hospitalname" column="hospitalname" />
- <result property="hospitalcode" column="hospitalcode" />
- <result property="icd10code" column="icd10code" />
- <result property="diagname" column="diagname" />
- <result property="deptcode" column="deptcode" />
- <result property="deptname" column="deptname" />
- <result property="drcode" column="drcode" />
- <result property="drname" column="drname" />
- <result property="admitdate" column="admitdate" />
- <result property="orgid" column="orgid" />
- <result property="delFlag" column="del_flag" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="isupload" column="isupload" />
- <result property="uploadTime" column="upload_time" />
- <result property="schemestatus" column="schemestatus" />
- <result property="deptid" column="deptid" />
- <result property="schemetime" column="schemetime" />
- <result property="hpi" column="hpi" />
- <result property="mainsuit" column="mainsuit" />
+
+ <resultMap type="com.smartor.domain.PatMedOuthosp" id="PatMedOuthospResult">
+ <result property="id" column="id"/>
+ <result property="serialnum" column="serialnum"/>
+ <result property="patid" column="patid"/>
+ <result property="hospitalname" column="hospitalname"/>
+ <result property="hospitalcode" column="hospitalcode"/>
+ <result property="icd10code" column="icd10code"/>
+ <result property="diagname" column="diagname"/>
+ <result property="deptcode" column="deptcode"/>
+ <result property="deptname" column="deptname"/>
+ <result property="drcode" column="drcode"/>
+ <result property="drname" column="drname"/>
+ <result property="admitdate" column="admitdate"/>
+ <result property="orgid" column="orgid"/>
+ <result property="delFlag" column="del_flag"/>
+ <result property="updateBy" column="update_by"/>
+ <result property="updateTime" column="update_time"/>
+ <result property="createBy" column="create_by"/>
+ <result property="createTime" column="create_time"/>
+ <result property="isupload" column="isupload"/>
+ <result property="uploadTime" column="upload_time"/>
+ <result property="schemestatus" column="schemestatus"/>
+ <result property="deptid" column="deptid"/>
+ <result property="schemetime" column="schemetime"/>
+ <result property="hpi" column="hpi"/>
+ <result property="mainsuit" column="mainsuit"/>
+ <result property="outhospno" column="outhospno"/>
+ <result property="patname" column="patname"/>
</resultMap>
<sql id="selectPatMedOuthospVo">
- select id, serialnum, patid, hospitalname, hospitalcode, icd10code, diagname, deptcode, deptname, drcode, drname, admitdate, orgid, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, schemestatus, deptid, schemetime, hpi, mainsuit from pat_med_outhosp
+ select id,
+ outhospno,
+ serialnum,
+ patid,
+ hospitalname,
+ hospitalcode,
+ icd10code,
+ diagname,
+ deptcode,
+ deptname,
+ drcode,
+ drname,
+ admitdate,
+ orgid,
+ del_flag,
+ update_by,
+ update_time,
+ create_by,
+ create_time,
+ isupload,
+ upload_time,
+ schemestatus,
+ deptid,
+ schemetime,
+ hpi,
+ patname,
+ mainsuit
+ from pat_med_outhosp
</sql>
- <select id="selectPatMedOuthospList" parameterType="PatMedOuthosp" resultMap="PatMedOuthospResult">
+ <select id="selectPatMedOuthospList" parameterType="com.smartor.domain.PatMedOuthosp"
+ resultMap="PatMedOuthospResult">
<include refid="selectPatMedOuthospVo"/>
- <where>
- <if test="hospitalname != null and hospitalname != ''"> and hospitalname like concat('%', #{hospitalname}, '%')</if>
- <if test="deptname != null and deptname != ''"> and deptname like concat('%', #{deptname}, '%')</if>
- <if test="drname != null and drname != ''"> and drname like concat('%', #{drname}, '%')</if>
- <if test="admitdate != null "> and admitdate = #{admitdate}</if>
- <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
+ <where>
+ <if test="hospitalname != null and hospitalname != ''">and hospitalname like concat('%', #{hospitalname},
+ '%')
+ </if>
+ <if test="deptname != null and deptname != ''">and deptname like concat('%', #{deptname}, '%')</if>
+ <if test="drname != null and drname != ''">and drname like concat('%', #{drname}, '%')</if>
+ <if test="admitdate != null ">and admitdate = #{admitdate}</if>
+ <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if>
+ <if test="outhospno != null and outhospno != ''">and outhospno = #{outhospno}</if>
</where>
+ order by update_time desc
</select>
-
+
<select id="selectPatMedOuthospById" parameterType="Long" resultMap="PatMedOuthospResult">
<include refid="selectPatMedOuthospVo"/>
where id = #{id}
</select>
-
- <insert id="insertPatMedOuthosp" parameterType="PatMedOuthosp" useGeneratedKeys="true" keyProperty="id">
+
+ <insert id="insertPatMedOuthosp" parameterType="com.smartor.domain.PatMedOuthosp" useGeneratedKeys="true"
+ keyProperty="id">
insert into pat_med_outhosp
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="serialnum != null">serialnum,</if>
@@ -79,7 +114,9 @@
<if test="schemetime != null">schemetime,</if>
<if test="hpi != null">hpi,</if>
<if test="mainsuit != null">mainsuit,</if>
- </trim>
+ <if test="outhospno != null">outhospno,</if>
+ <if test="patname != null">patname,</if>
+ </trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="serialnum != null">#{serialnum},</if>
<if test="patid != null">#{patid},</if>
@@ -105,10 +142,12 @@
<if test="schemetime != null">#{schemetime},</if>
<if test="hpi != null">#{hpi},</if>
<if test="mainsuit != null">#{mainsuit},</if>
- </trim>
+ <if test="outhospno != null">#{outhospno},</if>
+ <if test="patname != null">#{patname},</if>
+ </trim>
</insert>
- <update id="updatePatMedOuthosp" parameterType="PatMedOuthosp">
+ <update id="updatePatMedOuthosp" parameterType="com.smartor.domain.PatMedOuthosp">
update pat_med_outhosp
<trim prefix="SET" suffixOverrides=",">
<if test="serialnum != null">serialnum = #{serialnum},</if>
@@ -135,18 +174,42 @@
<if test="schemetime != null">schemetime = #{schemetime},</if>
<if test="hpi != null">hpi = #{hpi},</if>
<if test="mainsuit != null">mainsuit = #{mainsuit},</if>
+ <if test="outhospno != null">outhospno = #{outhospno},</if>
+ <if test="patname != null">patname = #{patname},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePatMedOuthospById" parameterType="Long">
- delete from pat_med_outhosp where id = #{id}
+ delete
+ from pat_med_outhosp
+ where id = #{id}
</delete>
<delete id="deletePatMedOuthospByIds" parameterType="String">
- delete from pat_med_outhosp where id in
+ delete from pat_med_outhosp where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
-</mapper>
\ No newline at end of file
+
+ <select id="selectPatMedOuthospCount" parameterType="com.smartor.domain.PatMedReq"
+ resultType="com.smartor.domain.PatMedRes">
+ SELECT
+ COUNT(id) AS rc,
+ COUNT(DISTINCT patid) AS rs
+ FROM
+ pat_med_outhosp
+ <where>
+ del_flag=0
+ and date_format(admitdate,'%y%m%d') >= date_format(#{startDate},'%y%m%d')
+ and date_format(admitdate,'%y%m%d') <= date_format(#{endDate},'%y%m%d')
+ <if test="deptcodeList != null">
+ and deptcode in
+ <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
+ #{deptcode}
+ </foreach>
+ </if>
+ </where>
+ </select>
+</mapper>
--
Gitblit v1.9.3