You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
2.4 KiB
57 lines
2.4 KiB
package com.mh.user.mapper; |
|
|
|
import com.mh.user.entity.KnowledgeDataEntity; |
|
import org.apache.ibatis.annotations.*; |
|
|
|
import java.util.List; |
|
|
|
/** |
|
* @author LJF |
|
* @version 1.0 |
|
* @project CHWS |
|
* @description 知识库管理 |
|
* @date 2024-06-26 14:21:47 |
|
*/ |
|
@Mapper |
|
public interface KnowledgeDataMapper { |
|
|
|
@Insert("insert into knowledge_data(title,description,content,create_time,status,remark) " + |
|
" values(#{title},#{description},#{content},getDate(),#{status},#{remark})") |
|
void insertKnowledgeData(KnowledgeDataEntity knowledgeData); |
|
|
|
@Results({ |
|
@Result(column = "id",property = "id" ), |
|
@Result(column = "title", property = "title"), |
|
@Result(column = "description", property = "description"), |
|
@Result(column = "content", property = "content"), |
|
@Result(column = "create_time", property = "createTime"), |
|
@Result(column = "status", property = "status"), |
|
@Result(column = "remark", property = "remark") |
|
}) |
|
@Select("select id,title,description,content,create_time,status,remark from knowledge_data order by create_time desc") |
|
List<KnowledgeDataEntity> findPage(); |
|
|
|
@Update("<script>" + |
|
" update knowledge_data set " + |
|
" <if test='title!=null'> title = #{title} </if>" + |
|
" <if test='description!=null'> , description = #{description} </if>" + |
|
" <if test='content!=null'> , content = #{content} </if>" + |
|
" <if test='createTime!=null'> , create_time = #{createTime} </if>" + |
|
" <if test='status!=null'> , status = #{status} </if>" + |
|
" <if test='remark!=null'> , remark = #{remark} </if>" + |
|
" where id = #{id} " + |
|
"</script>") |
|
void updateData(KnowledgeDataEntity knowledgeData); |
|
|
|
@Results({ |
|
@Result(column = "id",property = "id" ), |
|
@Result(column = "title", property = "title"), |
|
@Result(column = "description", property = "description"), |
|
@Result(column = "content", property = "content"), |
|
@Result(column = "create_time", property = "createTime"), |
|
@Result(column = "status", property = "status"), |
|
@Result(column = "remark", property = "remark") |
|
}) |
|
@Select("select id,title,description,content,create_time,status,remark from knowledge_data where id = #{id} order by create_time desc") |
|
KnowledgeDataEntity getById(@Param("id") Long id); |
|
}
|
|
|