feat:报告编制
This commit is contained in:
@@ -30,18 +30,31 @@
|
||||
d.CREATOR_NAME as creatorName,
|
||||
d.DELETED as deleted,
|
||||
s.CREATE_TIME as baseSampleCreateTime,
|
||||
s.SMP_NAME as sampleName
|
||||
s.SMP_NAME as sampleName,
|
||||
s.BSE_SMP_NAME as baseSampleName
|
||||
FROM T_BSN_ASY_RPT_DAT d
|
||||
inner join T_BSN_BSE_SMP s on d.BSN_BSE_SMP_ID = s.id
|
||||
<where>
|
||||
and d.CFG_RPT_TP_ID = #{param.configReportTypeId}
|
||||
and NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM T_RPT_DOC_DAT rd
|
||||
LEFT JOIN T_RPT_DOC_MAIN m on rd.MAIN_ID = m.ID
|
||||
WHERE rd.SRC_ID = d.id
|
||||
and m.RPT_DOC_TP = #{param.configReportTypeId}
|
||||
);
|
||||
<if test="param.configReportTypeId != null and param.configReportTypeId != ''">
|
||||
and d.CFG_RPT_TP_ID = #{param.configReportTypeId}
|
||||
and NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM T_RPT_DOC_DAT rd
|
||||
LEFT JOIN T_RPT_DOC_MAIN m on rd.MAIN_ID = m.ID
|
||||
WHERE rd.SRC_ID = d.id
|
||||
and m.RPT_DOC_TP = #{param.configReportTypeId}
|
||||
);
|
||||
</if>
|
||||
<if test="param.businessSampleEntrustRegistrationIdList != null and param.businessSampleEntrustRegistrationIdList.size > 0">
|
||||
d.BSN_BSE_SMP_ID in (
|
||||
select BSN_BSE_SMP_ID from T_BSN_SMP_ENTT_DTL d
|
||||
where d.BSN_SMP_ENTT_REG_ID in (
|
||||
<foreach item="item" collection="param.businessSampleEntrustRegistrationIdList" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<if test="param.sampleCode != null and param.sampleCode != ''">
|
||||
and d.SMP_CD like '%' || #{param.sampleCode} || '%'
|
||||
</if>
|
||||
|
||||
@@ -9,4 +9,78 @@
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
|
||||
<select id="queryWaitingDataForReport" resultType="com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO">
|
||||
-- SELECT d.*,
|
||||
select
|
||||
m.ID as id,
|
||||
m.ENTT_ID as entrustId,
|
||||
m.ENTT_NUM as entrustNumber,
|
||||
m.ENTT_UNT as entrustUnit,
|
||||
m.CFG_ENTT_SRC_ID as configEntrustSourceId,
|
||||
m.SMP_QTY as sampleQuantity,
|
||||
m.TSK_QTY as taskQuantity,
|
||||
m.TSK_FIND_QTY as taskFinishedQuantity,
|
||||
m.RMNE_SMP_REQM as remaineSampleRequirement,
|
||||
m.CRT_WY as createWay,
|
||||
m.ENTT_TP as entrustType,
|
||||
m.ENTT_TM as entrustTime,
|
||||
m.SMP_SNDR as sampleSender,
|
||||
m.SMP_SND_DT as sampleSendDate,
|
||||
m.SMP_RCVR as sampleReceiver,
|
||||
m.SMP_RCV_DT as sampleReceiveDate,
|
||||
m.SMP_STS as sampleStatus,
|
||||
m.EXT_INF_DAT_COLT_ID as externalInfomationDataCollectionId,
|
||||
m.EXT_INF as externalInfomation,
|
||||
m.CFG_RPT_TMPL_ID as configReportTemplateId,
|
||||
m.CFG_RPT_TMPL_KY as configReportTemplateKey,
|
||||
m.TEL as tel,
|
||||
m.FAX as fax,
|
||||
m.ADR as address,
|
||||
m.PSTL as postal,
|
||||
m.EM as email,
|
||||
m.ENTT_CTGR as entrustCategory,
|
||||
m.SMP_CTGR as sampleCategory,
|
||||
m.SMP_ORGN as sampleOrigin,
|
||||
m.SCRY_REQR as secrecyRequire,
|
||||
m.ASY_MTHD as assayMethod,
|
||||
m.REG_STS as registrationStatus,
|
||||
m.DAT_CHK_STS as dataCheckStatus,
|
||||
m.ASY_STS as assayStatus,
|
||||
m.DAT_STS as dataStatus,
|
||||
m.DOC_MAIN_ID as documentMainId,
|
||||
m.DOC_SND_WY as documentSendWay,
|
||||
m.DOC_PUBR as documentPublisher,
|
||||
m.DOC_PUBR_DT as documentPublisherDate,
|
||||
m.DOC_RCVR as documentReceiver,
|
||||
m.DOC_RCV_DT as documentReceiveDate,
|
||||
m.SYS_DEPT_CD as systemDepartmentCode,
|
||||
m.UPD_CNT as updateCount,
|
||||
m.RMK as remark,
|
||||
es.name as configEntrustSourceName
|
||||
FROM T_BSN_SMP_ENTT_REG m
|
||||
left join T_CFG_ENTT_SRC es on m.CFG_ENTT_SRC_ID = es.id
|
||||
<where>
|
||||
and NOT EXISTS (
|
||||
select 1 from T_RPT_DOC_MAIN dm left join T_RPT_DOC_MAIN_CORR dc on dm.id = dc.MAIN_ID
|
||||
where dc.CORR_ID = m.id and dm.deleted = 0
|
||||
)
|
||||
<if test="param.entrustType != null and param.entrustType != ''">
|
||||
and m.ENTT_TP = #{param.entrustType}
|
||||
</if>
|
||||
<if test="param.entrustTime != null and param.entrustTime.length > 0">
|
||||
and m.ENTT_TM between #{param.entrustTime[0]} and #{param.entrustTime[1]}
|
||||
</if>
|
||||
<if test="param.entrustNumber != null and param.entrustNumber != ''">
|
||||
and m.ENTT_NUM like concat('%',#{param.entrustNumber},'%')
|
||||
</if>
|
||||
<if test="param.entrustUnit != null and param.entrustUnit != ''">
|
||||
and m.ENTT_UNT like concat('%',#{param.entrustUnit},'%')
|
||||
</if>
|
||||
and m.deleted = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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.zt.plat.module.qms.business.reportdoc.dal.mapper.ReportDocumentMainCorrelationMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user