<?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.interfaces.mapper.MdModelInfoMapper">

    <resultMap type="com.ruoyi.interfaces.domain.MdModelInfo" id="MdModelInfoResult">
        <result property="mdid"    column="MDID"    />
        <result property="name"    column="NAME"    />
        <result property="enname"    column="ENNAME"    />
        <result property="cateid"    column="CATEID"    />
        <result property="devlang"    column="DEVLANG"    />
        <result property="version"    column="VERSION"    />
        <result property="intro"    column="INTRO"    />
        <result property="type"    column="TYPE"    />
        <result property="tags"    column="TAGS"    />
        <result property="author"    column="AUTHOR"    />
        <result property="ispublic"    column="ISPUBLIC"    />
        <result property="isapproved"    column="ISAPPROVED"    />
        <result property="status"    column="STATUS"    />
        <result property="classname"    column="CLASSNAME"    />
        <result property="mdRunCmd"    column="MD_RUN_CMD"    />
        <result property="mdUrl"    column="MD_URL"    />
        <result property="mdAuth"    column="MD_AUTH"    />
        <result property="mdHeader"    column="MD_HEADER"    />
        <result property="mdSecret"    column="MD_SECRET"    />
        <result property="mdUnit"    column="MD_UNIT"    />
        <result property="mdContact"    column="MD_CONTACT"    />
        <result property="devUnit"    column="DEV_UNIT"    />
        <result property="devContact"    column="DEV_CONTACT"    />
        <result property="whFlag"    column="WH_FLAG"    />
        <result property="whUrl"    column="WH_URL"    />
        <result property="whMethod"    column="WH_METHOD"    />
        <result property="whAuth"    column="WH_AUTH"    />
        <result property="whHeader"    column="WH_HEADER"    />
        <result property="whSecret"    column="WH_SECRET"    />
        <result property="envOs"    column="ENV_OS"    />
        <result property="evnArmX86"    column="EVN_ARM_X86"    />
        <result property="envCpu"    column="ENV_CPU"    />
        <result property="envGpuType"    column="ENV_GPU_TYPE"    />
        <result property="envGpuNum"    column="ENV_GPU_NUM"    />
        <result property="envGpuMem"    column="ENV_GPU_MEM"    />
        <result property="envDisk"    column="ENV_DISK"    />
        <result property="envMem"    column="ENV_MEM"    />
        <result property="deployIp"    column="DEPLOY_IP"    />
        <result property="deployDir"    column="DEPLOY_DIR"    />
        <result property="deployPort"    column="DEPLOY_PORT"    />
        <result property="deployNote"    column="DEPLOY_NOTE"    />
        <result property="mdInName"    column="MD_IN_NAME"    />
        <result property="mdInFile"    column="MD_IN_FILE"    />
        <result property="mdInNote"    column="MD_IN_NOTE"    />
        <result property="mdOutName"    column="MD_OUT_NAME"    />
        <result property="mdOutFile"    column="MD_OUT_FILE"    />
        <result property="mdOutNote"    column="MD_OUT_NOTE"    />
        <result property="mirrorImageName"    column="MIRROR_IMAGE_NAME"    />
        <result property="mirrorImageUrl"    column="MIRROR_IMAGE_URL"    />
        <result property="mirrorImageDesc"    column="MIRROR_IMAGE_DESC"    />
        <result property="mdAuthUrl"    column="MD_AUTH_URL"    />
        <result property="createby"    column="CREATEBY"    />
        <result property="modifyby"    column="MODIFYBY"    />
        <result property="regUser"    column="REG_USER"    />
        <result property="sort"    column="SORT"    />
    </resultMap>

    <sql id="selectMdModelInfoVo">
        select MDID, NAME, ENNAME, CATEID, DEVLANG, VERSION, INTRO, TYPE, TAGS, AUTHOR, ISPUBLIC, ISAPPROVED, STATUS, CLASSNAME, MD_RUN_CMD, MD_URL, MD_AUTH, MD_HEADER, MD_SECRET, MD_UNIT, MD_CONTACT, DEV_UNIT, DEV_CONTACT, WH_FLAG, WH_URL, WH_METHOD, WH_AUTH, WH_HEADER, WH_SECRET, ENV_OS, EVN_ARM_X86, ENV_CPU, ENV_GPU_TYPE, ENV_GPU_NUM, ENV_GPU_MEM, ENV_DISK, ENV_MEM, DEPLOY_IP, DEPLOY_DIR, DEPLOY_PORT, DEPLOY_NOTE, MD_IN_NAME, MD_IN_FILE, MD_IN_NOTE, MD_OUT_NAME, MD_OUT_FILE, MD_OUT_NOTE, MIRROR_IMAGE_NAME, MIRROR_IMAGE_URL, MIRROR_IMAGE_DESC, MD_AUTH_URL, CREATEBY, MODIFYBY, REG_USER,SORT from md_model_info
    </sql>

    <select id="selectMdModelInfoList" parameterType="com.ruoyi.interfaces.domain.MdModelInfo" resultMap="MdModelInfoResult">
        <include refid="selectMdModelInfoVo"/>
        <where>
            <if test="name != null  and name != ''"> and NAME like concat('%', #{name}, '%')</if>
            <if test="enname != null  and enname != ''"> and ENNAME like concat('%', #{enname}, '%')</if>
            <if test="cateid != null  and cateid != ''"> and CATEID = #{cateid}</if>
            <if test="devlang != null  and devlang != ''"> and DEVLANG = #{devlang}</if>
            <if test="version != null  and version != ''"> and VERSION = #{version}</if>
            <if test="intro != null  and intro != ''"> and INTRO = #{intro}</if>
            <if test="type != null  and type != ''"> and TYPE = #{type}</if>
            <if test="tags != null  and tags != ''"> and TAGS = #{tags}</if>
            <if test="author != null  and author != ''"> and AUTHOR = #{author}</if>
            <if test="ispublic != null "> and ISPUBLIC = #{ispublic}</if>
            <if test="isapproved != null "> and ISAPPROVED = #{isapproved}</if>
            <if test="status != null "> and STATUS = #{status}</if>
            <if test="classname != null  and classname != ''"> and CLASSNAME like concat('%', #{classname}, '%')</if>
            <if test="mdRunCmd != null  and mdRunCmd != ''"> and MD_RUN_CMD = #{mdRunCmd}</if>
            <if test="mdUrl != null  and mdUrl != ''"> and MD_URL = #{mdUrl}</if>
            <if test="mdAuth != null  and mdAuth != ''"> and MD_AUTH = #{mdAuth}</if>
            <if test="mdHeader != null  and mdHeader != ''"> and MD_HEADER = #{mdHeader}</if>
            <if test="mdSecret != null  and mdSecret != ''"> and MD_SECRET = #{mdSecret}</if>
            <if test="mdUnit != null  and mdUnit != ''"> and MD_UNIT = #{mdUnit}</if>
            <if test="mdContact != null  and mdContact != ''"> and MD_CONTACT = #{mdContact}</if>
            <if test="devUnit != null  and devUnit != ''"> and DEV_UNIT = #{devUnit}</if>
            <if test="devContact != null  and devContact != ''"> and DEV_CONTACT = #{devContact}</if>
            <if test="whFlag != null "> and WH_FLAG = #{whFlag}</if>
            <if test="whUrl != null  and whUrl != ''"> and WH_URL = #{whUrl}</if>
            <if test="whMethod != null  and whMethod != ''"> and WH_METHOD = #{whMethod}</if>
            <if test="whAuth != null  and whAuth != ''"> and WH_AUTH = #{whAuth}</if>
            <if test="whHeader != null  and whHeader != ''"> and WH_HEADER = #{whHeader}</if>
            <if test="whSecret != null  and whSecret != ''"> and WH_SECRET = #{whSecret}</if>
            <if test="envOs != null  and envOs != ''"> and ENV_OS = #{envOs}</if>
            <if test="evnArmX86 != null  and evnArmX86 != ''"> and EVN_ARM_X86 = #{evnArmX86}</if>
            <if test="envCpu != null "> and ENV_CPU = #{envCpu}</if>
            <if test="envGpuType != null  and envGpuType != ''"> and ENV_GPU_TYPE = #{envGpuType}</if>
            <if test="envGpuNum != null "> and ENV_GPU_NUM = #{envGpuNum}</if>
            <if test="envGpuMem != null "> and ENV_GPU_MEM = #{envGpuMem}</if>
            <if test="envDisk != null "> and ENV_DISK = #{envDisk}</if>
            <if test="envMem != null "> and ENV_MEM = #{envMem}</if>
            <if test="deployIp != null  and deployIp != ''"> and DEPLOY_IP = #{deployIp}</if>
            <if test="deployDir != null  and deployDir != ''"> and DEPLOY_DIR = #{deployDir}</if>
            <if test="deployPort != null  and deployPort != ''"> and DEPLOY_PORT = #{deployPort}</if>
            <if test="deployNote != null  and deployNote != ''"> and DEPLOY_NOTE = #{deployNote}</if>
            <if test="mdInName != null  and mdInName != ''"> and MD_IN_NAME like concat('%', #{mdInName}, '%')</if>
            <if test="mdInFile != null  and mdInFile != ''"> and MD_IN_FILE = #{mdInFile}</if>
            <if test="mdInNote != null  and mdInNote != ''"> and MD_IN_NOTE = #{mdInNote}</if>
            <if test="mdOutName != null  and mdOutName != ''"> and MD_OUT_NAME like concat('%', #{mdOutName}, '%')</if>
            <if test="mdOutFile != null  and mdOutFile != ''"> and MD_OUT_FILE = #{mdOutFile}</if>
            <if test="mdOutNote != null  and mdOutNote != ''"> and MD_OUT_NOTE = #{mdOutNote}</if>
            <if test="mirrorImageName != null  and mirrorImageName != ''"> and MIRROR_IMAGE_NAME like concat('%', #{mirrorImageName}, '%')</if>
            <if test="mirrorImageUrl != null  and mirrorImageUrl != ''"> and MIRROR_IMAGE_URL = #{mirrorImageUrl}</if>
            <if test="mirrorImageDesc != null  and mirrorImageDesc != ''"> and MIRROR_IMAGE_DESC = #{mirrorImageDesc}</if>
            <if test="mdAuthUrl != null  and mdAuthUrl != ''"> and MD_AUTH_URL = #{mdAuthUrl}</if>
            <if test="createby != null "> and CREATEBY = #{createby}</if>
            <if test="modifyby != null "> and MODIFYBY = #{modifyby}</if>
            <if test="regUser != null  and regUser != ''"> and REG_USER = #{regUser}</if>
            <if test="sort != null  and sort != ''"> and SORT = #{sort}</if>
        </where>
        order by SORT
    </select>

    <select id="selectMdModelInfoByMdid" parameterType="String" resultMap="MdModelInfoResult">
        <include refid="selectMdModelInfoVo"/>
        where MDID = #{mdid}
    </select>

    <insert id="insertMdModelInfo" parameterType="com.ruoyi.interfaces.domain.MdModelInfo">
        insert into md_model_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="mdid != null">MDID,</if>
            <if test="name != null">NAME,</if>
            <if test="enname != null">ENNAME,</if>
            <if test="cateid != null">CATEID,</if>
            <if test="devlang != null">DEVLANG,</if>
            <if test="version != null">VERSION,</if>
            <if test="intro != null">INTRO,</if>
            <if test="type != null">TYPE,</if>
            <if test="tags != null">TAGS,</if>
            <if test="author != null">AUTHOR,</if>
            <if test="ispublic != null">ISPUBLIC,</if>
            <if test="isapproved != null">ISAPPROVED,</if>
            <if test="status != null">STATUS,</if>
            <if test="classname != null">CLASSNAME,</if>
            <if test="mdRunCmd != null">MD_RUN_CMD,</if>
            <if test="mdUrl != null">MD_URL,</if>
            <if test="mdAuth != null">MD_AUTH,</if>
            <if test="mdHeader != null">MD_HEADER,</if>
            <if test="mdSecret != null">MD_SECRET,</if>
            <if test="mdUnit != null">MD_UNIT,</if>
            <if test="mdContact != null">MD_CONTACT,</if>
            <if test="devUnit != null">DEV_UNIT,</if>
            <if test="devContact != null">DEV_CONTACT,</if>
            <if test="whFlag != null">WH_FLAG,</if>
            <if test="whUrl != null">WH_URL,</if>
            <if test="whMethod != null">WH_METHOD,</if>
            <if test="whAuth != null">WH_AUTH,</if>
            <if test="whHeader != null">WH_HEADER,</if>
            <if test="whSecret != null">WH_SECRET,</if>
            <if test="envOs != null">ENV_OS,</if>
            <if test="evnArmX86 != null">EVN_ARM_X86,</if>
            <if test="envCpu != null">ENV_CPU,</if>
            <if test="envGpuType != null">ENV_GPU_TYPE,</if>
            <if test="envGpuNum != null">ENV_GPU_NUM,</if>
            <if test="envGpuMem != null">ENV_GPU_MEM,</if>
            <if test="envDisk != null">ENV_DISK,</if>
            <if test="envMem != null">ENV_MEM,</if>
            <if test="deployIp != null">DEPLOY_IP,</if>
            <if test="deployDir != null">DEPLOY_DIR,</if>
            <if test="deployPort != null">DEPLOY_PORT,</if>
            <if test="deployNote != null">DEPLOY_NOTE,</if>
            <if test="mdInName != null">MD_IN_NAME,</if>
            <if test="mdInFile != null">MD_IN_FILE,</if>
            <if test="mdInNote != null">MD_IN_NOTE,</if>
            <if test="mdOutName != null">MD_OUT_NAME,</if>
            <if test="mdOutFile != null">MD_OUT_FILE,</if>
            <if test="mdOutNote != null">MD_OUT_NOTE,</if>
            <if test="mirrorImageName != null">MIRROR_IMAGE_NAME,</if>
            <if test="mirrorImageUrl != null">MIRROR_IMAGE_URL,</if>
            <if test="mirrorImageDesc != null">MIRROR_IMAGE_DESC,</if>
            <if test="mdAuthUrl != null">MD_AUTH_URL,</if>
            <if test="createby != null">CREATEBY,</if>
            <if test="modifyby != null">MODIFYBY,</if>
            <if test="regUser != null">REG_USER,</if>
            <if test="sort != null">SORT,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="mdid != null">#{mdid},</if>
            <if test="name != null">#{name},</if>
            <if test="enname != null">#{enname},</if>
            <if test="cateid != null">#{cateid},</if>
            <if test="devlang != null">#{devlang},</if>
            <if test="version != null">#{version},</if>
            <if test="intro != null">#{intro},</if>
            <if test="type != null">#{type},</if>
            <if test="tags != null">#{tags},</if>
            <if test="author != null">#{author},</if>
            <if test="ispublic != null">#{ispublic},</if>
            <if test="isapproved != null">#{isapproved},</if>
            <if test="status != null">#{status},</if>
            <if test="classname != null">#{classname},</if>
            <if test="mdRunCmd != null">#{mdRunCmd},</if>
            <if test="mdUrl != null">#{mdUrl},</if>
            <if test="mdAuth != null">#{mdAuth},</if>
            <if test="mdHeader != null">#{mdHeader},</if>
            <if test="mdSecret != null">#{mdSecret},</if>
            <if test="mdUnit != null">#{mdUnit},</if>
            <if test="mdContact != null">#{mdContact},</if>
            <if test="devUnit != null">#{devUnit},</if>
            <if test="devContact != null">#{devContact},</if>
            <if test="whFlag != null">#{whFlag},</if>
            <if test="whUrl != null">#{whUrl},</if>
            <if test="whMethod != null">#{whMethod},</if>
            <if test="whAuth != null">#{whAuth},</if>
            <if test="whHeader != null">#{whHeader},</if>
            <if test="whSecret != null">#{whSecret},</if>
            <if test="envOs != null">#{envOs},</if>
            <if test="evnArmX86 != null">#{evnArmX86},</if>
            <if test="envCpu != null">#{envCpu},</if>
            <if test="envGpuType != null">#{envGpuType},</if>
            <if test="envGpuNum != null">#{envGpuNum},</if>
            <if test="envGpuMem != null">#{envGpuMem},</if>
            <if test="envDisk != null">#{envDisk},</if>
            <if test="envMem != null">#{envMem},</if>
            <if test="deployIp != null">#{deployIp},</if>
            <if test="deployDir != null">#{deployDir},</if>
            <if test="deployPort != null">#{deployPort},</if>
            <if test="deployNote != null">#{deployNote},</if>
            <if test="mdInName != null">#{mdInName},</if>
            <if test="mdInFile != null">#{mdInFile},</if>
            <if test="mdInNote != null">#{mdInNote},</if>
            <if test="mdOutName != null">#{mdOutName},</if>
            <if test="mdOutFile != null">#{mdOutFile},</if>
            <if test="mdOutNote != null">#{mdOutNote},</if>
            <if test="mirrorImageName != null">#{mirrorImageName},</if>
            <if test="mirrorImageUrl != null">#{mirrorImageUrl},</if>
            <if test="mirrorImageDesc != null">#{mirrorImageDesc},</if>
            <if test="mdAuthUrl != null">#{mdAuthUrl},</if>
            <if test="createby != null">#{createby},</if>
            <if test="modifyby != null">#{modifyby},</if>
            <if test="regUser != null">#{regUser},</if>
            <if test="sort != null">#{sort},</if>
        </trim>
    </insert>

    <update id="updateMdModelInfo" parameterType="com.ruoyi.interfaces.domain.MdModelInfo">
        update md_model_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="name != null">NAME = #{name},</if>
            <if test="enname != null">ENNAME = #{enname},</if>
            <if test="cateid != null">CATEID = #{cateid},</if>
            <if test="devlang != null">DEVLANG = #{devlang},</if>
            <if test="version != null">VERSION = #{version},</if>
            <if test="intro != null">INTRO = #{intro},</if>
            <if test="type != null">TYPE = #{type},</if>
            <if test="tags != null">TAGS = #{tags},</if>
            <if test="author != null">AUTHOR = #{author},</if>
            <if test="ispublic != null">ISPUBLIC = #{ispublic},</if>
            <if test="isapproved != null">ISAPPROVED = #{isapproved},</if>
            <if test="status != null">STATUS = #{status},</if>
            <if test="classname != null">CLASSNAME = #{classname},</if>
            <if test="mdRunCmd != null">MD_RUN_CMD = #{mdRunCmd},</if>
            <if test="mdUrl != null">MD_URL = #{mdUrl},</if>
            <if test="mdAuth != null">MD_AUTH = #{mdAuth},</if>
            <if test="mdHeader != null">MD_HEADER = #{mdHeader},</if>
            <if test="mdSecret != null">MD_SECRET = #{mdSecret},</if>
            <if test="mdUnit != null">MD_UNIT = #{mdUnit},</if>
            <if test="mdContact != null">MD_CONTACT = #{mdContact},</if>
            <if test="devUnit != null">DEV_UNIT = #{devUnit},</if>
            <if test="devContact != null">DEV_CONTACT = #{devContact},</if>
            <if test="whFlag != null">WH_FLAG = #{whFlag},</if>
            <if test="whUrl != null">WH_URL = #{whUrl},</if>
            <if test="whMethod != null">WH_METHOD = #{whMethod},</if>
            <if test="whAuth != null">WH_AUTH = #{whAuth},</if>
            <if test="whHeader != null">WH_HEADER = #{whHeader},</if>
            <if test="whSecret != null">WH_SECRET = #{whSecret},</if>
            <if test="envOs != null">ENV_OS = #{envOs},</if>
            <if test="evnArmX86 != null">EVN_ARM_X86 = #{evnArmX86},</if>
            <if test="envCpu != null">ENV_CPU = #{envCpu},</if>
            <if test="envGpuType != null">ENV_GPU_TYPE = #{envGpuType},</if>
            <if test="envGpuNum != null">ENV_GPU_NUM = #{envGpuNum},</if>
            <if test="envGpuMem != null">ENV_GPU_MEM = #{envGpuMem},</if>
            <if test="envDisk != null">ENV_DISK = #{envDisk},</if>
            <if test="envMem != null">ENV_MEM = #{envMem},</if>
            <if test="deployIp != null">DEPLOY_IP = #{deployIp},</if>
            <if test="deployDir != null">DEPLOY_DIR = #{deployDir},</if>
            <if test="deployPort != null">DEPLOY_PORT = #{deployPort},</if>
            <if test="deployNote != null">DEPLOY_NOTE = #{deployNote},</if>
            <if test="mdInName != null">MD_IN_NAME = #{mdInName},</if>
            <if test="mdInFile != null">MD_IN_FILE = #{mdInFile},</if>
            <if test="mdInNote != null">MD_IN_NOTE = #{mdInNote},</if>
            <if test="mdOutName != null">MD_OUT_NAME = #{mdOutName},</if>
            <if test="mdOutFile != null">MD_OUT_FILE = #{mdOutFile},</if>
            <if test="mdOutNote != null">MD_OUT_NOTE = #{mdOutNote},</if>
            <if test="mirrorImageName != null">MIRROR_IMAGE_NAME = #{mirrorImageName},</if>
            <if test="mirrorImageUrl != null">MIRROR_IMAGE_URL = #{mirrorImageUrl},</if>
            <if test="mirrorImageDesc != null">MIRROR_IMAGE_DESC = #{mirrorImageDesc},</if>
            <if test="mdAuthUrl != null">MD_AUTH_URL = #{mdAuthUrl},</if>
            <if test="createby != null">CREATEBY = #{createby},</if>
            <if test="modifyby != null">MODIFYBY = #{modifyby},</if>
            <if test="regUser != null">REG_USER = #{regUser},</if>
            <if test="sort != null">SORT = #{sort},</if>
        </trim>
        where MDID = #{mdid}
    </update>

    <delete id="deleteMdModelInfoByMdid" parameterType="String">
        delete from md_model_info where MDID = #{mdid}
    </delete>

    <delete id="deleteMdModelInfoByMdids" parameterType="String">
        delete from md_model_info where MDID in
        <foreach item="mdid" collection="array" open="(" separator="," close=")">
            #{mdid}
        </foreach>
    </delete>
</mapper>