unis_sip/ruoyi-sip/src/main/resources/mapper/finance/OmsFinAttachmentMapper.xml

112 lines
6.0 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.ruoyi.sip.mapper.OmsFinAttachmentMapper">
<resultMap type="OmsFinAttachment" id="OmsFinAttachmentResult">
<result property="id" column="id" />
<result property="relatedBillId" column="related_bill_id" />
<result property="relatedBillType" column="related_bill_type" />
<result property="fileName" column="file_name" />
<result property="filePath" column="file_path" />
<result property="fileSize" column="file_size" />
<result property="fileType" column="file_type" />
<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" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectOmsFinAttachmentVo">
select id, related_bill_id, related_bill_type, file_name, file_path, file_size, file_type, create_by, create_time, update_by, update_time, remark, del_flag from oms_fin_attachment
</sql>
<select id="selectOmsFinAttachmentList" parameterType="OmsFinAttachment" resultMap="OmsFinAttachmentResult">
<include refid="selectOmsFinAttachmentVo"/>
<where>
<if test="relatedBillId != null "> and related_bill_id = #{relatedBillId}</if>
<if test="relatedBillIdList != null and relatedBillIdList.size>0 "> and related_bill_id
in <foreach item="item" index="index" collection="relatedBillIdList" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="relatedBillType != null and relatedBillType != ''"> and related_bill_type = #{relatedBillType}</if>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
<if test="fileSize != null "> and file_size = #{fileSize}</if>
<if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
</where>
</select>
<select id="selectOmsFinAttachmentById" parameterType="Long" resultMap="OmsFinAttachmentResult">
<include refid="selectOmsFinAttachmentVo"/>
where id = #{id}
</select>
<insert id="insertOmsFinAttachment" parameterType="OmsFinAttachment" useGeneratedKeys="true" keyProperty="id">
insert into oms_fin_attachment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="relatedBillId != null">related_bill_id,</if>
<if test="relatedBillType != null and relatedBillType != ''">related_bill_type,</if>
<if test="fileName != null and fileName != ''">file_name,</if>
<if test="filePath != null and filePath != ''">file_path,</if>
<if test="fileSize != null">file_size,</if>
<if test="fileType != null">file_type,</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="remark != null">remark,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="relatedBillId != null">#{relatedBillId},</if>
<if test="relatedBillType != null and relatedBillType != ''">#{relatedBillType},</if>
<if test="fileName != null and fileName != ''">#{fileName},</if>
<if test="filePath != null and filePath != ''">#{filePath},</if>
<if test="fileSize != null">#{fileSize},</if>
<if test="fileType != null">#{fileType},</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="remark != null">#{remark},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateOmsFinAttachment" parameterType="OmsFinAttachment">
update oms_fin_attachment
<trim prefix="SET" suffixOverrides=",">
<if test="relatedBillId != null">related_bill_id = #{relatedBillId},</if>
<if test="relatedBillType != null and relatedBillType != ''">related_bill_type = #{relatedBillType},</if>
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
<if test="filePath != null and filePath != ''">file_path = #{filePath},</if>
<if test="fileSize != null">file_size = #{fileSize},</if>
<if test="fileType != null">file_type = #{fileType},</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="remark != null">remark = #{remark},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOmsFinAttachmentById" parameterType="Long">
delete from oms_fin_attachment where id = #{id}
</delete>
<delete id="deleteOmsFinAttachmentByIds" parameterType="String">
delete from oms_fin_attachment where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>