<?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="mdUnit" column="mdUnit"/>
        <result property="mdContact" column="mdContact"/>
        <result property="developer" column="developer"/>
        <result property="msgFlag" column="msgFlag"/>
        <result property="msgWebHook" column="msgWebHook"/>
        <result property="mdCPU" column="mdCPU"/>
        <result property="mdGpu" column="mdGpu"/>
        <result property="mdRunEnv" column="mdRunEnv"/>
        <result property="mdRunCmd" column="mdRunCmd"/>
        <result property="mdInOutName" column="mdInOutName"/>
        <result property="mdInOutNameEn" column="mdInOutNameEn"/>
        <result property="mirrorImageEg" column="mirrorImageEg"/>
        <result property="mirrorImageUrl" column="mirrorImageUrl"/>
        <result property="mirrorImageDesc" column="mirrorImageDesc"/>
        <result property="createBy" column="createBy"/>
        <result property="modifyBy" column="modifyBy"/>
        <result property="registrant" column="registrant"/>
    </resultMap>

    <sql id="selectMdModelInfoVo">
        select mdid,
               name,
               enname,
               cateid,
               devlang,
               version,
               intro,
               type,
               tags,
               author,
               isPublic,
               isApproved,
               status,
               className,
               mdUnit,
               mdContact,
               developer,
               msgFlag,
               msgWebHook,
               mdCPU,
               mdGpu,
               mdRunEnv,
               mdRunCmd,
               mdInOutName,
               mdInOutNameEn,
               mirrorImageEg,
               mirrorImageUrl,
               mirrorImageDesc,
               createBy,
               modifyBy,
               registrant
        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 = #{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="mdUnit != null  and mdUnit != ''">and mdUnit = #{mdUnit}</if>
            <if test="mdContact != null  and mdContact != ''">and mdContact = #{mdContact}</if>
            <if test="developer != null  and developer != ''">and developer = #{developer}</if>
            <if test="msgFlag != null ">and msgFlag = #{msgFlag}</if>
            <if test="msgWebHook != null  and msgWebHook != ''">and msgWebHook = #{msgWebHook}</if>
            <if test="mdCPU != null ">and mdCPU = #{mdCPU}</if>
            <if test="mdGpu != null ">and mdGpu = #{mdGpu}</if>
            <if test="mdRunEnv != null  and mdRunEnv != ''">and mdRunEnv = #{mdRunEnv}</if>
            <if test="mdRunCmd != null  and mdRunCmd != ''">and mdRunCmd = #{mdRunCmd}</if>
            <if test="mdInOutName != null  and mdInOutName != ''">and mdInOutName like concat('%', #{mdInOutName},
                '%')
            </if>
            <if test="mdInOutNameEn != null  and mdInOutNameEn != ''">and mdInOutNameEn = #{mdInOutNameEn}</if>
            <if test="mirrorImageEg != null  and mirrorImageEg != ''">and mirrorImageEg = #{mirrorImageEg}</if>
            <if test="mirrorImageUrl != null  and mirrorImageUrl != ''">and mirrorImageUrl = #{mirrorImageUrl}</if>
            <if test="mirrorImageDesc != null  and mirrorImageDesc != ''">and mirrorImageDesc = #{mirrorImageDesc}</if>
            <if test="createBy != null ">and createBy = #{createBy}</if>
            <if test="modifyBy != null ">and modifyBy = #{modifyBy}</if>
            <if test="registrant != null ">and registrant = #{registrant}</if>
        </where>
    </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="mdUnit != null">mdUnit,</if>
            <if test="mdContact != null">mdContact,</if>
            <if test="developer != null">developer,</if>
            <if test="msgFlag != null">msgFlag,</if>
            <if test="msgWebHook != null">msgWebHook,</if>
            <if test="mdCPU != null">mdCPU,</if>
            <if test="mdGpu != null">mdGpu,</if>
            <if test="mdRunEnv != null">mdRunEnv,</if>
            <if test="mdRunCmd != null">mdRunCmd,</if>
            <if test="mdInOutName != null">mdInOutName,</if>
            <if test="mdInOutNameEn != null">mdInOutNameEn,</if>
            <if test="mirrorImageEg != null">mirrorImageEg,</if>
            <if test="mirrorImageUrl != null">mirrorImageUrl,</if>
            <if test="mirrorImageDesc != null">mirrorImageDesc,</if>
            <if test="createBy != null">createBy,</if>
            <if test="modifyBy != null">modifyBy,</if>
            <if test="registrant != null">registrant,</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="mdUnit != null">#{mdUnit},</if>
            <if test="mdContact != null">#{mdContact},</if>
            <if test="developer != null">#{developer},</if>
            <if test="msgFlag != null">#{msgFlag},</if>
            <if test="msgWebHook != null">#{msgWebHook},</if>
            <if test="mdCPU != null">#{mdCPU},</if>
            <if test="mdGpu != null">#{mdGpu},</if>
            <if test="mdRunEnv != null">#{mdRunEnv},</if>
            <if test="mdRunCmd != null">#{mdRunCmd},</if>
            <if test="mdInOutName != null">#{mdInOutName},</if>
            <if test="mdInOutNameEn != null">#{mdInOutNameEn},</if>
            <if test="mirrorImageEg != null">#{mirrorImageEg},</if>
            <if test="mirrorImageUrl != null">#{mirrorImageUrl},</if>
            <if test="mirrorImageDesc != null">#{mirrorImageDesc},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="modifyBy != null">#{modifyBy},</if>
            <if test="registrant != null">#{registrant},</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="mdUnit != null">mdUnit = #{mdUnit},</if>
            <if test="mdContact != null">mdContact = #{mdContact},</if>
            <if test="developer != null">developer = #{developer},</if>
            <if test="msgFlag != null">msgFlag = #{msgFlag},</if>
            <if test="msgWebHook != null">msgWebHook = #{msgWebHook},</if>
            <if test="mdCPU != null">mdCPU = #{mdCPU},</if>
            <if test="mdGpu != null">mdGpu = #{mdGpu},</if>
            <if test="mdRunEnv != null">mdRunEnv = #{mdRunEnv},</if>
            <if test="mdRunCmd != null">mdRunCmd = #{mdRunCmd},</if>
            <if test="mdInOutName != null">mdInOutName = #{mdInOutName},</if>
            <if test="mdInOutNameEn != null">mdInOutNameEn = #{mdInOutNameEn},</if>
            <if test="mirrorImageEg != null">mirrorImageEg = #{mirrorImageEg},</if>
            <if test="mirrorImageUrl != null">mirrorImageUrl = #{mirrorImageUrl},</if>
            <if test="mirrorImageDesc != null">mirrorImageDesc = #{mirrorImageDesc},</if>
            <if test="createBy != null">createBy = #{createBy},</if>
            <if test="modifyBy != null">modifyBy = #{modifyBy},</if>
            <if test="registrant != null">registrant = #{registrant},</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>