118 lines
5.8 KiB
XML
118 lines
5.8 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.business.mapper.BizMeetingMaterialMapper">
|
|
|
|
<resultMap type="BizMeetingMaterial" id="BizMeetingMaterialResult">
|
|
<id property="id" column="id" />
|
|
<result property="meetingId" column="meeting_id" />
|
|
<result property="materialType" column="material_type" />
|
|
<result property="subType" column="sub_type" />
|
|
<result property="fileName" column="file_name" />
|
|
<result property="ossUrl" column="oss_url" />
|
|
<result property="extraOssUrl" column="extra_oss_url" />
|
|
<result property="amount" column="amount" />
|
|
<result property="creatorId" column="creator_id" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="isDeleted" column="is_deleted" />
|
|
<result property="feeStatus" column="fee_status" />
|
|
</resultMap>
|
|
|
|
<sql id="selectFields">
|
|
select id, meeting_id, material_type, sub_type, file_name, oss_url, extra_oss_url, amount, creator_id, create_time, is_deleted, fee_status
|
|
from biz_meeting_material
|
|
</sql>
|
|
|
|
<select id="selectByPrimaryKey" resultMap="BizMeetingMaterialResult" parameterType="Long">
|
|
<include refid="selectFields"/>
|
|
where id = #{id} and is_deleted = 0
|
|
</select>
|
|
|
|
<select id="selectByMeetingId" resultMap="BizMeetingMaterialResult" parameterType="Long">
|
|
<include refid="selectFields"/>
|
|
where meeting_id = #{meetingId} and is_deleted = 0
|
|
order by id asc
|
|
</select>
|
|
|
|
<select id="selectByMeetingAndSubType" resultMap="BizMeetingMaterialResult">
|
|
<include refid="selectFields"/>
|
|
where meeting_id = #{meetingId} and sub_type = #{subType} and is_deleted = 0
|
|
limit 1
|
|
</select>
|
|
|
|
<insert id="insert" parameterType="BizMeetingMaterial" useGeneratedKeys="true" keyProperty="id">
|
|
insert into biz_meeting_material
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="meetingId != null">meeting_id,</if>
|
|
<if test="materialType != null and materialType != ''">material_type,</if>
|
|
<if test="subType != null and subType != ''">sub_type,</if>
|
|
<if test="fileName != null and fileName != ''">file_name,</if>
|
|
<if test="ossUrl != null and ossUrl != ''">oss_url,</if>
|
|
<if test="extraOssUrl != null and extraOssUrl != ''">extra_oss_url,</if>
|
|
<if test="amount != null">amount,</if>
|
|
<if test="creatorId != null">creator_id,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="meetingId != null">#{meetingId},</if>
|
|
<if test="materialType != null and materialType != ''">#{materialType},</if>
|
|
<if test="subType != null and subType != ''">#{subType},</if>
|
|
<if test="fileName != null and fileName != ''">#{fileName},</if>
|
|
<if test="ossUrl != null and ossUrl != ''">#{ossUrl},</if>
|
|
<if test="extraOssUrl != null and extraOssUrl != ''">#{extraOssUrl},</if>
|
|
<if test="amount != null">#{amount},</if>
|
|
<if test="creatorId != null">#{creatorId},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<insert id="insertBatch" parameterType="java.util.List">
|
|
insert into biz_meeting_material (meeting_id, material_type, sub_type, file_name, oss_url, extra_oss_url, amount, creator_id, create_time, fee_status)
|
|
values
|
|
<foreach collection="list" item="item" separator=",">
|
|
(#{item.meetingId}, #{item.materialType}, #{item.subType}, #{item.fileName}, #{item.ossUrl},
|
|
#{item.extraOssUrl}, #{item.amount}, #{item.creatorId}, #{item.createTime}, #{item.feeStatus})
|
|
</foreach>
|
|
</insert>
|
|
|
|
<update id="updateByPrimaryKey" parameterType="BizMeetingMaterial">
|
|
update biz_meeting_material
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="materialType != null and materialType != ''">material_type = #{materialType},</if>
|
|
<if test="subType != null and subType != ''">sub_type = #{subType},</if>
|
|
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
|
|
<if test="ossUrl != null and ossUrl != ''">oss_url = #{ossUrl},</if>
|
|
<if test="extraOssUrl != null and extraOssUrl != ''">extra_oss_url = #{extraOssUrl},</if>
|
|
<if test="amount != null">amount = #{amount},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<update id="updateAmount">
|
|
update biz_meeting_material set amount = #{amount} where id = #{id}
|
|
</update>
|
|
|
|
<update id="updateFeeStatus">
|
|
update biz_meeting_material set fee_status = #{feeStatus} where id = #{id}
|
|
</update>
|
|
|
|
<!-- 会务材料"打包上传"回填: 替换文件 URL/文件名, 清空金额(待重 OCR) + 置 fee_status -->
|
|
<update id="updateFile">
|
|
update biz_meeting_material
|
|
set oss_url = #{ossUrl}, file_name = #{fileName}, amount = null, fee_status = #{feeStatus}
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="Long">
|
|
delete from biz_meeting_material where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteByMeetingId" parameterType="Long">
|
|
delete from biz_meeting_material where meeting_id = #{meetingId}
|
|
</delete>
|
|
|
|
<!-- 软删除: admin 删除会议时级联置 is_deleted=1 -->
|
|
<update id="softDeleteByMeetingId" parameterType="Long">
|
|
update biz_meeting_material set is_deleted = 1 where meeting_id = #{meetingId}
|
|
</update>
|
|
|
|
</mapper> |