school_website/ruoyi-admin/target/classes/mapper/cms/CmsContentMapper.xml

159 lines
9.0 KiB
XML
Raw Normal View History

2024-07-22 11:21:29 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
2024-07-22 17:30:34 +08:00
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2024-07-22 11:21:29 +08:00
<mapper namespace="com.ruoyi.cms.mapper.CmsContentMapper">
2024-07-22 17:30:34 +08:00
2024-07-22 11:21:29 +08:00
<resultMap type="CmsContent" id="CmsContentResult">
<result property="id" column="id" />
<result property="categoryId" column="category_id" />
2024-07-22 17:30:34 +08:00
<result property="contentType" column="content_type" />
2024-07-22 11:21:29 +08:00
<result property="contentTitle" column="content_title" />
<result property="contentImg" column="content_img" />
2024-07-22 17:30:34 +08:00
<result property="contentDetail" column="content_detail" />
<result property="source" column="source" />
<result property="sourceUrl" column="source_url" />
<result property="original" column="original" />
<result property="author" column="author" />
<result property="editor" column="editor" />
<result property="summary" column="summary" />
<result property="status" column="status" />
<result property="publishDate" column="publish_date" />
<result property="offlineDate" column="offline_date" />
2024-07-22 11:21:29 +08:00
<result property="isAccessory" column="is_accessory" />
<result property="accessoryUrl" column="accessory_url" />
<result property="remark" column="remark" />
<result property="delFlag" column="del_flag" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
2024-07-23 18:07:10 +08:00
<result property="imageUrl" column="image_url" />
<result property="videoUrl" column="video_url" />
2024-07-22 11:21:29 +08:00
</resultMap>
<sql id="selectCmsContentVo">
2024-07-23 18:07:10 +08:00
select id, category_id, content_type,image_url, video_url content_title, content_img, content_detail, source, source_url, original, author, editor, summary, status, publish_date, offline_date, is_accessory, accessory_url, remark, del_flag, create_time, create_by, update_time, update_by from cms_content
2024-07-22 11:21:29 +08:00
</sql>
<select id="selectCmsContentList" parameterType="CmsContent" resultMap="CmsContentResult">
<include refid="selectCmsContentVo"/>
2024-07-22 17:30:34 +08:00
<where>
2024-07-22 11:21:29 +08:00
<if test="categoryId != null "> and category_id = #{categoryId}</if>
2024-07-22 17:30:34 +08:00
<if test="contentType != null "> and content_type = #{contentType}</if>
2024-07-22 11:21:29 +08:00
<if test="contentTitle != null and contentTitle != ''"> and content_title = #{contentTitle}</if>
<if test="contentImg != null and contentImg != ''"> and content_img = #{contentImg}</if>
2024-07-22 17:30:34 +08:00
<if test="contentDetail != null and contentDetail != ''"> and content_detail = #{contentDetail}</if>
<if test="source != null and source != ''"> and source = #{source}</if>
<if test="sourceUrl != null and sourceUrl != ''"> and source_url = #{sourceUrl}</if>
<if test="original != null "> and original = #{original}</if>
<if test="author != null and author != ''"> and author = #{author}</if>
<if test="editor != null and editor != ''"> and editor = #{editor}</if>
<if test="summary != null and summary != ''"> and summary = #{summary}</if>
<if test="status != null "> and status = #{status}</if>
<if test="publishDate != null "> and publish_date = #{publishDate}</if>
<if test="offlineDate != null "> and offline_date = #{offlineDate}</if>
2024-07-22 11:21:29 +08:00
<if test="isAccessory != null "> and is_accessory = #{isAccessory}</if>
<if test="accessoryUrl != null and accessoryUrl != ''"> and accessory_url = #{accessoryUrl}</if>
</where>
</select>
2024-07-22 17:30:34 +08:00
2024-07-22 11:21:29 +08:00
<select id="selectCmsContentById" parameterType="Long" resultMap="CmsContentResult">
<include refid="selectCmsContentVo"/>
where id = #{id}
</select>
<insert id="insertCmsContent" parameterType="CmsContent">
insert into cms_content
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="categoryId != null">category_id,</if>
2024-07-22 17:30:34 +08:00
<if test="contentType != null">content_type,</if>
2024-07-22 11:21:29 +08:00
<if test="contentTitle != null and contentTitle != ''">content_title,</if>
<if test="contentImg != null">content_img,</if>
2024-07-22 17:30:34 +08:00
<if test="contentDetail != null">content_detail,</if>
<if test="source != null">source,</if>
<if test="sourceUrl != null">source_url,</if>
<if test="original != null">original,</if>
<if test="author != null">author,</if>
<if test="editor != null">editor,</if>
<if test="summary != null">summary,</if>
<if test="status != null">status,</if>
<if test="publishDate != null">publish_date,</if>
<if test="offlineDate != null">offline_date,</if>
2024-07-22 11:21:29 +08:00
<if test="isAccessory != null">is_accessory,</if>
<if test="accessoryUrl != null">accessory_url,</if>
<if test="remark != null">remark,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
2024-07-22 17:30:34 +08:00
</trim>
2024-07-22 11:21:29 +08:00
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="categoryId != null">#{categoryId},</if>
2024-07-22 17:30:34 +08:00
<if test="contentType != null">#{contentType},</if>
2024-07-22 11:21:29 +08:00
<if test="contentTitle != null and contentTitle != ''">#{contentTitle},</if>
<if test="contentImg != null">#{contentImg},</if>
2024-07-22 17:30:34 +08:00
<if test="contentDetail != null">#{contentDetail},</if>
<if test="source != null">#{source},</if>
<if test="sourceUrl != null">#{sourceUrl},</if>
<if test="original != null">#{original},</if>
<if test="author != null">#{author},</if>
<if test="editor != null">#{editor},</if>
<if test="summary != null">#{summary},</if>
<if test="status != null">#{status},</if>
<if test="publishDate != null">#{publishDate},</if>
<if test="offlineDate != null">#{offlineDate},</if>
2024-07-22 11:21:29 +08:00
<if test="isAccessory != null">#{isAccessory},</if>
<if test="accessoryUrl != null">#{accessoryUrl},</if>
<if test="remark != null">#{remark},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
2024-07-22 17:30:34 +08:00
</trim>
2024-07-22 11:21:29 +08:00
</insert>
<update id="updateCmsContent" parameterType="CmsContent">
update cms_content
<trim prefix="SET" suffixOverrides=",">
<if test="categoryId != null">category_id = #{categoryId},</if>
2024-07-22 17:30:34 +08:00
<if test="contentType != null">content_type = #{contentType},</if>
2024-07-22 11:21:29 +08:00
<if test="contentTitle != null and contentTitle != ''">content_title = #{contentTitle},</if>
<if test="contentImg != null">content_img = #{contentImg},</if>
2024-07-22 17:30:34 +08:00
<if test="contentDetail != null">content_detail = #{contentDetail},</if>
<if test="source != null">source = #{source},</if>
<if test="sourceUrl != null">source_url = #{sourceUrl},</if>
<if test="original != null">original = #{original},</if>
<if test="author != null">author = #{author},</if>
<if test="editor != null">editor = #{editor},</if>
<if test="summary != null">summary = #{summary},</if>
<if test="status != null">status = #{status},</if>
<if test="publishDate != null">publish_date = #{publishDate},</if>
<if test="offlineDate != null">offline_date = #{offlineDate},</if>
2024-07-22 11:21:29 +08:00
<if test="isAccessory != null">is_accessory = #{isAccessory},</if>
<if test="accessoryUrl != null">accessory_url = #{accessoryUrl},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCmsContentById" parameterType="Long">
delete from cms_content where id = #{id}
</delete>
<delete id="deleteCmsContentByIds" parameterType="String">
2024-07-22 17:30:34 +08:00
delete from cms_content where id in
2024-07-22 11:21:29 +08:00
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>