修改类型图片

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,21 +2,21 @@ 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;
/**
* 机具类型文件ma_type_fileMapper接口
*
*
* @author bonus
* @date 2023-12-11
*/
@Mapper
public interface MaTypeFileMapper
{
public interface MaTypeFileMapper {
/**
* 查询机具类型文件ma_type_file
*
*
* @param typeId 机具类型文件ma_type_file主键
* @return 机具类型文件ma_type_file
*/
@ -24,7 +24,7 @@ public interface MaTypeFileMapper
/**
* 查询机具类型文件ma_type_file列表
*
*
* @param maTypeFile 机具类型文件ma_type_file
* @return 机具类型文件ma_type_file集合
*/
@ -32,7 +32,7 @@ public interface MaTypeFileMapper
/**
* 新增机具类型文件ma_type_file
*
*
* @param maTypeFile 机具类型文件ma_type_file
* @return 结果
*/
@ -40,7 +40,7 @@ public interface MaTypeFileMapper
/**
* 修改机具类型文件ma_type_file
*
*
* @param maTypeFile 机具类型文件ma_type_file
* @return 结果
*/
@ -48,15 +48,15 @@ public interface MaTypeFileMapper
/**
* 删除机具类型文件ma_type_file
*
*
* @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
*
*
* @param typeIds 需要删除的数据主键集合
* @return 结果
*/

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">