<?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.ProLyUploadMapper">
    
    <resultMap type="ProLyUpload" id="ProLyUploadResult">
        <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="crosswiseArea"    column="crosswiseArea"    />
        <result property="erectArea"    column="erectArea"    />
        <result property="materialFace"    column="materialFace"    />
        <result property="sx01"    column="sx01"    />
        <result property="sx02"    column="sx02"    />
        <result property="bx01"    column="bx01"    />
        <result property="bx02"    column="bx02"    />
        <result property="isSuccess"    column="is_success"    />
        <result property="mesReturnInfo"    column="mesReturnInfo"    />
        <result property="recordTime"    column="recordTime"    />
    </resultMap>

    <sql id="selectProLyUploadVo">
        select id, resource, sfcStr, operation, clientId, dcGroup, upDirection, downDirection, downPosition, crosswiseArea, erectArea, materialFace, sx01, sx02, bx01, bx02, is_success, mesReturnInfo, recordTime from pro_lyupload
    </sql>

    <select id="selectProLyUploadList" parameterType="ProLyUpload" resultMap="ProLyUploadResult">
        <include refid="selectProLyUploadVo"/>
        <where>  
            <if test="resource != null  and resource != ''"> and resource = #{resource}</if>
            <if test="sfcStr != null  and sfcStr != ''"> and sfcStr = #{sfcStr}</if>
            <if test="operation != null  and operation != ''"> and operation = #{operation}</if>
            <if test="isSuccess != null "> and is_success = #{isSuccess}</if>
            <if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''"> and recordTime between #{params.beginRecordTime} and #{params.endRecordTime}</if>
        </where>
    </select>
    
    <select id="selectProLyUploadById" parameterType="Long" resultMap="ProLyUploadResult">
        <include refid="selectProLyUploadVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertProLyUpload" parameterType="ProLyUpload" useGeneratedKeys="true" keyProperty="id">
        insert into pro_lyupload
        <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="crosswiseArea != null">crosswiseArea,</if>
            <if test="erectArea != null">erectArea,</if>
            <if test="materialFace != null">materialFace,</if>
            <if test="sx01 != null">sx01,</if>
            <if test="sx02 != null">sx02,</if>
            <if test="bx01 != null">bx01,</if>
            <if test="bx02 != null">bx02,</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="crosswiseArea != null">#{crosswiseArea},</if>
            <if test="erectArea != null">#{erectArea},</if>
            <if test="materialFace != null">#{materialFace},</if>
            <if test="sx01 != null">#{sx01},</if>
            <if test="sx02 != null">#{sx02},</if>
            <if test="bx01 != null">#{bx01},</if>
            <if test="bx02 != null">#{bx02},</if>
            <if test="isSuccess != null">#{isSuccess},</if>
            <if test="mesReturnInfo != null">#{mesReturnInfo},</if>
            <if test="recordTime != null">#{recordTime},</if>
         </trim>
    </insert>

    <update id="updateProLyUpload" parameterType="ProLyUpload">
        update pro_lyupload
        <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="crosswiseArea != null">crosswiseArea = #{crosswiseArea},</if>
            <if test="erectArea != null">erectArea = #{erectArea},</if>
            <if test="materialFace != null">materialFace = #{materialFace},</if>
            <if test="sx01 != null">sx01 = #{sx01},</if>
            <if test="sx02 != null">sx02 = #{sx02},</if>
            <if test="bx01 != null">bx01 = #{bx01},</if>
            <if test="bx02 != null">bx02 = #{bx02},</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="deleteProLyUploadById" parameterType="Long">
        delete from pro_lyupload where id = #{id}
    </delete>

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

</mapper>