2024-03-01 03:56:25 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
<!DOCTYPE mapper
|
2024-03-01 06:47:57 +00:00
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
2024-03-01 03:56:25 +00:00
|
|
|
<mapper namespace="com.xdadan.erp.emis.mapper.EmisWaybillAttachmentMapper">
|
2024-03-01 06:47:57 +00:00
|
|
|
|
2024-03-01 03:56:25 +00:00
|
|
|
<resultMap type="EmisWaybillAttachment" id="EmisWaybillAttachmentResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="waybillId" column="waybill_id" />
|
2024-03-01 06:47:57 +00:00
|
|
|
<result property="attachType" column="attach_type" />
|
2024-03-01 03:56:25 +00:00
|
|
|
<result property="fileName" column="file_name" />
|
|
|
|
|
<result property="fileUrl" column="file_url" />
|
|
|
|
|
<result property="fileDesc" column="file_desc" />
|
|
|
|
|
<result property="orderNum" column="order_num" />
|
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
|
<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="remark" column="remark" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectEmisWaybillAttachmentVo">
|
2024-03-01 06:47:57 +00:00
|
|
|
select id, waybill_id, attach_type, file_name, file_url, file_desc, order_num, del_flag, create_by, create_time, update_by, update_time, remark from emis_waybill_attachment
|
2024-03-01 03:56:25 +00:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectEmisWaybillAttachmentList" parameterType="EmisWaybillAttachment" resultMap="EmisWaybillAttachmentResult">
|
|
|
|
|
<include refid="selectEmisWaybillAttachmentVo"/>
|
2024-03-01 06:47:57 +00:00
|
|
|
<where>
|
2024-05-16 05:31:02 +00:00
|
|
|
del_flag='0'
|
2024-03-01 03:56:25 +00:00
|
|
|
<if test="id != null "> and id = #{id}</if>
|
|
|
|
|
<if test="waybillId != null "> and waybill_id = #{waybillId}</if>
|
2024-03-01 06:47:57 +00:00
|
|
|
<if test="attachType != null and attachType != ''"> and attach_type like concat('%', #{attachType}, '%')</if>
|
2024-03-01 03:56:25 +00:00
|
|
|
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
|
|
|
|
<if test="fileUrl != null and fileUrl != ''"> and file_url like concat('%', #{fileUrl}, '%')</if>
|
|
|
|
|
<if test="fileDesc != null and fileDesc != ''"> and file_desc like concat('%', #{fileDesc}, '%')</if>
|
2024-04-25 09:42:49 +00:00
|
|
|
<if test="orderNum != null "> and order_num like concat('%', #{orderNum}, '%')</if>
|
2024-03-01 03:56:25 +00:00
|
|
|
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
|
|
|
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
|
|
|
|
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
|
|
|
|
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by create_time desc
|
|
|
|
|
</select>
|
2024-03-01 06:47:57 +00:00
|
|
|
|
2024-03-01 03:56:25 +00:00
|
|
|
<select id="selectEmisWaybillAttachmentById" parameterType="Long" resultMap="EmisWaybillAttachmentResult">
|
2024-03-01 06:47:57 +00:00
|
|
|
select id, waybill_id, attach_type, file_name, file_url, file_desc, order_num, del_flag, create_by, create_time, update_by, update_time, remark
|
2024-03-01 03:56:25 +00:00
|
|
|
from emis_waybill_attachment a
|
|
|
|
|
where a.id = #{id}
|
|
|
|
|
</select>
|
2024-03-01 06:47:57 +00:00
|
|
|
|
2024-03-01 03:56:25 +00:00
|
|
|
<insert id="insertEmisWaybillAttachment" parameterType="EmisWaybillAttachment">
|
|
|
|
|
insert into emis_waybill_attachment
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="waybillId != null">waybill_id,</if>
|
2024-03-01 06:47:57 +00:00
|
|
|
<if test="attachType != null and attachType != ''">attach_type,</if>
|
2024-03-01 03:56:25 +00:00
|
|
|
<if test="fileName != null and fileName != ''">file_name,</if>
|
|
|
|
|
<if test="fileUrl != null and fileUrl != ''">file_url,</if>
|
|
|
|
|
<if test="fileDesc != null and fileDesc != ''">file_desc,</if>
|
2024-04-25 09:42:49 +00:00
|
|
|
<if test="orderNum != null">order_num,</if>
|
2024-03-01 03:56:25 +00:00
|
|
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
<if test="remark != null and remark != ''">remark,</if>
|
2024-03-01 06:47:57 +00:00
|
|
|
</trim>
|
2024-03-01 03:56:25 +00:00
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="waybillId != null">#{waybillId},</if>
|
2024-03-01 06:47:57 +00:00
|
|
|
<if test="attachType != null and attachType != ''">#{attachType},</if>
|
2024-03-01 03:56:25 +00:00
|
|
|
<if test="fileName != null and fileName != ''">#{fileName},</if>
|
|
|
|
|
<if test="fileUrl != null and fileUrl != ''">#{fileUrl},</if>
|
|
|
|
|
<if test="fileDesc != null and fileDesc != ''">#{fileDesc},</if>
|
2024-04-25 09:42:49 +00:00
|
|
|
<if test="orderNum != null">#{orderNum},</if>
|
2024-03-01 03:56:25 +00:00
|
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
2024-03-01 06:47:57 +00:00
|
|
|
</trim>
|
2024-03-01 03:56:25 +00:00
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateEmisWaybillAttachment" parameterType="EmisWaybillAttachment">
|
|
|
|
|
update emis_waybill_attachment
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="waybillId != null">waybill_id = #{waybillId},</if>
|
2024-03-01 06:47:57 +00:00
|
|
|
<if test="attachType != null and attachType != ''">attach_type = #{attachType},</if>
|
2024-03-01 03:56:25 +00:00
|
|
|
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
|
|
|
|
|
<if test="fileUrl != null and fileUrl != ''">file_url = #{fileUrl},</if>
|
|
|
|
|
<if test="fileDesc != null and fileDesc != ''">file_desc = #{fileDesc},</if>
|
2024-04-25 09:42:49 +00:00
|
|
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
2024-03-01 03:56:25 +00:00
|
|
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEmisWaybillAttachmentById" parameterType="Long">
|
2024-05-16 05:31:02 +00:00
|
|
|
update emis_waybill_attachment set del_flag='1' where id = #{id}
|
2024-03-01 03:56:25 +00:00
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEmisWaybillAttachmentByIds" parameterType="String">
|
2024-05-16 05:31:02 +00:00
|
|
|
update emis_waybill_attachment set del_flag='1' where id in
|
2024-03-01 03:56:25 +00:00
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
2024-05-16 05:31:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEmisWaybillAttachmentByWaybillId" parameterType="Long">
|
|
|
|
|
update emis_waybill_attachment set del_flag='1' where waybill_id = #{waybillId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
2024-03-01 03:56:25 +00:00
|
|
|
</mapper>
|