<?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.system.mapper.SysRotographMapper">
    
    <resultMap type="SysRotograph" id="SysRotographResult">
        <result property="id"    column="id"    />
        <result property="path"    column="path"    />
        <result property="sort"    column="sort"    />
        <result property="remark"    column="remark"    />
    </resultMap>

    <sql id="selectSysRotographVo">
        select id, path, sort, remark from sys_rotograph
    </sql>

    <select id="selectSysRotographList" parameterType="SysRotograph" resultMap="SysRotographResult">
        <include refid="selectSysRotographVo"/>
        <where>  
            <if test="path != null  and path != ''"> and path = #{path}</if>
            <if test="sort != null "> and sort = #{sort}</if>
        </where>
        order by sort
    </select>
    
    <select id="selectSysRotographById" parameterType="Long" resultMap="SysRotographResult">
        <include refid="selectSysRotographVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertSysRotograph" parameterType="SysRotograph">
        insert into sys_rotograph
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="path != null">path,</if>
            <if test="sort != null">sort,</if>
            <if test="remark != null">remark,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="path != null">#{path},</if>
            <if test="sort != null">#{sort},</if>
            <if test="remark != null">#{remark},</if>
         </trim>
    </insert>

    <update id="updateSysRotograph" parameterType="SysRotograph">
        update sys_rotograph
        <trim prefix="SET" suffixOverrides=",">
            <if test="path != null">path = #{path},</if>
            <if test="sort != null">sort = #{sort},</if>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteSysRotographById" parameterType="Long">
        delete from sys_rotograph where id = #{id}
    </delete>

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