<?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.HsEventImgMapper">

    <resultMap type="com.willalp.event.domain.HsEventImg" id="HsEventImgResult">
        <result property="id" column="id"/>
        <result property="eventId" column="event_id"/>
        <result property="url" column="url"/>
        <result property="size" column="size"/>
        <result property="type" column="type"/>
        <result property="isDelete" column="is_delete"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="remark" column="remark"/>
    </resultMap>

    <sql id="selectHsEventImgVo">
        select id,
               event_id,
               url,
               size,
               type,
               is_delete,
               create_by,
               create_time,
               update_by,
               update_time,
               remark
        from hs_event_img
    </sql>

    <select id="selectHsEventImgList" parameterType="HsEventImg" resultMap="HsEventImgResult">
        <include refid="selectHsEventImgVo"/>
        <where>
            is_delete = 0
            <if test="eventId != null  and eventId != ''">
                and event_id = #{eventId}
            </if>
            <if test="url != null  and url != ''">
                and url = #{url}
            </if>
            <if test="size != null ">
                and size = #{size}
            </if>
            <if test="type != null  and type != ''">
                and type = #{type}
            </if>
        </where>
    </select>
</mapper>
