<?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.fjhx.mapper.process.ProcessTenantMapper">

    <select id="getPage" resultType="java.util.Map">
        select pi.service_name      serviceName,
               pi.module_name       moduleName,
               pt.id,
               pt.process_info_id   processInfoId,
               pt.name,
               pt.binding_tenant_id bindingTenantId,
               pt.version_number    versionNumber,
               pt.current_version   currentVersion
        from process_info pi
                 left join process_tenant pt on pi.id = pt.process_info_id
            ${ew.customSqlSegment}
    </select>

    <select id="getProcessTenant" resultType="com.fjhx.entity.process.ProcessTenant">
        select pt.id,
               pt.node_object nodeObject,
               pt.line_object lineObject
        from process_tenant pt
                 left join process_info pi on pt.process_info_id = pi.id
        where pt.current_version = 1
          and pt.binding_tenant_id = #{tenantId}
          and pi.code = #{code}
    </select>

</mapper>
