动态管理

This commit is contained in:
pserimal
2023-06-08 16:49:28 +08:00
parent e86f563d44
commit e87d2948f4
10 changed files with 415 additions and 55 deletions

View File

@@ -100,40 +100,69 @@
<update id="updateByPrimaryKeySelective">
update hy_content_info
<set>
<if test="record.contentTitle != null">
<if test="record.contentTitle != null and record.contentTitle != ''">
content_title = #{record.contentTitle},
</if>
<if test="record.subject != null">
<if test="record.subject != null and record.subject != ''">
subject = #{record.subject},
</if>
<if test="record.contentType != null">
<if test="record.contentType != null and record.contentType != ''">
content_type = #{record.contentType},
</if>
<if test="record.cover != null">
<if test="record.cover != null and record.cover != ''">
cover = #{record.cover},
</if>
<if test="record.status != null">
<if test="record.status != null and record.status != null">
status = #{record.status},
</if>
<if test="record.deleted != null">
<if test="record.deleted != null and record.deleted != ''">
deleted = #{record.deleted},
</if>
<if test="record.createTime != null">
<if test="record.createTime != null and record.createTime != ''">
create_time = #{record.createTime},
</if>
<if test="record.updateTime != null">
<if test="record.updateTime != null and record.updateTime != ''">
update_time = #{record.updateTime},
</if>
<if test="record.createUserId != null">
<if test="record.createUserId != null and record.createUserId != ''">
create_user_id = #{record.createUserId},
</if>
<if test="record.updateUserId != null">
<if test="record.updateUserId != null and record.updateUserId != ''">
update_user_id = #{record.updateUserId},
</if>
<if test="record.content != null">
<if test="record.content != null and record.content != ''">
content = #{record.content},
</if>
</set>
where id = #{record.id}
</update>
<update id="deleteSelective">
update hy_content_info
<set>
deleted = 1
</set>
where id = #{contentId}
</update>
<select id="queryContentList" resultType="com.cool.store.entity.HyContentInfoDO">
select <include refid="Base_Column_List"></include>
from hy_content_info
where deleted = 0
<if test="contentTitle != null and contentTitle != ''">
and content_title like concat('%', #{contentTitle}, '%')
</if>
<if test="subject != null and subject != ''">
and subject = #{subject}
</if>
<if test="contentType != null and contentType != ''">
and content_type = #{contentType}
</if>
</select>
<!-- 查询动态详情 -->
<select id="queryContentInfo" resultType="com.cool.store.entity.HyContentInfoDO">
select <include refid="Base_Column_List"></include>
from hy_content_info
where deleted = 0
and id = #{contentId}
</select>
</mapper>