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.
117 lines
6.5 KiB
117 lines
6.5 KiB
<?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.zdxt.knowledge.mapper.KnowledgeLibraryMapper">
|
|
|
|
<resultMap type="com.zdxt.knowledge.domain.KnowledgeLibrary" id="KnowledgeLibraryResult">
|
|
<result property="guid" column="guid" />
|
|
<result property="title" column="title" />
|
|
<result property="subTitle" column="sub_title" />
|
|
<result property="content" column="content" />
|
|
<result property="flag" column="flag" />
|
|
<result property="srot" column="srot" />
|
|
<result property="state" column="state" />
|
|
<result property="publishdate" column="publishDate" />
|
|
<result property="publishstate" column="publishState" />
|
|
<result property="examinestate" column="examineState" />
|
|
<result property="creator" column="creator" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updator" column="updator" />
|
|
<result property="updateTime" column="update_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectKnowledgeLibraryVo">
|
|
select guid, title, sub_title, content, flag, srot, state, publishDate, publishState, examineState, creator, create_time, updator, update_time from knowledge_library
|
|
</sql>
|
|
|
|
<select id="selectKnowledgeLibraryList" parameterType="KnowledgeLibrary" resultMap="KnowledgeLibraryResult">
|
|
<include refid="selectKnowledgeLibraryVo"/>
|
|
<where>
|
|
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
|
|
<if test="subTitle != null and subTitle != ''"> and sub_title like concat('%', #{subTitle}, '%')</if>
|
|
<if test="content != null and content != ''"> and content = #{content}</if>
|
|
<if test="flag != null and flag != ''"> and flag = #{flag}</if>
|
|
<if test="srot != null "> and srot = #{srot}</if>
|
|
<if test="state != null and state != ''"> and state = #{state}</if>
|
|
<if test="publishdate != null and publishdate != ''"> and publishDate = #{publishdate}</if>
|
|
<if test="publishstate != null "> and publishState = #{publishstate}</if>
|
|
<if test="examinestate != null "> and examineState = #{examinestate}</if>
|
|
<if test="creator != null and creator != ''"> and creator = #{creator}</if>
|
|
<if test="updator != null and updator != ''"> and updator = #{updator}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectKnowledgeLibraryById" parameterType="String" resultMap="KnowledgeLibraryResult">
|
|
<include refid="selectKnowledgeLibraryVo"/>
|
|
where guid = #{guid}
|
|
</select>
|
|
|
|
<insert id="insertKnowledgeLibrary" parameterType="KnowledgeLibrary">
|
|
insert into knowledge_library
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="guid != null and guid != ''">guid,</if>
|
|
<if test="title != null and title != ''">title,</if>
|
|
<if test="subTitle != null and subTitle != ''">sub_title,</if>
|
|
<if test="content != null and content != ''">content,</if>
|
|
<if test="flag != null and flag != ''">flag,</if>
|
|
<if test="srot != null ">srot,</if>
|
|
<if test="state != null and state != ''">state,</if>
|
|
<if test="publishdate != null and publishdate != ''">publishDate,</if>
|
|
<if test="publishstate != null ">publishState,</if>
|
|
<if test="examinestate != null ">examineState,</if>
|
|
<if test="creator != null and creator != ''">creator,</if>
|
|
<if test="createTime != null ">create_time,</if>
|
|
<if test="updator != null and updator != ''">updator,</if>
|
|
<if test="updateTime != null ">update_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="guid != null and guid != ''">#{guid},</if>
|
|
<if test="title != null and title != ''">#{title},</if>
|
|
<if test="subTitle != null and subTitle != ''">#{subTitle},</if>
|
|
<if test="content != null and content != ''">#{content},</if>
|
|
<if test="flag != null and flag != ''">#{flag},</if>
|
|
<if test="srot != null ">#{srot},</if>
|
|
<if test="state != null and state != ''">#{state},</if>
|
|
<if test="publishdate != null and publishdate != ''">#{publishdate},</if>
|
|
<if test="publishstate != null ">#{publishstate},</if>
|
|
<if test="examinestate != null ">#{examinestate},</if>
|
|
<if test="creator != null and creator != ''">#{creator},</if>
|
|
<if test="createTime != null ">#{createTime},</if>
|
|
<if test="updator != null and updator != ''">#{updator},</if>
|
|
<if test="updateTime != null ">#{updateTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateKnowledgeLibrary" parameterType="KnowledgeLibrary">
|
|
update knowledge_library
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="title != null and title != ''">title = #{title},</if>
|
|
<if test="subTitle != null and subTitle != ''">sub_title = #{subTitle},</if>
|
|
<if test="content != null and content != ''">content = #{content},</if>
|
|
<if test="flag != null and flag != ''">flag = #{flag},</if>
|
|
<if test="srot != null ">srot = #{srot},</if>
|
|
<if test="state != null and state != ''">state = #{state},</if>
|
|
<if test="publishdate != null and publishdate != ''">publishDate = #{publishdate},</if>
|
|
<if test="publishstate != null ">publishState = #{publishstate},</if>
|
|
<if test="examinestate != null ">examineState = #{examinestate},</if>
|
|
<if test="creator != null and creator != ''">creator = #{creator},</if>
|
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
|
<if test="updator != null and updator != ''">updator = #{updator},</if>
|
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
|
</trim>
|
|
where guid = #{guid}
|
|
</update>
|
|
|
|
<delete id="deleteKnowledgeLibraryById" parameterType="String">
|
|
delete from knowledge_library where guid = #{guid}
|
|
</delete>
|
|
|
|
<delete id="deleteKnowledgeLibraryByIds" parameterType="String">
|
|
delete from knowledge_library where guid in
|
|
<foreach item="guid" collection="array" open="(" separator="," close=")">
|
|
#{guid}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper>
|