xieb
2023-07-05 d99b2003dae4afa35b29f05c74c2e07b574bd94a
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/resDataCheck/mapper/QualityManageMapper.xml
@@ -45,4 +45,23 @@
                LEFT JOIN SM_RES_DATA_CHECK_RULES rule ON rule.id = qm.rule_id
        WHERE qm.is_deleted = 0 AND qm.id = #{id}
    </select>
    <insert id="addQualityManage">
        insert into SM_RES_DATA_QUALITY_MANAGE (res_id,rule_id,create_time,update_time)
        select a."guid" as res_id,#{ruleId},NOW(),NOW()
        from SJZT_MD."att_res_base" a
                 left join SJZT_MD."att_res_danger_manage_special" b on (a."guid" = b."res_guid")
                 left join SJZT_MD."att_res_stag_char" c on (a."guid" = c."res_guid")
                 left join SJZT_MD."att_res_flse_lim" d1 on (a."guid" = d1."res_guid" and d1."flood_season_name" = '前汛期')
                 left join SJZT_MD."att_res_flse_lim" d2 on (a."guid" = d2."res_guid" and d2."flood_season_name" = '中汛期')
                 left join SJZT_MD."att_res_flse_lim" d3 on (a."guid" = d3."res_guid" and d3."flood_season_name" = '后汛期')
                 left join SJZT_MD."att_st_base" e on (a."guid" = e."res_guid" and e."is_main_rsvr" = '1')
                 left join SJZT_MD."st_rsvr_r_last" f on (e."code" = f."stcd")
                 left join (select tmp."res_guid",max(tmp."tb_weir_top_elevation") "tb_weir_top_elevation" from SJZT_MD."att_res_rsb_norspi" tmp group by tmp."res_guid") g on (a."guid" = g."res_guid")
                 left join (select tmp2."res_guid",max(tmp2."tb_dam_top_elevation") "tb_dam_top_elevation" from SJZT_MD."att_res_water_block" tmp2 group by tmp2."res_guid") h on (a."guid" = h."res_guid")
        <where>
            #{whereStr}
        </where>
    </insert>
</mapper>