Files
delivery_management/src/main/resources/mybatis/document/DeliveryAttachmentMapper.xml
wenshijun ab9a48f968 配送单据接口开发
配送单据附件接口开发
2025-10-16 10:30:21 +08:00

106 lines
5.3 KiB
XML

<?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.delivery.project.document.mapper.DeliveryAttachmentMapper">
<resultMap type="DeliveryAttachment" id="DeliveryAttachmentResult">
<result property="id" column="id" />
<result property="orderId" column="order_id" />
<result property="scene" column="scene" />
<result property="bizType" column="biz_type" />
<result property="url" column="url" />
<result property="status" column="status" />
<result property="sortNo" column="sort_no" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDelete" column="is_delete" />
</resultMap>
<sql id="selectDeliveryAttachmentVo">
select id, order_id, scene, biz_type, url, status, sort_no, remark, create_by, create_time, update_by, update_time, is_delete from delivery_attachment
</sql>
<select id="selectDeliveryAttachmentList" parameterType="DeliveryAttachment" resultMap="DeliveryAttachmentResult">
<include refid="selectDeliveryAttachmentVo"/>
<where>
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="scene != null and scene != ''"> and scene = #{scene}</if>
<if test="bizType != null and bizType != ''"> and biz_type = #{bizType}</if>
<if test="url != null and url != ''"> and url = #{url}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="sortNo != null "> and sort_no = #{sortNo}</if>
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
</where>
</select>
<select id="selectDeliveryAttachmentById" parameterType="Long" resultMap="DeliveryAttachmentResult">
<include refid="selectDeliveryAttachmentVo"/>
where id = #{id}
</select>
<insert id="insertDeliveryAttachment" parameterType="DeliveryAttachment" useGeneratedKeys="true" keyProperty="id">
insert into delivery_attachment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderId != null">order_id,</if>
<if test="scene != null">scene,</if>
<if test="bizType != null">biz_type,</if>
<if test="url != null">url,</if>
<if test="status != null and status != ''">status,</if>
<if test="sortNo != null">sort_no,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDelete != null">is_delete,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},</if>
<if test="scene != null">#{scene},</if>
<if test="bizType != null">#{bizType},</if>
<if test="url != null">#{url},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="sortNo != null">#{sortNo},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDelete != null">#{isDelete},</if>
</trim>
</insert>
<update id="updateDeliveryAttachment" parameterType="DeliveryAttachment">
update delivery_attachment
<trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id = #{orderId},</if>
<if test="scene != null">scene = #{scene},</if>
<if test="bizType != null">biz_type = #{bizType},</if>
<if test="url != null">url = #{url},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="sortNo != null">sort_no = #{sortNo},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDeliveryAttachmentById" parameterType="Long">
delete from delivery_attachment where id = #{id}
</delete>
<delete id="deleteDeliveryAttachmentByIds" parameterType="String">
delete from delivery_attachment where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>