123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <?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.PostCollectionsSystemMapper">
- <resultMap type="PostCollectionsSystem" id="PostCollectionsSystemResult">
- <result property="id" column="id" />
- <result property="type" column="type" />
- <result property="name" column="name" />
- <result property="createTime" column="create_time" />
- <result property="startTime" column="start_time" />
- <result property="endTime" column="end_time" />
- <result property="systemNumber" column="system_number" />
- <result property="state" column="state" />
- <result property="image" column="image" />
- <result property="giftExchange" column="gift_exchange" />
- <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="selectPostCollectionsSystemVo">
- select id, type, name, create_time, start_time, end_time, system_number, state, image, gift_exchange, update_time, create_user, update_user, is_deleted from post_collections_system
- </sql>
- <select id="selectPostCollectionsSystemList" parameterType="PostCollectionsSystem" resultMap="PostCollectionsSystemResult">
- <include refid="selectPostCollectionsSystemVo"/>
- <where>
- <if test="type != null "> and type = #{type}</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="systemNumber != null "> and system_number = #{systemNumber}</if>
- <if test="state != null "> and state = #{state}</if>
- <if test="image != null and image != ''"> and image = #{image}</if>
- <if test="giftExchange != null "> and gift_exchange = #{giftExchange}</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="selectPostCollectionsSystemById" parameterType="Long" resultMap="PostCollectionsSystemResult">
- <include refid="selectPostCollectionsSystemVo"/>
- where id = #{id}
- </select>
- <insert id="insertPostCollectionsSystem" parameterType="PostCollectionsSystem" useGeneratedKeys="true" keyProperty="id">
- insert into post_collections_system
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="type != null">type,</if>
- <if test="name != null">name,</if>
- <if test="createTime != null">create_time,</if>
- <if test="startTime != null">start_time,</if>
- <if test="endTime != null">end_time,</if>
- <if test="systemNumber != null">system_number,</if>
- <if test="state != null">state,</if>
- <if test="image != null">image,</if>
- <if test="giftExchange != null">gift_exchange,</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="type != null">#{type},</if>
- <if test="name != null">#{name},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="startTime != null">#{startTime},</if>
- <if test="endTime != null">#{endTime},</if>
- <if test="systemNumber != null">#{systemNumber},</if>
- <if test="state != null">#{state},</if>
- <if test="image != null">#{image},</if>
- <if test="giftExchange != null">#{giftExchange},</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="updatePostCollectionsSystem" parameterType="PostCollectionsSystem">
- update post_collections_system
- <trim prefix="SET" suffixOverrides=",">
- <if test="type != null">type = #{type},</if>
- <if test="name != null">name = #{name},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="startTime != null">start_time = #{startTime},</if>
- <if test="endTime != null">end_time = #{endTime},</if>
- <if test="systemNumber != null">system_number = #{systemNumber},</if>
- <if test="state != null">state = #{state},</if>
- <if test="image != null">image = #{image},</if>
- <if test="giftExchange != null">gift_exchange = #{giftExchange},</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="deletePostCollectionsSystemById" parameterType="Long">
- delete from post_collections_system where id = #{id}
- </delete>
- <delete id="deletePostCollectionsSystemByIds" parameterType="String">
- delete from post_collections_system where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <!--套系搜索功能-->
- <select id="selectPostListByTitleOrTime" resultType="PostCollectionsSystem" resultMap="PostCollectionsSystemResult">
- <include refid="selectPostCollectionsSystemVo"/>
- <where>
- <if test="title != null and title != ''"> and name LIKE '%${title}%'</if>
- <if test="timeLeft != null and timeRight != null "> and create_time between #{timeLeft} AND #{timeRight}</if>
- </where>
- </select>
- </mapper>
|