feat:期间核查-创建计划

This commit is contained in:
FCL
2026-03-06 17:26:31 +08:00
parent 835b3cab83
commit eb99a9ed44
22 changed files with 373 additions and 137 deletions

View File

@@ -115,42 +115,4 @@
</where>
</select>
<select id="getListNeedByRule" resultType="com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfoWithBizConfigVO">
select
d.*,
r.id as rule_id,
r.business_domain,
r.need_flag,
r.sub_domain_type,
r.frequency_type,
r.frequency,
r.frequency_remark,
r.report_template_key,
r.form_component,
r.process_method,
r.process_user,
r.standard,
r.calibration_check_type
from T_DEV_INF d
left join T_DEV_PDT p on d.PDT_ID = p.ID
left join T_DEV_CFG_BSN_RUL r on p.ID = r.PDT_ID
<where>
and d.DELETED = 0
and p.DELETED = 0
and r.DELETED = 0
<if test="param.id != null and param.id != ''">
and d.ID = #{param.id}
</if>
<if test="param.deptCodeList!=null and param.deptCodeList.size>0">
and d.DEPT_ID in
<foreach collection="param.deptCodeList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
and r.BSN_DMN = #{param.businessType}
and r.REQR_FLG = 1
</where>
</select>
</mapper>

View File

@@ -9,4 +9,59 @@
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<resultMap id="periodCheckMap" type="com.zt.plat.module.qms.resource.device.dal.dataobject.DevicePeriodCheckDO">
<result property="id" column="ID"/>
<result property="planId" column="PLN_ID"/>
<result property="effectiveFlag" column="EFCT_FLG"/>
<result property="deviceId" column="DEV_ID"/>
<result property="checkPersonRemark" column="CHK_PSN_RMK"/>
<result property="checkPersonName" column="CHK_PSN_NAME"/>
<result property="checkPersonId" column="CHK_PSN_ID"/>
<result property="recheckPersonName" column="RCHK_PSN_NAME"/>
<result property="recheckPersonId" column="RCHK_PSN_ID"/>
<result property="checkAccording" column="CHK_ACRD"/>
<result property="checkAccordingRemark" column="CHK_ACRD_RMK"/>
<result property="checkContent" column="CHK_CNTT"/>
<result property="checkResult" column="CHK_RSLT"/>
<result property="checkRemark" column="CHK_RMK"/>
<result property="checkDate" column="CHK_DT"/>
<result property="lastCheckDate" column="LST_CHK_DT"/>
<result property="planCheckDateStart" column="PLN_CHK_DT_STRT"/>
<result property="planCheckDateEnd" column="PLN_CHK_DT_END"/>
<result property="frequencyRemark" column="FREQ_RMK"/>
<result property="flowStatus" column="FLW_STS"/>
<result property="flowInstanceId" column="FLW_INSC_ID"/>
<result property="systemDepartmentCode" column="SYS_DEPT_CD"/>
<result property="remark" column="RMK"/>
<result property="companyId" column="COMPANY_ID" />
<result property="companyName" column="COMPANY_NAME" />
<result property="deptId" column="DEPT_ID" />
<result property="deptName" column="DEPT_NAME" />
<result property="postId" column="POST_ID" />
<result property="creatorName" column="CREATOR_NAME" />
<result property="creator" column="CREATOR" />
<result property="updaterName" column="UPDATER_NAME" />
<result property="updater" column="UPDATER" />
<result property="tenantId" column="TENANT_ID" />
<result property="createTime" column="CREATE_TIME" />
<result property="updateTime" column="UPDATE_TIME" />
</resultMap>
<select id="getLastDataCheckList" resultMap="periodCheckMap">
SELECT
c.*,
ROW_NUMBER () OVER (PARTITION BY c.DEV_ID ORDER BY c.PLN_CHK_DT_STRT DESC) AS rn
FROM
T_DEV_PRD_CHK c
LEFT JOIN T_DEV_PRD_CHK_PLN p on c.PLN_ID = p.id
<where>
AND DEV_ID IN
<foreach collection="param.deviceIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
AND p.FLW_STS = #{param.flowStatus}
</where>
</select>
</mapper>