emis-service/emis-biz/src/main/resources/mapper/EmisWaybillAttachmentMapper.xml

166 lines
9.9 KiB
XML
Raw Normal View History

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-05-23 13:40:29 +00:00
<result property="billCode" column="bill_code" />
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" />
2024-05-23 13:40:29 +00:00
<result property="fileSiez" column="file_siez" />
2024-03-01 03:56:25 +00:00
<result property="fileDesc" column="file_desc" />
<result property="orderNum" column="order_num" />
2024-05-24 07:37:09 +00:00
<result property="dataFrom" column="data_from" />
2024-05-23 15:38:08 +00:00
<result property="remark" column="remark" />
2024-03-01 03:56:25 +00:00
<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" />
2024-05-23 15:38:08 +00:00
<result property="createSite" column="create_site" />
<result property="updateSite" column="update_site" />
2024-03-01 03:56:25 +00:00
</resultMap>
<sql id="selectEmisWaybillAttachmentVo">
2024-05-24 07:37:09 +00:00
select id, waybill_id, bill_code, attach_type, file_name, file_url, file_siez, file_desc, order_num, data_from, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site 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-05-23 13:40:29 +00:00
<if test="billCode != null and billCode != ''"> and bill_code like concat('%', #{billCode}, '%')</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>
2024-05-23 13:40:29 +00:00
<if test="fileSiez != null "> and file_siez = #{fileSiez}</if>
2024-03-01 03:56:25 +00:00
<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-05-24 07:37:09 +00:00
<if test="dataFrom != null and dataFrom != ''"> and data_from like concat('%', #{dataFrom}, '%')</if>
2024-05-23 15:38:08 +00:00
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</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>
2024-05-23 15:38:08 +00:00
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
2024-03-01 03:56:25 +00:00
</where>
order by create_time desc
</select>
2024-03-01 06:47:57 +00:00
2024-05-23 13:40:29 +00:00
<select id="checkUnique" parameterType="EmisWaybillAttachment" resultType="int">
select count(1) from emis_waybill_attachment
where del_flag='0'
and id = #{id}
and waybill_id = #{waybillId}
and bill_code = #{billCode}
and attach_type = #{attachType}
and file_name = #{fileName}
and file_url = #{fileUrl}
and file_siez = #{fileSiez}
and file_desc = #{fileDesc}
and order_num = #{orderNum}
2024-05-24 07:37:09 +00:00
and data_from = #{dataFrom}
2024-05-23 15:38:08 +00:00
and remark = #{remark}
2024-05-23 13:40:29 +00:00
and del_flag = #{delFlag}
and create_by = #{createBy}
and create_time = #{createTime}
and update_by = #{updateBy}
and update_time = #{updateTime}
2024-05-23 15:38:08 +00:00
and create_site = #{createSite}
and update_site = #{updateSite}
2024-05-23 13:40:29 +00:00
limit 1
</select>
2024-03-01 03:56:25 +00:00
<select id="selectEmisWaybillAttachmentById" parameterType="Long" resultMap="EmisWaybillAttachmentResult">
2024-05-24 07:37:09 +00:00
select id, waybill_id, bill_code, attach_type, file_name, file_url, file_siez, file_desc, order_num, data_from, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
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-05-23 13:40:29 +00:00
<insert id="insertEmisWaybillAttachment" parameterType="EmisWaybillAttachment" useGeneratedKeys="true" keyProperty="id">
2024-03-01 03:56:25 +00:00
insert into emis_waybill_attachment
<trim prefix="(" suffix=")" suffixOverrides=",">
2024-05-23 13:40:29 +00:00
<if test="id != null">id,</if>
2024-03-01 03:56:25 +00:00
<if test="waybillId != null">waybill_id,</if>
2024-05-23 13:40:29 +00:00
<if test="billCode != null and billCode != ''">bill_code,</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>
2024-05-23 13:40:29 +00:00
<if test="fileSiez != null">file_siez,</if>
2024-03-01 03:56:25 +00:00
<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-05-24 07:37:09 +00:00
<if test="dataFrom != null and dataFrom != ''">data_from,</if>
2024-05-23 15:38:08 +00:00
<if test="remark != null and remark != ''">remark,</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>
2024-05-23 15:38:08 +00:00
<if test="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
2024-03-01 06:47:57 +00:00
</trim>
2024-03-01 03:56:25 +00:00
<trim prefix="values (" suffix=")" suffixOverrides=",">
2024-05-23 13:40:29 +00:00
<if test="id != null">#{id},</if>
2024-03-01 03:56:25 +00:00
<if test="waybillId != null">#{waybillId},</if>
2024-05-23 13:40:29 +00:00
<if test="billCode != null and billCode != ''">#{billCode},</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>
2024-05-23 13:40:29 +00:00
<if test="fileSiez != null">#{fileSiez},</if>
2024-03-01 03:56:25 +00:00
<if test="fileDesc != null and fileDesc != ''">#{fileDesc},</if>
2024-04-25 09:42:49 +00:00
<if test="orderNum != null">#{orderNum},</if>
2024-05-24 07:37:09 +00:00
<if test="dataFrom != null and dataFrom != ''">#{dataFrom},</if>
2024-05-23 15:38:08 +00:00
<if test="remark != null and remark != ''">#{remark},</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>
2024-05-23 15:38:08 +00:00
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</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-05-23 13:40:29 +00:00
<if test="billCode != null and billCode != ''">bill_code = #{billCode},</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>
2024-05-23 13:40:29 +00:00
<if test="fileSiez != null">file_siez = #{fileSiez},</if>
2024-03-01 03:56:25 +00:00
<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-05-24 07:37:09 +00:00
<if test="dataFrom != null and dataFrom != ''">data_from = #{dataFrom},</if>
2024-05-23 15:38:08 +00:00
<if test="remark != null and remark != ''">remark = #{remark},</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>
2024-05-23 15:38:08 +00:00
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
2024-03-01 03:56:25 +00:00
</trim>
where id = #{id}
</update>
<delete id="deleteEmisWaybillAttachmentById" parameterType="Long">
2024-05-23 13:40:29 +00:00
delete from emis_waybill_attachment where id = #{id}
2024-03-01 03:56:25 +00:00
</delete>
<delete id="deleteEmisWaybillAttachmentByIds" parameterType="String">
2024-05-23 13:40:29 +00:00
delete from emis_waybill_attachment where id in
2024-03-01 03:56:25 +00:00
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>