|
@@ -0,0 +1,119 @@
|
|
|
+<?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.CollectionMapper">
|
|
|
+
|
|
|
+ <resultMap type="Collection" id="CollectionResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="systemId" column="system_id" />
|
|
|
+ <result property="issuerId" column="issuer_id" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="startTime" column="start_time" />
|
|
|
+ <result property="endTime" column="end_time" />
|
|
|
+ <result property="state" column="state" />
|
|
|
+ <result property="collectionsNumber" column="collections_number" />
|
|
|
+ <result property="collectionsStory" column="collections_story" />
|
|
|
+ <result property="image" column="image" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="createUser" column="create_user" />
|
|
|
+ <result property="updateUser" column="update_user" />
|
|
|
+ <result property="isDeleted" column="is_deleted" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCollectionVo">
|
|
|
+ select id, system_id, issuer_id, name, start_time, end_time, state, collections_number, collections_story, image, create_time, update_time, create_user, update_user, is_deleted from collection
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCollectionList" parameterType="Collection" resultMap="CollectionResult">
|
|
|
+ <include refid="selectCollectionVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="systemId != null "> and system_id = #{systemId}</if>
|
|
|
+ <if test="issuerId != null "> and issuer_id = #{issuerId}</if>
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="startTime != null "> and start_time = #{startTime}</if>
|
|
|
+ <if test="endTime != null "> and end_time = #{endTime}</if>
|
|
|
+ <if test="state != null "> and state = #{state}</if>
|
|
|
+ <if test="collectionsNumber != null "> and collections_number = #{collectionsNumber}</if>
|
|
|
+ <if test="collectionsStory != null and collectionsStory != ''"> and collections_story = #{collectionsStory}</if>
|
|
|
+ <if test="image != null and image != ''"> and image = #{image}</if>
|
|
|
+ <if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if>
|
|
|
+ <if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if>
|
|
|
+ <if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCollectionById" parameterType="Long" resultMap="CollectionResult">
|
|
|
+ <include refid="selectCollectionVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCollection" parameterType="Collection" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into collection
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="systemId != null">system_id,</if>
|
|
|
+ <if test="issuerId != null">issuer_id,</if>
|
|
|
+ <if test="name != null">name,</if>
|
|
|
+ <if test="startTime != null">start_time,</if>
|
|
|
+ <if test="endTime != null">end_time,</if>
|
|
|
+ <if test="state != null">state,</if>
|
|
|
+ <if test="collectionsNumber != null">collections_number,</if>
|
|
|
+ <if test="collectionsStory != null">collections_story,</if>
|
|
|
+ <if test="image != null">image,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="createUser != null">create_user,</if>
|
|
|
+ <if test="updateUser != null">update_user,</if>
|
|
|
+ <if test="isDeleted != null">is_deleted,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="systemId != null">#{systemId},</if>
|
|
|
+ <if test="issuerId != null">#{issuerId},</if>
|
|
|
+ <if test="name != null">#{name},</if>
|
|
|
+ <if test="startTime != null">#{startTime},</if>
|
|
|
+ <if test="endTime != null">#{endTime},</if>
|
|
|
+ <if test="state != null">#{state},</if>
|
|
|
+ <if test="collectionsNumber != null">#{collectionsNumber},</if>
|
|
|
+ <if test="collectionsStory != null">#{collectionsStory},</if>
|
|
|
+ <if test="image != null">#{image},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="createUser != null">#{createUser},</if>
|
|
|
+ <if test="updateUser != null">#{updateUser},</if>
|
|
|
+ <if test="isDeleted != null">#{isDeleted},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCollection" parameterType="Collection">
|
|
|
+ update collection
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="systemId != null">system_id = #{systemId},</if>
|
|
|
+ <if test="issuerId != null">issuer_id = #{issuerId},</if>
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
+ <if test="startTime != null">start_time = #{startTime},</if>
|
|
|
+ <if test="endTime != null">end_time = #{endTime},</if>
|
|
|
+ <if test="state != null">state = #{state},</if>
|
|
|
+ <if test="collectionsNumber != null">collections_number = #{collectionsNumber},</if>
|
|
|
+ <if test="collectionsStory != null">collections_story = #{collectionsStory},</if>
|
|
|
+ <if test="image != null">image = #{image},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="createUser != null">create_user = #{createUser},</if>
|
|
|
+ <if test="updateUser != null">update_user = #{updateUser},</if>
|
|
|
+ <if test="isDeleted != null">is_deleted = #{isDeleted},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteCollectionById" parameterType="Long">
|
|
|
+ delete from collection where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCollectionByIds" parameterType="String">
|
|
|
+ delete from collection where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|