|
|
@@ -0,0 +1,138 @@
|
|
|
+<?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.xunmei.core.safetybook.mapper.CoreSafetyBookBookFilesMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.xunmei.core.safetybook.domain.CoreSafetyBookBookFiles" id="CoreSafetyBookBookFilesResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="bookUserId" column="book_user_id"/>
|
|
|
+ <result property="name" column="name"/>
|
|
|
+ <result property="url" column="url"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCoreSafetyBookBookFilesVo">
|
|
|
+ select id,
|
|
|
+ book_user_id,
|
|
|
+ name,
|
|
|
+ url,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time
|
|
|
+ from core_safety_book_book_files
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCoreSafetyBookBookFilesList"
|
|
|
+ parameterType="com.xunmei.core.safetybook.domain.CoreSafetyBookBookFiles"
|
|
|
+ resultMap="CoreSafetyBookBookFilesResult">
|
|
|
+ <include refid="selectCoreSafetyBookBookFilesVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="bookUserId != null ">
|
|
|
+ and book_user_id = #{bookUserId}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and name like concat('%', #{name}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="url != null and url != ''">
|
|
|
+ and url = #{url}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCoreSafetyBookBookFilesById" parameterType="Long"
|
|
|
+ resultMap="CoreSafetyBookBookFilesResult">
|
|
|
+ <include refid="selectCoreSafetyBookBookFilesVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+ <select id="selecVotList" resultType="com.xunmei.core.safetybook.domain.CoreSafetyBookBookFilesVo">
|
|
|
+ select name,url from core_safety_book_book_files where book_user_id=#{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCoreSafetyBookBookFiles"
|
|
|
+ parameterType="com.xunmei.core.safetybook.domain.CoreSafetyBookBookFiles">
|
|
|
+ insert into core_safety_book_book_files
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,
|
|
|
+ </if>
|
|
|
+ <if test="bookUserId != null">book_user_id,
|
|
|
+ </if>
|
|
|
+ <if test="name != null">name,
|
|
|
+ </if>
|
|
|
+ <if test="url != null">url,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">create_by,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">create_time,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">update_by,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">update_time,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},
|
|
|
+ </if>
|
|
|
+ <if test="bookUserId != null">#{bookUserId},
|
|
|
+ </if>
|
|
|
+ <if test="name != null">#{name},
|
|
|
+ </if>
|
|
|
+ <if test="url != null">#{url},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">#{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">#{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">#{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">#{updateTime},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCoreSafetyBookBookFiles"
|
|
|
+ parameterType="com.xunmei.core.safetybook.domain.CoreSafetyBookBookFiles">
|
|
|
+ update core_safety_book_book_files
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="bookUserId != null">book_user_id =
|
|
|
+ #{bookUserId},
|
|
|
+ </if>
|
|
|
+ <if test="name != null">name =
|
|
|
+ #{name},
|
|
|
+ </if>
|
|
|
+ <if test="url != null">url =
|
|
|
+ #{url},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">create_by =
|
|
|
+ #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">create_time =
|
|
|
+ #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">update_by =
|
|
|
+ #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">update_time =
|
|
|
+ #{updateTime},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteCoreSafetyBookBookFilesById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from core_safety_book_book_files
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCoreSafetyBookBookFilesByIds" parameterType="String">
|
|
|
+ delete from core_safety_book_book_files where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|