<?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.testor.module.safe.dao.TSafeHazardStandardDao">
    <!-- 开启二级缓存 -->
    <!-- <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> -->
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.testor.module.safe.model.domain.TSafeHazardStandard">
        <id column="id" property="id"/>
        <id column="ref_id" property="refId"/>
        <id column="parent_id" property="parentId"/>
        <id column="tenant_id" property="tenantId"/>
        <id column="process_id" property="processId"/>
        <id column="process_status" property="processStatus"/>
        <id column="level_type" property="levelType"/>
        <id column="standard_type" property="standardType"/>
        <id column="standard_name" property="standardName"/>
        <id column="org_id" property="orgId"/>
        <id column="standard_status" property="standardStatus"/>
        <id column="standard_type_level" property="standardTypeLevel"/>
    </resultMap>

    <select id="isCheckPlan" parameterType="string" resultType="string">
        SELECT
            o.id
        FROM
            t_safe_hazard_check_object AS o
                LEFT JOIN t_safe_hazard_check_plan AS p ON o.plan_id=p.id
        WHERE o.standard_id=#{standardId} AND p.end_date &gt; NOW()
    </select>
</mapper>