<?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.webmanage.mapper.OrderAttachmentMapper">
|
|
<!-- 基础结果映射 -->
|
<resultMap id="BaseResultMap" type="com.webmanage.entity.OrderAttachment">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="order_id" property="orderId" jdbcType="VARCHAR"/>
|
<result column="file_name" property="fileName" jdbcType="VARCHAR"/>
|
<result column="original_name" property="originalName" jdbcType="VARCHAR"/>
|
<result column="file_type" property="fileType" jdbcType="VARCHAR"/>
|
<result column="file_size" property="fileSize" jdbcType="BIGINT"/>
|
<result column="file_url" property="fileUrl" jdbcType="VARCHAR"/>
|
<result column="file_path" property="filePath" jdbcType="VARCHAR"/>
|
<result column="bucket_name" property="bucketName" jdbcType="VARCHAR"/>
|
<result column="object_name" property="objectName" jdbcType="VARCHAR"/>
|
<result column="upload_user_id" property="uploadUserId" jdbcType="BIGINT"/>
|
<result column="upload_user_name" property="uploadUserName" jdbcType="VARCHAR"/>
|
<result column="attachment_type" property="attachmentType" jdbcType="VARCHAR"/>
|
<result column="description" property="description" jdbcType="LONGVARCHAR"/>
|
<result column="created_at" property="createdAt" jdbcType="TIMESTAMP"/>
|
<result column="updated_at" property="updatedAt" jdbcType="TIMESTAMP"/>
|
<result column="deleted" property="deleted" jdbcType="INTEGER"/>
|
</resultMap>
|
|
<!-- 基础字段列表 -->
|
<sql id="Base_Column_List">
|
id, order_id, file_name, original_name, file_type, file_size, file_url, file_path,
|
bucket_name, object_name, upload_user_id, upload_user_name, attachment_type,
|
description, created_at, updated_at, deleted
|
</sql>
|
|
<!-- 根据订单ID查询订单附件列表 -->
|
<select id="selectByOrderId" resultMap="BaseResultMap">
|
SELECT
|
<include refid="Base_Column_List"/>
|
FROM order_attachment
|
WHERE deleted = 0 AND order_id = #{orderId}
|
ORDER BY created_at ASC
|
</select>
|
|
</mapper>
|