<?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.goldenwater.hzz.mapper.WorkPlanMapper">
    <select id="getWorkPlan" resultType="com.goldenwater.hzz.domain.AttWorkPlanDTO">
        SELECT A.WP_CODE AS "wpCode", A.WP_NAME AS "wpName", A.FILE_NUM AS "fileNum",
               TO_CHAR(C.RELE_DATE,'YYYY-MM-DD') AS "rlsTm", C.RELE_WIUN_NAME AS "releWiunName",
               C.FILE_PATH AS "attc"
        FROM ATT_WORK_PLAN A
        LEFT JOIN REL_MD_OBJ B ON A.GUID = B.OBJ_GUID AND B.TO_DATE IS NULL
        LEFT JOIN ATT_MD_BASE C ON B.MD_GUID = C.GUID AND C.TO_DATE IS NULL
        LEFT JOIN REL_WORK_AD D ON A.WP_CODE = D.WP_CODE AND D.TO_DATE IS NULL
        WHERE A.EXPR_DATE IS NULL AND D.AD_CODE = #{adCode}
    </select>
</mapper>
