You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
4.9 KiB
XML

<?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.portal.mapper.HwWebDocumentMapper">
<resultMap type="HwWebDocument" id="HwWebDocumentResult">
<result property="documentId" column="document_id" />
<result property="tenantId" column="tenant_id" />
<result property="documentAddress" column="document_address" />
<result property="createTime" column="create_time" />
<result property="webCode" column="web_code" />
<result property="secretKey" column="secretKey" />
<result property="json" column="json" />
<result property="type" column="type" />
<result property="isDelete" column="is_delete" />
</resultMap>
<sql id="selectHwWebDocumentVo">
select document_id, tenant_id, document_address, create_time, web_code, secretKey ,
json, type,
is_delete
from hw_web_document
</sql>
<select id="selectHwWebDocumentList" parameterType="HwWebDocument" resultMap="HwWebDocumentResult">
<include refid="selectHwWebDocumentVo"/>
<where>
and is_delete = '0'
<if test="documentId != null "> and document_id = #{documentId}</if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
<if test="documentAddress != null and documentAddress != ''"> and document_address = #{documentAddress}</if>
<if test="webCode != null and webCode != ''"> and web_code = #{webCode}</if>
<if test="secretKey != null and secretKey != ''"> and secretKey = #{secretKey}</if>
<if test="json != null and json != ''"> and json = #{json}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
</where>
</select>
<select id="selectHwWebDocumentByDocumentId" parameterType="String" resultMap="HwWebDocumentResult">
<include refid="selectHwWebDocumentVo"/>
where is_delete = '0' and document_id = #{documentId}
</select>
<insert id="insertHwWebDocument" parameterType="HwWebDocument" useGeneratedKeys="true" keyProperty="documentId">
insert into hw_web_document
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="documentId != null">document_id,</if>
<if test="tenantId != null">tenant_id,</if>
<if test="documentAddress != null">document_address,</if>
<if test="createTime != null">create_time,</if>
<if test="webCode != null">web_code,</if>
<if test="secretKey != null">secretKey,</if>
<if test="json != null">json,</if>
<if test="type != null">type,</if>
is_delete,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="documentId != null">#{documentId},</if>
<if test="tenantId != null">#{tenantId},</if>
<if test="documentAddress != null">#{documentAddress},</if>
<if test="createTime != null">#{createTime},</if>
<if test="webCode != null">#{webCode},</if>
<if test="secretKey != null">#{secretKey},</if>
<if test="json != null">#{json},</if>
<if test="type != null">#{type},</if>
<choose>
<when test="isDelete != null and isDelete != ''">#{isDelete},</when>
<otherwise>'0',</otherwise>
</choose>
</trim>
</insert>
<update id="updateHwWebDocument" parameterType="HwWebDocument">
update hw_web_document
<trim prefix="SET" suffixOverrides=",">
<if test="documentId != null">document_id = #{documentId},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="documentAddress != null">document_address = #{documentAddress},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="webCode != null">web_code = #{webCode},</if>
<if test="secretKey != null">
secretKey = <choose>
<when test="secretKey == ''">NULL</when>
<otherwise>#{secretKey}</otherwise>
</choose>,
</if>
<if test="json != null">json = #{json},</if>
<if test="type != null">type = #{type},</if>
</trim>
where document_id = #{documentId}
</update>
<update id="deleteHwWebDocumentByDocumentId" parameterType="String">
update hw_web_document set is_delete = '1' where document_id = #{documentId}
</update>
<update id="deleteHwWebDocumentByDocumentIds" parameterType="String">
update hw_web_document set is_delete = '1' where document_id in
<foreach item="documentId" collection="array" open="(" separator="," close=")">
#{documentId}
</foreach>
</update>
</mapper>