2025-09-29 10:37:12 +08:00
|
|
|
<?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.video.mapper.VModelMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap id="VModelResult" type="com.ruoyi.video.domain.VModel">
|
|
|
|
|
<id property="modelId" column="model_id" />
|
|
|
|
|
<result property="modelName" column="model_name" />
|
|
|
|
|
<result property="version" column="version" />
|
|
|
|
|
<result property="framework" column="framework" />
|
|
|
|
|
<result property="url" column="url" />
|
|
|
|
|
<result property="fileSize" column="file_size" />
|
|
|
|
|
<result property="checksum" column="checksum" />
|
|
|
|
|
<result property="enabled" column="enabled" />
|
|
|
|
|
<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" />
|
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<insert id="insertModel" parameterType="com.ruoyi.video.domain.VModel" useGeneratedKeys="true" keyProperty="modelId">
|
|
|
|
|
INSERT INTO v_model (
|
|
|
|
|
model_name, version, framework, url, file_size, checksum, enabled,
|
|
|
|
|
create_by, create_time, update_by, update_time, remark, del_flag
|
|
|
|
|
) VALUES (
|
|
|
|
|
#{modelName}, #{version}, #{framework}, #{url}, #{fileSize}, #{checksum}, #{enabled},
|
|
|
|
|
#{createBy}, NOW(), #{updateBy}, NOW(), #{remark}, #{delFlag}
|
|
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<select id="selectModelById" parameterType="long" resultMap="VModelResult">
|
|
|
|
|
SELECT * FROM v_model WHERE model_id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
2025-09-29 13:25:54 +08:00
|
|
|
<update id="updateModel" parameterType="com.ruoyi.video.domain.VModel">
|
|
|
|
|
UPDATE v_model
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="modelName != null and modelName != ''">model_name = #{modelName},</if>
|
|
|
|
|
<if test="version != null">version = #{version},</if>
|
|
|
|
|
<if test="framework != null and framework != ''">framework = #{framework},</if>
|
|
|
|
|
<if test="url != null and url != ''">url = #{url},</if>
|
|
|
|
|
<if test="fileSize != null">file_size = #{fileSize},</if>
|
|
|
|
|
<if test="checksum != null">checksum = #{checksum},</if>
|
|
|
|
|
<if test="enabled != null">enabled = #{enabled},</if>
|
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
update_time = NOW()
|
|
|
|
|
</trim>
|
|
|
|
|
WHERE model_id = #{modelId}
|
|
|
|
|
</update>
|
|
|
|
|
|
2025-09-29 10:37:12 +08:00
|
|
|
<delete id="deleteModelById" parameterType="long">
|
|
|
|
|
DELETE FROM v_model WHERE model_id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<update id="updateEnabled">
|
|
|
|
|
UPDATE v_model SET enabled = #{enabled}, update_time = NOW() WHERE model_id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<select id="selectModelList" parameterType="map" resultMap="VModelResult">
|
|
|
|
|
SELECT * FROM v_model
|
|
|
|
|
<where>
|
|
|
|
|
<if test="modelName != null and modelName != ''">
|
|
|
|
|
AND model_name LIKE CONCAT('%', #{modelName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="framework != null and framework != ''">
|
|
|
|
|
AND framework = #{framework}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="enabled != null">
|
|
|
|
|
AND enabled = #{enabled}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="keyword != null and keyword != ''">
|
|
|
|
|
AND (
|
|
|
|
|
model_name LIKE CONCAT('%', #{keyword}, '%')
|
|
|
|
|
OR version LIKE CONCAT('%', #{keyword}, '%')
|
|
|
|
|
OR url LIKE CONCAT('%', #{keyword}, '%')
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
ORDER BY create_time DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|