<?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.mx.dla.dda.contrato.bdeal.daos.BdealDAO">

	<resultMap id="tituloBdeal" type="TituloBdealDTO">
		<result property="idDDA" 			column="ID_TITULO_CNT" />
		<result property="idBroadview" 		column="ID_BV" />
		<result property="nombreEstandar"	column="DESC_TITULO" />	
	</resultMap>
	
	<resultMap id="errorCarga" type="ErrorCargaDTO">
		<result property="idLDR"			column="ID_LDR" />
		<result property="idCarga"			column="ID_CARGA" />
		<result property="idDDA"			column="ID_DDA" />
		<result property="idBroadview"		column="ID_BROADVIEW" />
		<result property="nombreEstandar"	column="NOMBRE_ESTANDAR" />
		<result property="estatus"			column="ESTATUS" />
		<result property="comentarios"		column="COMENTARIOS" />	
	</resultMap>
	
	<select id="obtenTituloBdeal" resultMap="tituloBdeal"> 
		SELECT ID_TITULO_CNT, ID_BV, DESC_TITULO FROM DDA_T_CONTRATO_TITULO WHERE ID_CONTRATO = #{idContrato} AND ESTATUS = 'ACTIVO'
	</select>
	
	<select id="obtenErrorCarga" resultMap="errorCarga"> 
		SELECT ID_LDR, ID_CARGA, ID_DDA, ID_BROADVIEW, NOMBRE_ESTANDAR, ESTATUS, COMENTARIOS FROM DDA_T_CARGABV_DETALLE_LDR WHERE ID_CARGA = #{idCarga}
	</select>


</mapper>