<?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.willalp.event.mapper.HsEventBusinessRelationMapper">

    <resultMap type="com.willalp.event.domain.HsEventBusinessRelation" id="HsEventBusinessRelationResult">
        <result property="eventId" column="event_id"/>
        <result property="businessId" column="business_id"/>
        <result property="businessType" column="business_type"/>
    </resultMap>

    <sql id="selectHsEventBusinessRelationVo">
        select event_id, business_id, business_type
        from hs_event_business_relation
    </sql>

    <select id="selectHsEventBusinessRelationList" parameterType="HsEventBusinessRelation"
            resultMap="HsEventBusinessRelationResult">
        <include refid="selectHsEventBusinessRelationVo"/>
        <where>
            <if test="eventId != null  and eventId != ''">
                and event_id = #{eventId}
            </if>
            <if test="businessId != null  and businessId != ''">
                and business_id = #{businessId}
            </if>
            <if test="businessType != null  and businessType != ''">
                and business_type = #{businessType}
            </if>
        </where>
    </select>
</mapper>
