mcwl-ai/mcwl-resource/src/main/resources/mapper/resource/ModelVersionMapper.xml

37 lines
1.7 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.mcwl.resource.mapper.ModelVersionMapper">
<insert id="addModelVersion">
INSERT INTO model_version (
model_id,version_name, model_type, file_path, trigger_words, sampling, high, vae, cfg,
is_free, is_public, is_encrypt, is_online_use, allow_download_image,
allow_software_use, allow_fusion, allow_commercial_use, allow_usage,
is_exclusive_model, sample_image_paths, hide_image_gen_info, audit_status,
audit_text, del_flag
)
VALUES
<foreach collection="modelVersionList" item="item" separator=",">
(
#{modelProduct.id},#{item.versionName}, #{item.modelType}, #{item.filePath}, #{item.triggerWords},
#{item.sampling}, #{item.high}, #{item.vae}, #{item.cfg},
#{item.isFree}, #{item.isPublic}, #{item.isEncrypt}, #{item.isOnlineUse},
#{item.allowDownloadImage}, #{item.allowSoftwareUse}, #{item.allowFusion},
#{item.allowCommercialUse}, #{item.allowUsage}, #{item.isExclusiveModel},
#{item.sampleImagePaths}, #{item.hideImageGenInfo}, 3,
#{item.auditText},'0'
)
</foreach>
</insert>
<update id="updateByName">
update model_version set audit_status = #{auditStatus},
audit_text = #{auditText}
where version_name = #{versionName} and model_id = #{modelId}
</update>
</mapper>