123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <?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.ImageDataMapper">
- <resultMap type="com.ruoyi.common.core.domain.entity.ImageDatas" id="ImageDataResult">
- <result property="imageId" column="image_id"/>
- <result property="newsId" column="news_id"/>
- <result property="imageName" column="image_name"/>
- <result property="imageContent" column="image_content"/>
- <result property="imageIntroduce" column="image_introduce"/>
- <result property="status" column="status"/>
- <result property="type" column="type"/>
- <result property="isDel" column="is_del"/>
- <result property="createBy" column="create_by"/>
- <result property="createTime" column="create_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- <result property="remark" column="remark"/>
- </resultMap>
- <sql id="selectImageDataVo">
- select image_id,news_id, image_name, image_content, image_introduce, status, type, is_del, create_by, create_time, update_by, update_time, remark from image_data
- </sql>
- <select id="selectImageDatasList" parameterType="ImageDatas" resultMap="ImageDataResult">
- <include refid="selectImageDataVo"/>
- where
- is_del = 'N'
- <if test="imageName != null and imageName != ''">and image_name like concat('%', #{imageName}, '%')</if>
- <if test="type != null and type != ''">and type = #{type}</if>
- order by create_time DESC
- </select>
- <select id="selectImageDatasListMenHu" parameterType="ImageDatas" resultMap="ImageDataResult">
- select image_name,image_name, image_content, image_introduce,type from image_data
- <where>
- is_del = 'N'
- and status = '0'
- <if test="imageName != null and imageName != ''">and image_name like concat('%', #{imageName}, '%')</if>
- <if test="type != null and type != ''">and type = #{type}</if>
- </where>
- order by create_time DESC
- </select>
- <select id="selectImageDatasByImageId" parameterType="Long" resultMap="ImageDataResult">
- <include refid="selectImageDataVo"/>
- where image_id = #{imageId} and is_del = 'N'
- </select>
- <insert id="insertImageDatas" parameterType="ImageDatas" useGeneratedKeys="true" keyProperty="imageId">
- insert into image_data
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="newsId != null and newsId != ''">news_id,</if>
- <if test="imageName != null and imageName != ''">image_name,</if>
- <if test="imageContent != null">image_content,</if>
- <if test="imageIntroduce != null">image_introduce,</if>
- <if test="status != null">status,</if>
- <if test="type != null">type,</if>
- <if test="isDel != null">is_del,</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>
- <if test="remark != null">remark,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="newsId != null and newsId != ''">#{newsId},</if>
- <if test="imageName != null and imageName != ''">#{imageName},</if>
- <if test="imageContent != null">#{imageContent},</if>
- <if test="imageIntroduce != null">#{imageIntroduce},</if>
- <if test="status != null">#{status},</if>
- <if test="type != null">#{type},</if>
- <if test="isDel != null">#{isDel},</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>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateImageDatas" parameterType="ImageDatas">
- update image_data
- <trim prefix="SET" suffixOverrides=",">
- <if test="newsId != null and newsId != ''">news_id = #{newsId},</if>
- <if test="imageName != null and imageName != ''">image_name = #{imageName},</if>
- <if test="imageContent != null">image_content = #{imageContent},</if>
- <if test="imageIntroduce != null">image_introduce = #{imageIntroduce},</if>
- <if test="status != null">status = #{status},</if>
- <if test="type != null">type = #{type},</if>
- <if test="isDel != null">is_del = #{isDel},</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>
- <if test="remark != null">remark = #{remark},</if>
- </trim>
- where image_id = #{imageId}
- </update>
- <delete id="deleteImageDatasByImageId" parameterType="Long">
- delete from image_data where image_id = #{imageId}
- </delete>
- <delete id="deleteImageDatasByImageIds" parameterType="String">
- delete from image_data where image_id in
- <foreach item="imageId" collection="array" open="(" separator="," close=")">
- #{imageId}
- </foreach>
- </delete>
- <update id="deleteImageDatasByNewsId" parameterType="integer">
- update image_data set is_del = 'Y'
- where news_id = #{newsId}
- </update>
- </mapper>
|