MediaMapper.xml 1.89 KB
<?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.hui.iqiyi.mapper.MediaMapper">
    <select id="selectAllIqIy" resultType="com.hui.iqiyi.entity.Media" parameterType="com.hui.iqiyi.request.MediaRequest">


        select im.*
        from iqiyi_media as im
        where 1=1
        <if test="id != null and  id != ''">
            and id = #{id}
        </if>
        <if test="cid != null and  cid != ''">
            and cid = #{cid}
        </if>
        <if test="type != null and  type != ''">
            and type = #{type}
        </if>
        <if test="name!= null and  name!= ''">
            AND name = #{name}
        </if>
        <if test="cname!= null and  cname!= ''">
            AND cname = #{cname}
        </if>
        <if test="beginTime != null">
           and create_time &gt;= #{beginTime}
        </if>
        <if test="EndTime != null">
           and create_time &lt;= #{EndTime}
        </if>
        <if test="score != null">
            and score = #{score}
        </if>
        <if test="platformInfo != null">
            and platform_info =  #{platformInfo}
        </if>
        <if test="follow != null">
            and platform_info is not null
        </if>
        <if test="downloadStatus !=null" >
            and local_status=#{downloadStatus}
        </if>
        ORDER BY create_time desc
    </select>

    <select id="selectAllfollow" resultType="com.hui.iqiyi.entity.Media">
        select * from iqiyi_media as a
        LEFT JOIN iqiyi_program as c on a.id =c.iqiyi_content_id
        LEFT JOIN iqiyi_movie as d on d.iqiyi_program_id=c.id
        <where>
            1=1
            <if test="platformInfo!=null">
                and a.platform_info=#{platformInfo}
            </if>
        </where>

        ORDER BY a.update_time

    </select>

</mapper>