<?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.hzs.system.config.mapper.BdBonusDirectLoopMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BdBonusDirectLoopExt" type="com.hzs.common.domain.system.config.ext.BdBonusDirectLoopExt">
        <id column="PK_ID" property="pkId" />
        <result column="DEL_FLAG" property="delFlag" />
        <result column="PK_COUNTRY" property="pkCountry" />
        <result column="CREATION_TIME" property="creationTime" />
        <result column="MODIFIED_TIME" property="modifiedTime" />
        <result column="PK_CREATOR" property="pkCreator" />
        <result column="PK_MODIFIED" property="pkModified" />
        <result column="BONUS_TYPE" property="bonusType" />
        <result column="FIRST_ORDER" property="firstOrder" />
        <result column="SECOND_ORDER" property="secondOrder" />
        <result column="THIRD_ORDER" property="thirdOrder" />
        <result column="FOURTH_ORDER" property="fourthOrder" />
        <result column="PK_GRADE" property="pkGrade" />
        <result column="TAKE_VALUE_TYPE" property="takeValueType" />
    </resultMap>

    <select id="queryBonusDirectLoop" resultMap="BdBonusDirectLoopExt">
        select bl.pk_id,bonus_type,first_order,second_order,third_order,fourth_order,bl.pk_country,
               cal_type,bd.pk_grade from bd_bonus_direct_loop bl
         inner join BD_LOOP_DETAILS bd
                    on bl.pk_id = bd.pk_bonus_direct
        where bl.del_flag=0 and bd.del_flag=0
    </select>


</mapper>
