<?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="jnpf.dmsMapper.DmsApprovedMetadataMapper">
|
<resultMap id="Metadata" type="jnpf.dmsEntity.banben.DmsWenjianBanbenJiesuanModel">
|
<result column="bianhao_shiyong_ren_id" property="bianhaoShiyongRenId"/>
|
<result column="zhidingren_bumen_id" property="zhidingrenBumenId"/>
|
<result column="shenhe_liucheng_id" property="shenheLiuchengId"/>
|
<result column="shenhe_liucheng_renwu_id" property="shenheLiuchengRenwuId"/>
|
</resultMap>
|
<select id="selectSource" resultMap="Metadata">
|
SELECT a.zhidingren_bumen_id, a.f_flow_id AS shenhe_liucheng_id,
|
a.f_flow_task_id AS shenhe_liucheng_renwu_id,
|
a.bianhao_shiyong_ren_id
|
FROM (
|
SELECT a.f_tenant_id, a.f_flow_id, a.f_flow_task_id,
|
a.bumen_id AS zhidingren_bumen_id,
|
CASE WHEN #{rowId,jdbcType=VARCHAR} IS NULL THEN n.shiyong_ren_id END AS bianhao_shiyong_ren_id
|
FROM dms_wenjian_xinzeng_shenhe a
|
LEFT JOIN dms_wenjian_bianhao n ON n.f_tenant_id = a.f_tenant_id AND n.f_id = a.wenjian_bianhao_id
|
WHERE #{auditType} = 'xinzeng_shenhe' AND a.f_tenant_id = #{tenantId}
|
AND a.f_id = #{auditId} AND a.f_flow_state = 2 AND a.f_delete_mark IS NULL
|
UNION ALL
|
SELECT a.f_tenant_id, a.f_flow_id, a.f_flow_task_id,
|
a.tiyi_bumen_id AS zhidingren_bumen_id, NULL AS bianhao_shiyong_ren_id
|
FROM dms_wenjian_xiuding_shenhe a
|
WHERE #{auditType} = 'xiuding_shenhe' AND a.f_tenant_id = #{tenantId}
|
AND a.f_id = #{auditId} AND a.f_flow_state = 2 AND a.f_delete_mark IS NULL
|
UNION ALL
|
SELECT a.f_tenant_id, a.f_flow_id, a.f_flow_task_id,
|
a.bumen_id AS zhidingren_bumen_id, NULL AS bianhao_shiyong_ren_id
|
FROM dms_wailai_wenjian_xinzeng_shenhe a
|
WHERE #{auditType} = 'wailai_wenjian_xinzeng_shenhe' AND a.f_tenant_id = #{tenantId}
|
AND a.f_id = #{auditId} AND a.f_flow_state = 2 AND a.f_delete_mark IS NULL
|
) a
|
</select>
|
</mapper>
|