修改类型图片

This commit is contained in:
dingjie 2023-12-20 20:35:03 +08:00
parent a729039137
commit 810b8b926a
3 changed files with 15 additions and 13 deletions

View File

@ -2,6 +2,7 @@ package com.bonus.sgzb.base.mapper;
import com.bonus.sgzb.base.domain.MaTypeFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -12,8 +13,7 @@ import java.util.List;
* @date 2023-12-11
*/
@Mapper
public interface MaTypeFileMapper
{
public interface MaTypeFileMapper {
/**
* 查询机具类型文件ma_type_file
*
@ -52,7 +52,7 @@ public interface MaTypeFileMapper
* @param typeId 机具类型文件ma_type_file主键
* @return 结果
*/
public int deleteMaTypeFileByTypeId(Long typeId);
public int deleteMaTypeFileByTypeId(@Param("typeId") Long typeId, @Param("fileType") String fileType);
/**
* 批量删除机具类型文件ma_type_file

View File

@ -105,21 +105,23 @@ public class MaTypeServiceImpl implements ITypeService {
int i = maTypeMapper.updateType(maType);
// 图片路径保存
if (StringUtils.isNotEmpty(maType.getPhotoName()) && StringUtils.isNotEmpty(maType.getPhotoUrl())) {
typeFileMapper.deleteMaTypeFileByTypeId(typeId,"1");
MaTypeFile typeFile = new MaTypeFile();
typeFile.setTypeId(typeId);
typeFile.setFileName(maType.getPhotoName());
typeFile.setFileUrl(maType.getPhotoUrl());
typeFile.setFileType("1");
typeFileMapper.updateMaTypeFile(typeFile);
typeFileMapper.insertMaTypeFile(typeFile);
}
// 文档路径保存
if (StringUtils.isNotEmpty(maType.getDocumentName()) && StringUtils.isNotEmpty(maType.getDocumentUrl())) {
typeFileMapper.deleteMaTypeFileByTypeId(typeId,"2");
MaTypeFile typeFile1 = new MaTypeFile();
typeFile1.setTypeId(typeId);
typeFile1.setFileName(maType.getDocumentName());
typeFile1.setFileUrl(maType.getDocumentUrl());
typeFile1.setFileType("2");
typeFileMapper.updateMaTypeFile(typeFile1);
typeFileMapper.insertMaTypeFile(typeFile1);
}
// 库管员配置
if (maType.getKeeperUserId() >= 0L) {

View File

@ -80,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteMaTypeFileByTypeId" parameterType="Long">
delete from ma_type_file where type_id = #{typeId}
delete from ma_type_file where type_id = #{typeId} and file_type = #{fileType}
</delete>
<delete id="deleteMaTypeFileByTypeIds" parameterType="String">