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

111 lines
6.5 KiB
XML
Raw Normal View History

2024-03-01 03:56:25 +00:00
<?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.xdadan.erp.emis.mapper.EmisWaybillAttachmentMapper">
<resultMap type="EmisWaybillAttachment" id="EmisWaybillAttachmentResult">
<result property="id" column="id" />
<result property="waybillId" column="waybill_id" />
<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">
select id, waybill_id, file_name, file_url, file_desc, order_num, del_flag, create_by, create_time, update_by, update_time, remark from emis_waybill_attachment
</sql>
<select id="selectEmisWaybillAttachmentList" parameterType="EmisWaybillAttachment" resultMap="EmisWaybillAttachmentResult">
<include refid="selectEmisWaybillAttachmentVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="waybillId != null "> and waybill_id = #{waybillId}</if>
<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>
<if test="orderNum != null and orderNum != ''"> and order_num like concat('%', #{orderNum}, '%')</if>
<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>
<select id="selectEmisWaybillAttachmentById" parameterType="Long" resultMap="EmisWaybillAttachmentResult">
select id, waybill_id, file_name, file_url, file_desc, order_num, del_flag, create_by, create_time, update_by, update_time, remark
from emis_waybill_attachment a
where a.id = #{id}
</select>
<insert id="insertEmisWaybillAttachment" parameterType="EmisWaybillAttachment">
insert into emis_waybill_attachment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="waybillId != null">waybill_id,</if>
<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>
<if test="orderNum != null and orderNum != ''">order_num,</if>
<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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="waybillId != null">#{waybillId},</if>
<if test="fileName != null and fileName != ''">#{fileName},</if>
<if test="fileUrl != null and fileUrl != ''">#{fileUrl},</if>
<if test="fileDesc != null and fileDesc != ''">#{fileDesc},</if>
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
<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>
</trim>
</insert>
<update id="updateEmisWaybillAttachment" parameterType="EmisWaybillAttachment">
update emis_waybill_attachment
<trim prefix="SET" suffixOverrides=",">
<if test="waybillId != null">waybill_id = #{waybillId},</if>
<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>
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
<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">
delete from emis_waybill_attachment where id = #{id}
</delete>
<delete id="deleteEmisWaybillAttachmentByIds" parameterType="String">
delete from emis_waybill_attachment where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>