<?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.mxjb.mapper.MxjbMultipleWayAssetMapper">
    
    <resultMap type="MxjbMultipleWayAsset" id="MxjbMultipleWayAssetResult">
        <result property="id"    column="id"    />
        <result property="type"    column="type"    />
        <result property="property"    column="property"    />
        <result property="op"    column="op"    />
        <result property="optionType"    column="optionType"    />
        <result property="optionValues"    column="optionValues"    />
        <result property="message"    column="message"    />
    </resultMap>

    <sql id="selectMxjbMultipleWayAssetVo">
        select id, type, property, op, optionType, optionValues, message from mxjb_multiple_way_asset
    </sql>

    <select id="selectMxjbMultipleWayAssetList" parameterType="MxjbMultipleWayAsset" resultMap="MxjbMultipleWayAssetResult">
        <include refid="selectMxjbMultipleWayAssetVo"/>
        <where>  
            <if test="type != null  and type != ''"> and type = #{type}</if>
            <if test="property != null  and property != ''"> and property = #{property}</if>
            <if test="op != null  and op != ''"> and op = #{op}</if>
            <if test="optionType != null  and optionType != ''"> and optionType = #{optionType}</if>
            <if test="optionValues != null  and optionValues != ''"> and optionValues = #{optionValues}</if>
            <if test="message != null  and message != ''"> and message = #{message}</if>
        </where>
    </select>
    
    <select id="selectMxjbMultipleWayAssetById" parameterType="Integer" resultMap="MxjbMultipleWayAssetResult">
        <include refid="selectMxjbMultipleWayAssetVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertMxjbMultipleWayAsset" parameterType="MxjbMultipleWayAsset" useGeneratedKeys="true" keyProperty="id">
        insert into mxjb_multiple_way_asset
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="type != null">type,</if>
            <if test="property != null">property,</if>
            <if test="op != null">op,</if>
            <if test="optionType != null">optionType,</if>
            <if test="optionValues != null">optionValues,</if>
            <if test="message != null">message,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="type != null">#{type},</if>
            <if test="property != null">#{property},</if>
            <if test="op != null">#{op},</if>
            <if test="optionType != null">#{optionType},</if>
            <if test="optionValues != null">#{optionValues},</if>
            <if test="message != null">#{message},</if>
         </trim>
    </insert>

    <update id="updateMxjbMultipleWayAsset" parameterType="MxjbMultipleWayAsset">
        update mxjb_multiple_way_asset
        <trim prefix="SET" suffixOverrides=",">
            <if test="type != null">type = #{type},</if>
            <if test="property != null">property = #{property},</if>
            <if test="op != null">op = #{op},</if>
            <if test="optionType != null">optionType = #{optionType},</if>
            <if test="optionValues != null">optionValues = #{optionValues},</if>
            <if test="message != null">message = #{message},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteMxjbMultipleWayAssetById" parameterType="Integer">
        delete from mxjb_multiple_way_asset where id = #{id}
    </delete>

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