<?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="cn.iocoder.yudao.module.jx.mapper.DriveSchoolSwiperMapper">

    <resultMap type="cn.iocoder.yudao.module.jx.domain.DriveSchoolSwiper" id="DriveSchoolSwiperResult">
        <result property="id"    column="id"    />
        <result property="swiperName"    column="swiper_name"    />
        <result property="deptId"    column="dept_id"    />
        <result property="swiperPicture"    column="swiper_picture"    />
        <result property="jumpUrl"    column="jump_url"    />
        <result property="listOrder"    column="list_order"    />
        <result property="creator"    column="creator"    />
        <result property="createTime"    column="create_time"    />
        <result property="updater"    column="updater"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectDriveSchoolSwiperVo">
        select id, swiper_name, dept_id,swiper_picture, jump_url, list_order, creator, create_time, updater, update_time from drive_school_swiper
    </sql>

    <select id="selectDriveSchoolSwiperList" resultMap="DriveSchoolSwiperResult">
        SELECT id, swiper_name, dept_id, swiper_picture, jump_url, list_order, creator, create_time, updater, update_time
        FROM drive_school_swiper
        <where>
            deleted = 0
            <if test="swiperName != null and swiperName != ''">
                AND swiper_name LIKE CONCAT('%', #{swiperName}, '%')
            </if>
            <if test="swiperPicture != null and swiperPicture != ''">
                AND swiper_picture = #{swiperPicture}
            </if>
            <if test="jumpUrl != null and jumpUrl != ''">
                AND jump_url = #{jumpUrl}
            </if>
            <if test="deptId != null">
                AND dept_id = #{deptId}
            </if>
            <if test="listOrder != null">
                AND list_order = #{listOrder}
            </if>
        </where>
        ORDER BY list_order ASC
    </select>


    <select id="selectDriveSchoolSwiperById" parameterType="Long" resultMap="DriveSchoolSwiperResult">
        <include refid="selectDriveSchoolSwiperVo"/>
        where id = #{id}
    </select>

    <insert id="insertDriveSchoolSwiper" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolSwiper">
        insert into drive_school_swiper
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="deptId != null">dept_id,</if>
            <if test="swiperName != null">swiper_name,</if>
            <if test="swiperPicture != null">swiper_picture,</if>
            <if test="jumpUrl != null">jump_url,</if>
            <if test="listOrder != null">list_order,</if>
            <if test="creator != null">creator,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updater != null">updater,</if>
            <if test="updateTime != null">update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="deptId != null">#{deptId},</if>
            <if test="swiperName != null">#{swiperName},</if>
            <if test="swiperPicture != null">#{swiperPicture},</if>
            <if test="jumpUrl != null">#{jumpUrl},</if>
            <if test="listOrder != null">#{listOrder},</if>
            <if test="creator != null">#{creator},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updater != null">#{updater},</if>
            <if test="updateTime != null">#{updateTime},</if>
         </trim>
    </insert>

    <update id="updateDriveSchoolSwiper" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolSwiper">
        update drive_school_swiper
        <trim prefix="SET" suffixOverrides=",">
            <if test="swiperName != null">swiper_name = #{swiperName},</if>
            <if test="deptId != null">dept_id = #{deptId},</if>
            <if test="swiperPicture != null">swiper_picture = #{swiperPicture},</if>
            <if test="jumpUrl != null">jump_url = #{jumpUrl},</if>
            <if test="listOrder != null">list_order = #{listOrder},</if>
            <if test="creator != null">creator = #{creator},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updater != null">updater = #{updater},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteDriveSchoolSwiperById" parameterType="Long">
        delete from drive_school_swiper where id = #{id}
    </delete>

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

    <select id="selectDriveSchoolSwiperPage" resultMap="DriveSchoolSwiperResult">
        SELECT id, swiper_name, dept_id, swiper_picture, jump_url, list_order, creator, create_time, updater, update_time
        FROM drive_school_swiper
        <where>
            deleted = 0

                <if test="entity.swiperName != null and entity.swiperName != ''">
                    AND swiper_name LIKE CONCAT('%', #{entity.swiperName}, '%')
                </if>
                <if test="entity.swiperPicture != null and entity.swiperPicture != ''">
                    AND swiper_picture = #{entity.swiperPicture}
                </if>
                <if test="entity.jumpUrl != null and entity.jumpUrl != ''">
                    AND jump_url = #{entity.jumpUrl}
                </if>
                <if test="entity.deptId != null">
                    AND dept_id = #{entity.deptId}
                </if>
                <if test="entity.listOrder != null">
                    AND list_order = #{entity.listOrder}
                </if>


        </where>
        ORDER BY list_order ASC
    </select>



</mapper>
