bm_file_info查询和删除添加del_flag字段

This commit is contained in:
itcast 2026-01-23 10:58:30 +08:00
parent d5c0780d0d
commit fa604e1527
4 changed files with 31 additions and 23 deletions

View File

@ -22,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBmFileInfoList" parameterType="com.bonus.common.biz.domain.BmFileInfo" resultMap="BmFileInfoResult">
<include refid="selectBmFileInfoVo"/>
<where>
del_flag != 2
<if test="taskType != null "> and task_type = #{taskType}</if>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="modelId != null "> and model_id = #{modelId}</if>
@ -34,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBmFileInfoById" parameterType="Long" resultMap="BmFileInfoResult">
<include refid="selectBmFileInfoVo"/>
where id = #{id}
where id = #{id} and del_flag != 2
</select>
<insert id="insertBmFileInfo" parameterType="com.bonus.common.biz.domain.BmFileInfo" useGeneratedKeys="true" keyProperty="id">
@ -91,33 +92,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<delete id="deleteBmFileInfoById" parameterType="Long">
delete from bm_file_info where id = #{id}
</delete>
<update id="deleteBmFileInfoById" parameterType="Long">
update bm_file_info set del_flag = 2
where id = #{id}
</update>
<delete id="deleteBmFileInfoByModelId" parameterType="Long">
delete from bm_file_info where model_id = #{modelId}
</delete>
<update id="deleteBmFileInfoByModelId" parameterType="Long">
update bm_file_info set del_flag = 2
where model_id = #{modelId}
</update>
<delete id="deleteBmFileInfoByIds" parameterType="String">
delete from bm_file_info where id in
<update id="deleteBmFileInfoByIds" parameterType="String">
update bm_file_info set del_flag = 2
where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</update>
<delete id="deleteBmFileInfoByBizInfo" parameterType="com.bonus.common.biz.domain.BmFileInfo">
delete from bm_file_info
<update id="deleteBmFileInfoByBizInfo" parameterType="com.bonus.common.biz.domain.BmFileInfo">
update bm_file_info set del_flag = 2
<where>
<if test="taskType != null "> and task_type = #{taskType}</if>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="modelId != null "> and model_id = #{modelId}</if>
<if test="fileType != null "> and file_type = #{fileType}</if>
</where>
</delete>
</update>
<delete id="deleteBmFileList">
delete from bm_file_info where task_id = #{taskId}
<update id="deleteBmFileList">
update bm_file_info set del_flag = 2
where task_id = #{taskId}
and task_type = 0
</delete>
</update>
</mapper>

View File

@ -217,19 +217,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select
distinct task_type as taskType,task_id as taskId,model_id as modelId, file_type as fileType
from bm_file_info
where task_type = #{taskType} and task_id = #{taskId} and model_id = #{modelId}
where del_flag != 2 and task_type = #{taskType} and task_id = #{taskId} and model_id = #{modelId}
</select>
<select id="getPartFileDetail" resultType="com.bonus.material.part.domain.BmPartFileDetail">
select
id,task_type as taskType,task_id as taskId,model_id as modelId, file_type as fileType,name,url
from bm_file_info
where task_type = #{taskType} and task_id = #{taskId} and model_id = #{modelId} and file_type = #{fileType}
where del_flag != 2 and task_type = #{taskType} and task_id = #{taskId} and model_id = #{modelId} and file_type = #{fileType}
</select>
<delete id="deleteBmFileList" parameterType="Long">
delete from bm_file_info where task_id = #{taskId} and task_type = 13
</delete>
<update id="deleteBmFileList" parameterType="Long">
update bm_file_info set del_flag = 2
where task_id = #{taskId} and task_type = 13
</update>
<select id="getCheckInfoForm" resultType="com.bonus.material.part.domain.PartTypeCheckInfo">
select

View File

@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
sys_dict_data sdd
LEFT JOIN
bm_file_info bfi ON bfi.dic_id = sdd.dict_code and bfi.task_type = #{taskType} and bfi.model_id = #{typeId}
bm_file_info bfi ON bfi.del_flag != 2 and bfi.task_type = #{taskType} and bfi.model_id = #{typeId}
WHERE
sdd.dict_type = 'purchase_check_report_type'
</sql>

View File

@ -84,7 +84,9 @@
create_by as createBy,
create_time as createTime
from bm_file_info
where model_id = #{id}
where
del_flag != 2
and model_id = #{id}
</select>
<select id="getDetailList" resultType="com.bonus.material.settlement.domain.SltAgreementReduce">
SELECT