<?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.traceability.mapper.ProMqUploadMapper">
    
    <resultMap type="ProMqUpload" id="ProMqUploadResult">
        <result property="id"    column="id"    />
        <result property="resource"    column="resource"    />
        <result property="sfcStr"    column="sfcStr"    />
        <result property="operation"    column="operation"    />
        <result property="clientId"    column="clientId"    />
        <result property="dcGroup"    column="dcGroup"    />
        <result property="upDirection"    column="upDirection"    />
        <result property="downDirection"    column="downDirection"    />
        <result property="downPosition"    column="downPosition"    />
        <result property="firstArticle"    column="firstArticle"    />
        <result property="mqMaterialFace"    column="mqMaterialFace"    />
        <result property="jrDirection"    column="jrDirection"    />
        <result property="scw"    column="scw"    />
        <result property="bcw"    column="bcw"    />
        <result property="isSuccess"    column="is_success"    />
        <result property="mesReturnInfo"    column="mesReturnInfo"    />
        <result property="recordTime"    column="recordTime"    />
    </resultMap>

    <sql id="selectProMqUploadVo">
        select id, resource, sfcStr, operation, clientId, dcGroup, upDirection, downDirection, downPosition, firstArticle, mqMaterialFace, jrDirection, scw, bcw, is_success, mesReturnInfo, recordTime from pro_mqupload
    </sql>

    <select id="selectProMqUploadList" parameterType="ProMqUpload" resultMap="ProMqUploadResult">
        <include refid="selectProMqUploadVo"/>
        <where>  
            <if test="resource != null  and resource != ''"> and resource = #{resource}</if>
            <if test="sfcStr != null  and sfcStr != ''"> and sfcStr = #{sfcStr}</if>
            <if test="isSuccess != null "> and is_success = #{isSuccess}</if>
            <if test="recordTime != null  and recordTime != ''"> and recordTime = #{recordTime}</if>
        </where>
    </select>
    
    <select id="selectProMqUploadById" parameterType="Long" resultMap="ProMqUploadResult">
        <include refid="selectProMqUploadVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertProMqUpload" parameterType="ProMqUpload" useGeneratedKeys="true" keyProperty="id">
        insert into pro_mqupload
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="resource != null">resource,</if>
            <if test="sfcStr != null">sfcStr,</if>
            <if test="operation != null">operation,</if>
            <if test="clientId != null">clientId,</if>
            <if test="dcGroup != null">dcGroup,</if>
            <if test="upDirection != null">upDirection,</if>
            <if test="downDirection != null">downDirection,</if>
            <if test="downPosition != null">downPosition,</if>
            <if test="firstArticle != null">firstArticle,</if>
            <if test="mqMaterialFace != null">mqMaterialFace,</if>
            <if test="jrDirection != null">jrDirection,</if>
            <if test="scw != null">scw,</if>
            <if test="bcw != null">bcw,</if>
            <if test="isSuccess != null">is_success,</if>
            <if test="mesReturnInfo != null">mesReturnInfo,</if>
            <if test="recordTime != null">recordTime,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="resource != null">#{resource},</if>
            <if test="sfcStr != null">#{sfcStr},</if>
            <if test="operation != null">#{operation},</if>
            <if test="clientId != null">#{clientId},</if>
            <if test="dcGroup != null">#{dcGroup},</if>
            <if test="upDirection != null">#{upDirection},</if>
            <if test="downDirection != null">#{downDirection},</if>
            <if test="downPosition != null">#{downPosition},</if>
            <if test="firstArticle != null">#{firstArticle},</if>
            <if test="mqMaterialFace != null">#{mqMaterialFace},</if>
            <if test="jrDirection != null">#{jrDirection},</if>
            <if test="scw != null">#{scw},</if>
            <if test="bcw != null">#{bcw},</if>
            <if test="isSuccess != null">#{isSuccess},</if>
            <if test="mesReturnInfo != null">#{mesReturnInfo},</if>
            <if test="recordTime != null">#{recordTime},</if>
         </trim>
    </insert>

    <update id="updateProMqUpload" parameterType="ProMqUpload">
        update pro_mqupload
        <trim prefix="SET" suffixOverrides=",">
            <if test="resource != null">resource = #{resource},</if>
            <if test="sfcStr != null">sfcStr = #{sfcStr},</if>
            <if test="operation != null">operation = #{operation},</if>
            <if test="clientId != null">clientId = #{clientId},</if>
            <if test="dcGroup != null">dcGroup = #{dcGroup},</if>
            <if test="upDirection != null">upDirection = #{upDirection},</if>
            <if test="downDirection != null">downDirection = #{downDirection},</if>
            <if test="downPosition != null">downPosition = #{downPosition},</if>
            <if test="firstArticle != null">firstArticle = #{firstArticle},</if>
            <if test="mqMaterialFace != null">mqMaterialFace = #{mqMaterialFace},</if>
            <if test="jrDirection != null">jrDirection = #{jrDirection},</if>
            <if test="scw != null">scw = #{scw},</if>
            <if test="bcw != null">bcw = #{bcw},</if>
            <if test="isSuccess != null">is_success = #{isSuccess},</if>
            <if test="mesReturnInfo != null">mesReturnInfo = #{mesReturnInfo},</if>
            <if test="recordTime != null">recordTime = #{recordTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteProMqUploadById" parameterType="Long">
        delete from pro_mqupload where id = #{id}
    </delete>

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

</mapper>