64 lines
4.0 KiB
XML
64 lines
4.0 KiB
XML
<?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.czlis.interfaceCommon.mapper.LabReportvsitemMapper">
|
|
<resultMap type="com.czlis.common.core.domain.entity.lis.ComReportInstr" id="ComReportInstrResult">
|
|
<id property="reportId" column="report_id" />
|
|
<result property="reportYq" column="report_yq" />
|
|
<result property="reportBgdh" column="report_bgdh" />
|
|
<result property="reportSize" column="report_size" />
|
|
<result property="reportType" column="report_type" />
|
|
<result property="reportRows" column="report_rows" />
|
|
<result property="reportMinrows" column="report_minrows" />
|
|
<result property="reportMaxrows" column="report_maxrows" />
|
|
<result property="reportItems" column="report_items" />
|
|
<result property="reportSort" column="report_sort" />
|
|
<result property="status" column="status" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="remark" column="remark" />
|
|
<result property="reportName" column="report_name" />
|
|
|
|
</resultMap>
|
|
<select id="getComReportInstrByInstr" parameterType="String" resultMap="ComReportInstrResult">
|
|
select * from com_report_instr where report_yq = #{reportYq}
|
|
</select>
|
|
<select id="getreportCode" resultType="String" parameterType="Long">
|
|
select report_code from com_report_dict where report_bgdh = #{reportBgdh}
|
|
</select>
|
|
<select id="getLabReportvsitem" resultType="com.czlis.common.core.domain.entity.lis.LabReportvsitem" parameterType="String">
|
|
select * from lab_reportvsitem where yq = #{yq}
|
|
</select>
|
|
<select id="getLabReportvsitemCount" resultType="int">
|
|
SELECT count(1) FROM lab_result, lab_reportvsitem
|
|
WHERE ( lab_result.yq = lab_reportvsitem.yq ) AND ( lab_result.xmdh = lab_reportvsitem.xmdh )
|
|
AND ( lab_result.jyrq =#{jyrq} ) AND ( lab_result.yq = #{yq}) AND ( lab_result.ybh = #{ybh} )
|
|
</select>
|
|
<select id="getLabReportCount" resultType="int">
|
|
SELECT sum(LEN(refs) - LEN(REPLACE(refs, '|', '')))+count(1) FROM lab_result,xm_info WHERE
|
|
xm_info.yq=lab_result.yq and xm_info.xmdh=lab_result.xmdh and xm_info.dylx !='3'
|
|
AND ( lab_result.jyrq =#{jyrq} ) AND ( lab_result.yq = #{yq}) AND ( lab_result.ybh = #{ybh} )
|
|
</select>
|
|
<select id="getLabReportCountwithitem" resultType="int">
|
|
SELECT count(1) FROM lab_result WHERE jyrq =#{jyrq} AND yq = #{yq} AND ybh = #{ybh}
|
|
and xmdh in
|
|
<foreach collection="items"
|
|
item="itemVal"
|
|
open="("
|
|
close=")"
|
|
separator=",">
|
|
#{itemVal}
|
|
</foreach>
|
|
</select>
|
|
<select id="getLabReport2" resultType="int">
|
|
select count(1) from (SELECT (sum(LEN(refs) - LEN(REPLACE(refs, '|', '')))+count(1)) as sl,count(lab_reportvsitem.xmdh) as bg2xms,count(com_rpt.bgdh) as slbgd
|
|
FROM lab_result join xm_info on xm_info.yq=lab_result.yq and xm_info.xmdh=lab_result.xmdh and xm_info.dylx !='3'
|
|
join lab_instr on lab_instr.yq=lab_result.yq
|
|
left join lab_reportvsitem on lab_result.yq = lab_reportvsitem.yq AND lab_result.xmdh = lab_reportvsitem.xmdh
|
|
left join com_rpt on dxmc=(select dxmc from com_rpt where bgdh=lab_instr.bgdh) and zdy=0 and com_rpt.bgdh in( 3,8,9,19,22,32,37,40,55,62)
|
|
WHERE lab_result.jyrq =#{jyrq} AND lab_result.yq = #{yq} AND lab_result.ybh = #{ybh} ) a join lab_instr on lab_instr.yq=#{yq}
|
|
where bg2xms>0 or (lab_instr.myhs1 is not null and lab_instr.myhs1>0 and sl>lab_instr.myhs*(case slbgd when 0 then 1 else 2 end))
|
|
</select>
|
|
</mapper> |