<?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.ruoyi.syzy.mapper.BBusiWishUniversitiesImageMapper">
    
    <resultMap type="BBusiWishUniversitiesImage" id="BBusiWishUniversitiesImageResult">
        <result property="id"    column="id"    />
        <result property="collegeCode"    column="collegeCode"    />
        <result property="description"    column="description"    />
        <result property="isBanner"    column="isBanner"    />
        <result property="url"    column="url"    />
        <result property="updateTime"    column="updateTime"    />
        <result property="createTime"    column="createTime"    />
        <result property="type"    column="type"    />
        <result property="coverUrl"    column="coverUrl"    />
        <result property="sort"    column="sort"    />
    </resultMap>

    <sql id="selectBBusiWishUniversitiesImageVo">
        select id, collegeCode, description, isBanner, url, updateTime, createTime, type, coverUrl, sort from b_busi_wish_universities_image
    </sql>

    <select id="selectBBusiWishUniversitiesImageList" parameterType="BBusiWishUniversitiesImage" resultMap="BBusiWishUniversitiesImageResult">
        <include refid="selectBBusiWishUniversitiesImageVo"/>
        <where>
            <if test="collegeCode != null  and collegeCode != ''"> and collegeCode = #{collegeCode}</if>
            <if test="description != null  and description != ''"> and description = #{description}</if>
            <if test="isBanner != null "> and isBanner = #{isBanner}</if>
            <if test="url != null  and url != ''"> and url like concat('%', #{url},'%')</if>
            <if test="updateTime != null "> and updateTime = #{updateTime}</if>
            <if test="createTime != null "> and createTime = #{createTime}</if>
            <if test="type != null "> and type = #{type}</if>
            <if test="coverUrl != null  and coverUrl != ''"> and coverUrl like concat('%', #{coverUrl},'%')</if>
            <if test="sort != null "> and sort = #{sort}</if>
        </where>
        order by collegeCode,sort
        <!--if test="params.orderBy!=null and params.orderBy != ''"> order by #{params.orderBy} </if-->
    </select>
    
    <select id="selectBBusiWishUniversitiesImageById" parameterType="String" resultMap="BBusiWishUniversitiesImageResult">
        <include refid="selectBBusiWishUniversitiesImageVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertBBusiWishUniversitiesImage" parameterType="BBusiWishUniversitiesImage">
        insert into b_busi_wish_universities_image
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="collegeCode != null and collegeCode != ''">collegeCode,</if>
            <if test="description != null">description,</if>
            <if test="isBanner != null">isBanner,</if>
            <if test="url != null">url,</if>
            <if test="updateTime != null">updateTime,</if>
            <if test="createTime != null">createTime,</if>
            <if test="type != null">type,</if>
            <if test="coverUrl != null">coverUrl,</if>
            <if test="sort != null">sort,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="collegeCode != null and collegeCode != ''">#{collegeCode},</if>
            <if test="description != null">#{description},</if>
            <if test="isBanner != null">#{isBanner},</if>
            <if test="url != null">#{url},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="type != null">#{type},</if>
            <if test="coverUrl != null">#{coverUrl},</if>
            <if test="sort != null">#{sort},</if>
         </trim>
    </insert>

    <update id="updateBBusiWishUniversitiesImage" parameterType="BBusiWishUniversitiesImage">
        update b_busi_wish_universities_image
        <trim prefix="SET" suffixOverrides=",">
            <if test="collegeCode != null and collegeCode != ''">collegeCode = #{collegeCode},</if>
            <if test="description != null">description = #{description},</if>
            <if test="isBanner != null">isBanner = #{isBanner},</if>
            <if test="url != null">url = #{url},</if>
            <if test="updateTime != null">updateTime = #{updateTime},</if>
            <if test="createTime != null">createTime = #{createTime},</if>
            <if test="type != null">type = #{type},</if>
            <if test="coverUrl != null">coverUrl = #{coverUrl},</if>
            <if test="sort != null">sort = #{sort},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteBBusiWishUniversitiesImageById" parameterType="String">
        delete from b_busi_wish_universities_image where id = #{id}
    </delete>

    <delete id="deleteBBusiWishUniversitiesImageByIds" parameterType="String">
        delete from b_busi_wish_universities_image where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>