<?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.miaxis.ad.mapper.AdInfoMapper">

    <resultMap type="AdInfo" id="AdInfoResult">
        <result property="id"    column="id"    />
        <result property="title"    column="title"    />
        <result property="link"    column="link"    />
        <result property="status"    column="status"    />
        <result property="openType"    column="open_type"    />
        <result property="adType"    column="ad_type"    />
        <result property="xcxUrl"    column="xcx_url"    />
        <result property="content"    column="content"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectAdInfoVo">
        select * from ad_info
    </sql>

    <select id="selectAdInfoList" parameterType="AdInfo" resultMap="AdInfoResult">
        <include refid="selectAdInfoVo"/>
        <where>
            <if test="title != null  and title != ''"> and title = #{title}</if>
            <if test="link != null  and link != ''"> and link = #{link}</if>
            <if test="status != null "> and status = #{status}</if>
            <if test="openType != null "> and open_type = #{openType}</if>
            <if test="adType != null "> and ad_type = #{adType}</if>
            <if test="xcxUrl != null  and xcxUrl != ''"> and xcx_url = #{xcxUrl}</if>
            <if test="content != null  and content != ''"> and content = #{content}</if>
        </where>
    </select>

</mapper>
