<?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.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridRecordMapper">


    <select id="getBwEndTime" resultType="java.util.Map">
        SELECT SEQUENCE_NBR AS sequenceNbr,rec_date as time
        FROM hygf_basic_grid_record
        WHERE grid_status='3'
    </select>

    <select id="getBwCreateTime" resultType="java.util.Map">
        SELECT
        PROC_INST_ID_ AS processInstanceId,
        MIN( START_TIME_ ) AS time
        FROM
        act_hi_taskinst aht
        WHERE
        EXISTS ( SELECT 1 FROM hygf_basic_grid_record hbgr WHERE hbgr.instance_Id = aht.PROC_INST_ID_  and aht.NAME_='并网登记' )
        GROUP BY
        PROC_INST_ID_
    </select>
</mapper>
