文件缓存,保存路径等
This commit is contained in:
@ -27,6 +27,17 @@
|
||||
<version>1.6.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
<version>4.4.8</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
@ -0,0 +1,83 @@
|
||||
package com.ruoyi.productionManager.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 标准信息文件对象 standard_info_details
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-10-18
|
||||
*/
|
||||
public class StandardInfoDetails extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 标准明细ID */
|
||||
private Long detailsId;
|
||||
|
||||
/** 标准id */
|
||||
private Long standardId;
|
||||
|
||||
/** 文件名称 */
|
||||
@Excel(name = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
/** 文件路径 */
|
||||
@Excel(name = "文件路径")
|
||||
private String fileUrl;
|
||||
|
||||
public void setDetailsId(Long detailsId)
|
||||
{
|
||||
this.detailsId = detailsId;
|
||||
}
|
||||
|
||||
public Long getDetailsId()
|
||||
{
|
||||
return detailsId;
|
||||
}
|
||||
public void setStandardId(Long standardId)
|
||||
{
|
||||
this.standardId = standardId;
|
||||
}
|
||||
|
||||
public Long getStandardId()
|
||||
{
|
||||
return standardId;
|
||||
}
|
||||
public void setFileName(String fileName)
|
||||
{
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getFileName()
|
||||
{
|
||||
return fileName;
|
||||
}
|
||||
public void setFileUrl(String fileUrl)
|
||||
{
|
||||
this.fileUrl = fileUrl;
|
||||
}
|
||||
|
||||
public String getFileUrl()
|
||||
{
|
||||
return fileUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("detailsId", getDetailsId())
|
||||
.append("standardId", getStandardId())
|
||||
.append("fileName", getFileName())
|
||||
.append("fileUrl", getFileUrl())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.productionManager.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.productionManager.domain.StandardInfoDetails;
|
||||
|
||||
/**
|
||||
* 标准信息文件Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-10-18
|
||||
*/
|
||||
public interface StandardInfoDetailsMapper
|
||||
{
|
||||
/**
|
||||
* 查询标准信息文件
|
||||
*
|
||||
* @param detailsId 标准信息文件主键
|
||||
* @return 标准信息文件
|
||||
*/
|
||||
public StandardInfoDetails selectStandardInfoDetailsByDetailsId(Long detailsId);
|
||||
|
||||
/**
|
||||
* 查询标准信息文件列表
|
||||
*
|
||||
* @param standardInfoDetails 标准信息文件
|
||||
* @return 标准信息文件集合
|
||||
*/
|
||||
public List<StandardInfoDetails> selectStandardInfoDetailsList(StandardInfoDetails standardInfoDetails);
|
||||
|
||||
/**
|
||||
* 新增标准信息文件
|
||||
*
|
||||
* @param standardInfoDetails 标准信息文件
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStandardInfoDetails(StandardInfoDetails standardInfoDetails);
|
||||
|
||||
/**
|
||||
* 修改标准信息文件
|
||||
*
|
||||
* @param standardInfoDetails 标准信息文件
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStandardInfoDetails(StandardInfoDetails standardInfoDetails);
|
||||
|
||||
/**
|
||||
* 删除标准信息文件
|
||||
*
|
||||
* @param detailsId 标准信息文件主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStandardInfoDetailsByDetailsId(Long detailsId);
|
||||
|
||||
/**
|
||||
* 批量删除标准信息文件
|
||||
*
|
||||
* @param detailsIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStandardInfoDetailsByDetailsIds(Long[] detailsIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.productionManager.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.productionManager.domain.StandardInfoDetails;
|
||||
|
||||
/**
|
||||
* 标准信息文件Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-10-18
|
||||
*/
|
||||
public interface IStandardInfoDetailsService
|
||||
{
|
||||
/**
|
||||
* 查询标准信息文件
|
||||
*
|
||||
* @param detailsId 标准信息文件主键
|
||||
* @return 标准信息文件
|
||||
*/
|
||||
public StandardInfoDetails selectStandardInfoDetailsByDetailsId(Long detailsId);
|
||||
|
||||
/**
|
||||
* 查询标准信息文件列表
|
||||
*
|
||||
* @param standardInfoDetails 标准信息文件
|
||||
* @return 标准信息文件集合
|
||||
*/
|
||||
public List<StandardInfoDetails> selectStandardInfoDetailsList(StandardInfoDetails standardInfoDetails);
|
||||
|
||||
/**
|
||||
* 新增标准信息文件
|
||||
*
|
||||
* @param standardInfoDetails 标准信息文件
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStandardInfoDetails(StandardInfoDetails standardInfoDetails);
|
||||
|
||||
/**
|
||||
* 修改标准信息文件
|
||||
*
|
||||
* @param standardInfoDetails 标准信息文件
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStandardInfoDetails(StandardInfoDetails standardInfoDetails);
|
||||
|
||||
/**
|
||||
* 批量删除标准信息文件
|
||||
*
|
||||
* @param detailsIds 需要删除的标准信息文件主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStandardInfoDetailsByDetailsIds(Long[] detailsIds);
|
||||
|
||||
/**
|
||||
* 删除标准信息文件信息
|
||||
*
|
||||
* @param detailsId 标准信息文件主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStandardInfoDetailsByDetailsId(Long detailsId);
|
||||
}
|
@ -2,6 +2,7 @@ package com.ruoyi.productionManager.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.productionManager.domain.StandardInfo;
|
||||
import com.ruoyi.productionManager.vo.StandardManagerVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
@ -34,7 +35,7 @@ public interface IStandardInfoService
|
||||
* @param standardInfo 试验标准管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStandardInfo(StandardInfo standardInfo);
|
||||
public int insertStandardInfo(StandardManagerVO standardManagerVO);
|
||||
|
||||
/**
|
||||
* 修改试验标准管理
|
||||
|
@ -0,0 +1,96 @@
|
||||
package com.ruoyi.productionManager.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.productionManager.mapper.StandardInfoDetailsMapper;
|
||||
import com.ruoyi.productionManager.domain.StandardInfoDetails;
|
||||
import com.ruoyi.productionManager.service.IStandardInfoDetailsService;
|
||||
|
||||
/**
|
||||
* 标准信息文件Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-10-18
|
||||
*/
|
||||
@Service
|
||||
public class StandardInfoDetailsServiceImpl implements IStandardInfoDetailsService
|
||||
{
|
||||
@Autowired
|
||||
private StandardInfoDetailsMapper standardInfoDetailsMapper;
|
||||
|
||||
/**
|
||||
* 查询标准信息文件
|
||||
*
|
||||
* @param detailsId 标准信息文件主键
|
||||
* @return 标准信息文件
|
||||
*/
|
||||
@Override
|
||||
public StandardInfoDetails selectStandardInfoDetailsByDetailsId(Long detailsId)
|
||||
{
|
||||
return standardInfoDetailsMapper.selectStandardInfoDetailsByDetailsId(detailsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标准信息文件列表
|
||||
*
|
||||
* @param standardInfoDetails 标准信息文件
|
||||
* @return 标准信息文件
|
||||
*/
|
||||
@Override
|
||||
public List<StandardInfoDetails> selectStandardInfoDetailsList(StandardInfoDetails standardInfoDetails)
|
||||
{
|
||||
return standardInfoDetailsMapper.selectStandardInfoDetailsList(standardInfoDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增标准信息文件
|
||||
*
|
||||
* @param standardInfoDetails 标准信息文件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertStandardInfoDetails(StandardInfoDetails standardInfoDetails)
|
||||
{
|
||||
standardInfoDetails.setCreateTime(DateUtils.getNowDate());
|
||||
return standardInfoDetailsMapper.insertStandardInfoDetails(standardInfoDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改标准信息文件
|
||||
*
|
||||
* @param standardInfoDetails 标准信息文件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateStandardInfoDetails(StandardInfoDetails standardInfoDetails)
|
||||
{
|
||||
standardInfoDetails.setUpdateTime(DateUtils.getNowDate());
|
||||
return standardInfoDetailsMapper.updateStandardInfoDetails(standardInfoDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除标准信息文件
|
||||
*
|
||||
* @param detailsIds 需要删除的标准信息文件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStandardInfoDetailsByDetailsIds(Long[] detailsIds)
|
||||
{
|
||||
return standardInfoDetailsMapper.deleteStandardInfoDetailsByDetailsIds(detailsIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标准信息文件信息
|
||||
*
|
||||
* @param detailsId 标准信息文件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStandardInfoDetailsByDetailsId(Long detailsId)
|
||||
{
|
||||
return standardInfoDetailsMapper.deleteStandardInfoDetailsByDetailsId(detailsId);
|
||||
}
|
||||
}
|
@ -1,24 +1,32 @@
|
||||
package com.ruoyi.productionManager.service.impl;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.file.FileTypeUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||
import io.netty.handler.codec.base64.Base64;
|
||||
import com.ruoyi.productionManager.domain.StandardInfoDetails;
|
||||
import com.ruoyi.productionManager.service.IStandardInfoDetailsService;
|
||||
import com.ruoyi.productionManager.vo.StandardManagerVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.productionManager.mapper.StandardInfoMapper;
|
||||
import com.ruoyi.productionManager.domain.StandardInfo;
|
||||
import com.ruoyi.productionManager.service.IStandardInfoService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import sun.misc.BASE64Encoder;
|
||||
import org.apache.http.entity.ContentType;
|
||||
|
||||
|
||||
/**
|
||||
* 试验标准管理Service业务层处理
|
||||
@ -35,6 +43,9 @@ public class StandardInfoServiceImpl implements IStandardInfoService
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private IStandardInfoDetailsService standardInfoDetailsService;
|
||||
|
||||
/**
|
||||
* 查询试验标准管理
|
||||
*
|
||||
@ -62,14 +73,48 @@ public class StandardInfoServiceImpl implements IStandardInfoService
|
||||
/**
|
||||
* 新增试验标准管理
|
||||
*
|
||||
* @param standardInfo 试验标准管理
|
||||
* @param standardManagerVO 试验标准管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertStandardInfo(StandardInfo standardInfo)
|
||||
public int insertStandardInfo(StandardManagerVO standardManagerVO)
|
||||
{
|
||||
standardInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return standardInfoMapper.insertStandardInfo(standardInfo);
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 取出缓存数据
|
||||
String name = "";
|
||||
String fileName = "";
|
||||
StringBuffer sb = new StringBuffer();
|
||||
// String s:standardManagerVO.getPath().split("/",9)
|
||||
String[] str = standardManagerVO.getPath().split("/",6);
|
||||
for(int i=0;i<str.length;i++){
|
||||
System.out.println("name>>>"+str[i]);
|
||||
if(i>=2){
|
||||
sb.append("/");
|
||||
sb.append(str[i]);
|
||||
}
|
||||
name = str[i];
|
||||
}
|
||||
System.out.println("sb>>>"+sb.toString());
|
||||
try{
|
||||
byte[] bytes = redisCache.getCacheObject(Constants.UPLOAD_FILE+name);
|
||||
InputStream inputStream = new ByteArrayInputStream(bytes);
|
||||
// String fileType = FileTypeUtils.getType(bytes);
|
||||
MultipartFile files = new MockMultipartFile(ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream);
|
||||
fileName = sb.toString();
|
||||
File desc = FileUploadUtils.getAbsoluteFile(filePath, fileName);
|
||||
files.transferTo(desc);
|
||||
standardManagerVO.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
standardInfoMapper.insertStandardInfo(standardManagerVO);
|
||||
StandardInfoDetails standardInfoDetails = new StandardInfoDetails();
|
||||
standardInfoDetails.setFileUrl(filePath+fileName);
|
||||
standardInfoDetails.setFileName(name);
|
||||
standardInfoDetails.setStandardId(standardManagerVO.getStandardId());
|
||||
standardInfoDetails.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
return standardInfoDetailsService.insertStandardInfoDetails(standardInfoDetails);
|
||||
}catch (Exception e){
|
||||
throw new ServiceException("新增失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -113,7 +158,6 @@ public class StandardInfoServiceImpl implements IStandardInfoService
|
||||
public String uploadFile(MultipartFile file) {
|
||||
try {
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
IdUtils.fastUUID();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String name ="";
|
||||
@ -121,12 +165,18 @@ public class StandardInfoServiceImpl implements IStandardInfoService
|
||||
System.out.println("path>>>"+s);
|
||||
name = s;
|
||||
}
|
||||
Byte[] data = new Byte[file.getResource().getInputStream().available()];
|
||||
|
||||
byte[] data = file.getBytes();
|
||||
// Byte[] data = new Byte[file.getResource().getInputStream().available()];
|
||||
|
||||
redisCache.setCacheObject(Constants.UPLOAD_FILE+name,
|
||||
data, 30, TimeUnit.MINUTES);
|
||||
// 取出缓存数据
|
||||
Byte[] bytes = redisCache.getCacheObject(Constants.UPLOAD_FILE+name);
|
||||
|
||||
// byte[] bytes = redisCache.getCacheObject(Constants.UPLOAD_FILE+name);
|
||||
// InputStream inputStream = new ByteArrayInputStream(bytes);
|
||||
// String fileType = FileTypeUtils.getType(bytes);
|
||||
// MultipartFile testFiles = new MockMultipartFile(ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream);
|
||||
// File desc = FileUploadUtils.getAbsoluteFile(filePath, name);
|
||||
// testFiles.transferTo(desc);
|
||||
return fileName;
|
||||
}catch (Exception e){
|
||||
throw new ServiceException("上传失败:" + e.getMessage());
|
||||
|
@ -0,0 +1,24 @@
|
||||
package com.ruoyi.productionManager.vo;
|
||||
|
||||
import com.ruoyi.productionManager.domain.StandardInfo;
|
||||
|
||||
public class StandardManagerVO extends StandardInfo {
|
||||
private static final long serialVersionUID = -5124848255962397905L;
|
||||
|
||||
private String path;
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StandardManagerVO{" +
|
||||
"path='" + path + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
<?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.productionManager.mapper.StandardInfoDetailsMapper">
|
||||
|
||||
<resultMap type="StandardInfoDetails" id="StandardInfoDetailsResult">
|
||||
<result property="detailsId" column="details_id" />
|
||||
<result property="standardId" column="standard_id" />
|
||||
<result property="fileName" column="file_name" />
|
||||
<result property="fileUrl" column="file_url" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectStandardInfoDetailsVo">
|
||||
select details_id, standard_id, file_name, file_url, create_by, create_time, update_by, update_time, remark from standard_info_details
|
||||
</sql>
|
||||
|
||||
<select id="selectStandardInfoDetailsList" parameterType="StandardInfoDetails" resultMap="StandardInfoDetailsResult">
|
||||
<include refid="selectStandardInfoDetailsVo"/>
|
||||
<where>
|
||||
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||||
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectStandardInfoDetailsByDetailsId" parameterType="Long" resultMap="StandardInfoDetailsResult">
|
||||
<include refid="selectStandardInfoDetailsVo"/>
|
||||
where details_id = #{detailsId}
|
||||
</select>
|
||||
|
||||
<insert id="insertStandardInfoDetails" parameterType="StandardInfoDetails" useGeneratedKeys="true" keyProperty="detailsId">
|
||||
insert into standard_info_details
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="standardId != null">standard_id,</if>
|
||||
<if test="fileName != null and fileName != ''">file_name,</if>
|
||||
<if test="fileUrl != null and fileUrl != ''">file_url,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="standardId != null">#{standardId},</if>
|
||||
<if test="fileName != null and fileName != ''">#{fileName},</if>
|
||||
<if test="fileUrl != null and fileUrl != ''">#{fileUrl},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateStandardInfoDetails" parameterType="StandardInfoDetails">
|
||||
update standard_info_details
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="standardId != null">standard_id = #{standardId},</if>
|
||||
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
|
||||
<if test="fileUrl != null and fileUrl != ''">file_url = #{fileUrl},</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>
|
||||
</trim>
|
||||
where details_id = #{detailsId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteStandardInfoDetailsByDetailsId" parameterType="Long">
|
||||
delete from standard_info_details where details_id = #{detailsId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteStandardInfoDetailsByDetailsIds" parameterType="String">
|
||||
delete from standard_info_details where details_id in
|
||||
<foreach item="detailsId" collection="array" open="(" separator="," close=")">
|
||||
#{detailsId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -38,9 +38,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where standard_id = #{standardId}
|
||||
</select>
|
||||
|
||||
<insert id="insertStandardInfo" parameterType="StandardInfo" useGeneratedKeys="true" keyProperty="standardId">
|
||||
<insert id="insertStandardInfo"
|
||||
parameterType="StandardInfo" useGeneratedKeys="true" keyProperty="standardId">
|
||||
<selectKey resultType="java.lang.Long" keyProperty="standardId" order="AFTER" >
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into standard_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<!--<if test="standardId != null and standardId != ''">standard_id,</if>-->
|
||||
<if test="areaCategory != null and areaCategory != ''">area_category,</if>
|
||||
<if test="standardName != null and standardName != ''">standard_name,</if>
|
||||
<if test="standardCategory != null and standardCategory != ''">standard_category,</if>
|
||||
|
Reference in New Issue
Block a user