124 lines
6.1 KiB
XML
124 lines
6.1 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.system.mapper.HuayangResourceMapper">
|
|
|
|
<resultMap type="com.ruoyi.system.domain.HuayangResource" id="HuayangResourceResult">
|
|
<result property="resourceId" column="resource_id"/>
|
|
<result property="resourceName" column="resource_name"/>
|
|
<result property="resourceUrl" column="resource_url"/>
|
|
<result property="resourceType" column="resource_type"/>
|
|
<result property="fileSize" column="file_size"/>
|
|
<result property="fileExt" column="file_ext"/>
|
|
<result property="width" column="width"/>
|
|
<result property="height" column="height"/>
|
|
<result property="groupId" column="group_id"/>
|
|
<result property="tag" column="tag"/>
|
|
<result property="uploadBy" column="upload_by"/>
|
|
<result property="uploadTime" column="upload_time"/>
|
|
<result property="status" column="status"/>
|
|
<result property="createBy" column="create_by"/>
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="updateBy" column="update_by"/>
|
|
<result property="updateTime" column="update_time"/>
|
|
<result property="remark" column="remark"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectHuayangResourceVo">
|
|
SELECT r.resource_id, r.resource_name, r.resource_url, r.resource_type, r.file_size, r.file_ext,
|
|
r.width, r.height, r.group_id, r.tag, r.upload_by, r.upload_time, r.status,
|
|
r.create_by, r.create_time, r.update_by, r.update_time, r.remark,
|
|
g.group_name
|
|
FROM huayang_resource r
|
|
LEFT JOIN huayang_resource_group g ON r.group_id = g.group_id
|
|
</sql>
|
|
|
|
<select id="selectHuayangResourceList" parameterType="com.ruoyi.system.domain.HuayangResource" resultMap="HuayangResourceResult">
|
|
<include refid="selectHuayangResourceVo"/>
|
|
<where>
|
|
<if test="resourceName != null and resourceName != ''">
|
|
AND r.resource_name LIKE CONCAT('%', #{resourceName}, '%')
|
|
</if>
|
|
<if test="resourceType != null and resourceType != ''">
|
|
AND r.resource_type = #{resourceType}
|
|
</if>
|
|
<if test="groupId != null">
|
|
AND r.group_id = #{groupId}
|
|
</if>
|
|
<if test="status != null and status != ''">
|
|
AND r.status = #{status}
|
|
</if>
|
|
</where>
|
|
ORDER BY r.upload_time DESC
|
|
</select>
|
|
|
|
<select id="selectHuayangResourceById" parameterType="Long" resultMap="HuayangResourceResult">
|
|
<include refid="selectHuayangResourceVo"/>
|
|
WHERE r.resource_id = #{resourceId}
|
|
</select>
|
|
|
|
<insert id="insertHuayangResource" parameterType="com.ruoyi.system.domain.HuayangResource" useGeneratedKeys="true" keyProperty="resourceId">
|
|
INSERT INTO huayang_resource
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="resourceName != null and resourceName != ''">resource_name,</if>
|
|
<if test="resourceUrl != null and resourceUrl != ''">resource_url,</if>
|
|
<if test="resourceType != null and resourceType != ''">resource_type,</if>
|
|
<if test="fileSize != null">file_size,</if>
|
|
<if test="fileExt != null">file_ext,</if>
|
|
<if test="width != null">width,</if>
|
|
<if test="height != null">height,</if>
|
|
<if test="groupId != null">group_id,</if>
|
|
<if test="tag != null">tag,</if>
|
|
<if test="uploadBy != null">upload_by,</if>
|
|
<if test="uploadTime != null">upload_time,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="resourceName != null and resourceName != ''">#{resourceName},</if>
|
|
<if test="resourceUrl != null and resourceUrl != ''">#{resourceUrl},</if>
|
|
<if test="resourceType != null and resourceType != ''">#{resourceType},</if>
|
|
<if test="fileSize != null">#{fileSize},</if>
|
|
<if test="fileExt != null">#{fileExt},</if>
|
|
<if test="width != null">#{width},</if>
|
|
<if test="height != null">#{height},</if>
|
|
<if test="groupId != null">#{groupId},</if>
|
|
<if test="tag != null">#{tag},</if>
|
|
<if test="uploadBy != null">#{uploadBy},</if>
|
|
<if test="uploadTime != null">#{uploadTime},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateHuayangResource" parameterType="com.ruoyi.system.domain.HuayangResource">
|
|
UPDATE huayang_resource
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="resourceName != null and resourceName != ''">resource_name = #{resourceName},</if>
|
|
<if test="resourceUrl != null and resourceUrl != ''">resource_url = #{resourceUrl},</if>
|
|
<if test="resourceType != null and resourceType != ''">resource_type = #{resourceType},</if>
|
|
<if test="fileSize != null">file_size = #{fileSize},</if>
|
|
<if test="fileExt != null">file_ext = #{fileExt},</if>
|
|
<if test="width != null">width = #{width},</if>
|
|
<if test="height != null">height = #{height},</if>
|
|
<if test="groupId != null">group_id = #{groupId},</if>
|
|
<if test="tag != null">tag = #{tag},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
</trim>
|
|
WHERE resource_id = #{resourceId}
|
|
</update>
|
|
|
|
<delete id="deleteHuayangResourceById" parameterType="Long">
|
|
DELETE FROM huayang_resource WHERE resource_id = #{resourceId}
|
|
</delete>
|
|
|
|
<delete id="deleteHuayangResourceByIds" parameterType="Long">
|
|
DELETE FROM huayang_resource WHERE resource_id IN
|
|
<foreach item="resourceId" collection="array" open="(" separator="," close=")">
|
|
#{resourceId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper> |