<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//oos.juyouhx.com//DTD Mapper 3.0//EN" "http://oss.juyouhx.com/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.scpyun.platform.standard.jilinsscgsdp.attach" name="当事人">
    <insert id="insertEventAttach" parameterType="com.scpyun.platform.jilinsscgsdp.bean.vo.ReqEventAttachInsertVo">
        INSERT INTO jl_event_attach(
            id,
            event_id,
            url,
            attach_type,
            attach_uuid,
            attach_suffix,
            create_time
        )VALUES(
            UUID(),
            #{id},
            #{url},
            1,
            #{uuid},
            #{suffix},
            NOW()
        )
    </insert>

    <select id="selectEventIdByAttachList" parameterType="map" resultType="map" expose="true">
        SELECT
            attach_uuid uuid,
            attach_suffix suffix
        FROM
            jl_event_attach
        WHERE
            event_id = #{id}
    </select>

    <select id="selectNoticeIdByAttachList" parameterType="map" resultType="map" expose="true" nologin="true">
        SELECT
            attach_uuid uuid,
            attach_suffix suffix,
            original_name
        FROM
            jl_app_notice_attachment
        WHERE
            notice_id = #{id}
        and del_flag='0'
    </select>

    <select id="selectDisputeResolutionFileInfo" parameterType="map" resultType="map" expose="true">
        SELECT
            *
        FROM
            jl_dispute_resolution_file
        WHERE
            id = #{id}
    </select>

    <insert id="insertObsUploadRecord" parameterType="map">
        INSERT INTO obs_upload_record(
            id,
            business_type,
            original_name,
            uni_uuid,
            bucket_name,
            object_key,
            url,
            is_need_delete,
            is_delete,
            create_user,
            create_time
        ) VALUES(
            UUID(),
            #{business_type},
            #{originalFilename},
            #{uuid},
            #{bucketName},
            #{object_key},
            #{url},
            0,
            0,
            #{_user.id},
            NOW()
        )
    </insert>
</mapper>
