优化缺陷列表

master
zengwh 3 years ago
parent 57f1a69948
commit a63802fb78

@ -137,20 +137,23 @@
</if>
</select>
<select id="selByCol" parameterType="com.emr.entity.Archive_Master_Following" resultMap="BaseResultMap">
select id,master_id ,convert(varchar,handle_time,120) handle_time ,handle_id,handle_name,following_type,RowNum remark from (
select ROW_NUMBER() over(partition by master_id order by handle_time asc) RowNum
,Archive_Master_Following.*
from Archive_Master_Following
<where> 1=1
SELECT
id,
master_id,
CONVERT ( VARCHAR, handle_time, 120 ) handle_time,
handle_id,
handle_name,
following_type,
COUNT(id) remark
FROM
Archive_Master_Following
<where> 1=1
<if test="followingType!= null and followingType!= ''">
and following_type in
<foreach item="item" collection="followingType.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
) as t1
<where> 1=1
<if test="masterId != null and masterId != ''">
and master_id = #{masterId,jdbcType=NVARCHAR}
</if>
@ -163,6 +166,13 @@
<if test="handleName != null and handleName != ''">
and CONVERT(VARCHAR(20),handle_name,23) = #{handleName,jdbcType=NVARCHAR}
</if>
GROUP BY
id,
master_id,
handle_time,
handle_id,
handle_name,
following_type
order by handle_time
</where>
</select>

@ -69,7 +69,7 @@
from (
select
DISTINCT m.id,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time, s.pid,s.createdtime, s.otherInfo, s.masterID, s.detailID, s.dTime,s.sysFlag, s.C1, s.C2, s.C3, s.C4, s.C5, s.N1, s.N2, s.N3, s.T1,
s.T2,s.T3,s.IsFullText,m.inp_no,m.visit_id,m.name,CONVERT(varchar(10),m.admission_date_time, 120) admissionDateTime,m.dept_name, m.isscaned,m.dept_admission_to,(select COUNT(*) from archive_other where archive_other.pid=s.pid)as num
s.T2,s.T3,s.IsFullText,m.inp_no,m.visit_id,m.name,CONVERT(varchar(10),m.admission_date_time, 120) admissionDateTime,m.dept_name, m.isscaned,m.dept_admission_to,(select COUNT(1) from archive_other where archive_other.masterID=s.masterID and archive_other.sysFlag = 1)as num
from archive_other s
left join archive_master m
on s.masterID=m.id
@ -114,7 +114,7 @@
<if test="inpNo != null and inpNo != ''"> and m.inp_no = #{inpNo}</if>
<if test="visitId != null and visitId != ''"> and m.visit_id = #{visitId}</if>
<if test="name != null and name != ''"> and m.name like '%'+#{name}+'%'</if>
and s.sysFlag ='1'
and s.sysFlag =1
)s
LEFT JOIN emr_dictionary d
on s.dept_admission_to=d.code

Loading…
Cancel
Save