护理员app新增代码
This commit is contained in:
parent
9af9df10b7
commit
f9391589fd
@ -0,0 +1,107 @@
|
||||
package com.xinelu.manage.controller.appfileinfo;
|
||||
|
||||
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.appfileinfo.AppFileInfo;
|
||||
import com.xinelu.manage.dto.appfileInfo.AppFileInfoDTO;
|
||||
import com.xinelu.manage.service.appfileinfo.IAppFileInfoService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 护理员App文件管理Controller
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2022-11-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/appFileInfo")
|
||||
public class AppFileInfoController extends BaseController {
|
||||
@Resource
|
||||
private IAppFileInfoService appFileInfoService;
|
||||
|
||||
/**
|
||||
* 查询护理员App文件管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appFileInfo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AppFileInfo appFileInfo) {
|
||||
startPage();
|
||||
List<AppFileInfo> list = appFileInfoService.selectAppFileInfoList(appFileInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出护理员App文件管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appFileInfo:export')")
|
||||
@Log(title = "护理员App文件管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AppFileInfo appFileInfo) {
|
||||
List<AppFileInfo> list = appFileInfoService.selectAppFileInfoList(appFileInfo);
|
||||
ExcelUtil<AppFileInfo> util = new ExcelUtil<>(AppFileInfo.class);
|
||||
util.exportExcel(response, list, "护理员App文件管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取护理员App文件管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appFileInfo:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(appFileInfoService.selectAppFileInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增护理员App文件管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appFileInfo:add')")
|
||||
@Log(title = "护理员App文件管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AppFileInfo appFileInfo) {
|
||||
return toAjax(appFileInfoService.insertAppFileInfo(appFileInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改护理员App文件管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appFileInfo:edit')")
|
||||
@Log(title = "护理员App文件管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AppFileInfo appFileInfo) {
|
||||
return toAjax(appFileInfoService.updateAppFileInfo(appFileInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除护理员App文件管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appFileInfo:remove')")
|
||||
@Log(title = "护理员App文件管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(appFileInfoService.deleteAppFileInfoByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 护理员App上传apk
|
||||
*
|
||||
* @param appFileInfoDTO 文件及版本
|
||||
* @return 结果
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@PostMapping("uploadAppFileUrl")
|
||||
public AjaxResult uploadAppFileUrl(@Validated(Insert.class) AppFileInfoDTO appFileInfoDTO) throws Exception {
|
||||
return appFileInfoService.uploadAppFileInfo(appFileInfoDTO);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package com.xinelu.manage.domain.appfileinfo;
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseDomain;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 护理员App文件管理对象 app_file_info
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2022-11-15
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "护理员App文件管理对象", description = "app_file_info")
|
||||
public class AppFileInfo extends BaseDomain implements Serializable {
|
||||
private static final long serialVersionUID = 1816389724122943745L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
@ApiModelProperty(value = "文件名称")
|
||||
@Excel(name = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件对外下载路径
|
||||
*/
|
||||
@ApiModelProperty(value = "文件对外下载路径")
|
||||
@Excel(name = "文件对外下载路径")
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 服务器本地路径
|
||||
*/
|
||||
@ApiModelProperty(value = "服务器本地路径")
|
||||
@Excel(name = "服务器本地路径")
|
||||
private String fileLocalPath;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@ApiModelProperty(value = "版本号")
|
||||
@Excel(name = "版本号")
|
||||
private String fileVersion;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("fileName", getFileName())
|
||||
.append("fileUrl", getFileUrl())
|
||||
.append("fileVersion", getFileVersion())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.xinelu.manage.dto.appfileInfo;
|
||||
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description 上传护理员App文件
|
||||
* @Author zh
|
||||
* @Date 2022-11-15
|
||||
*/
|
||||
@Data
|
||||
public class AppFileInfoDTO implements Serializable {
|
||||
private static final long serialVersionUID = 4349642127285334486L;
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@NotBlank(message = "版本号不能为空", groups = {Insert.class})
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 文件
|
||||
*/
|
||||
@NotNull(message = "请选择所要上传的Apk文件!", groups = {Insert.class})
|
||||
private MultipartFile file;
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.xinelu.manage.mapper.appfileinfo;
|
||||
|
||||
|
||||
import com.xinelu.manage.domain.appfileinfo.AppFileInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 护理员App文件管理Mapper接口
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2022-11-15
|
||||
*/
|
||||
public interface AppFileInfoMapper {
|
||||
/**
|
||||
* 查询护理员App文件管理
|
||||
*
|
||||
* @param id 护理员App文件管理主键
|
||||
* @return 护理员App文件管理
|
||||
*/
|
||||
AppFileInfo selectAppFileInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询护理员App文件管理列表
|
||||
*
|
||||
* @param appFileInfo 护理员App文件管理
|
||||
* @return 护理员App文件管理集合
|
||||
*/
|
||||
List<AppFileInfo> selectAppFileInfoList(AppFileInfo appFileInfo);
|
||||
|
||||
/**
|
||||
* 新增护理员App文件管理
|
||||
*
|
||||
* @param appFileInfo 护理员App文件管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAppFileInfo(AppFileInfo appFileInfo);
|
||||
|
||||
/**
|
||||
* 修改护理员App文件管理
|
||||
*
|
||||
* @param appFileInfo 护理员App文件管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAppFileInfo(AppFileInfo appFileInfo);
|
||||
|
||||
/**
|
||||
* 删除护理员App文件管理
|
||||
*
|
||||
* @param id 护理员App文件管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAppFileInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除护理员App文件管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAppFileInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 查询泉医到家App文件信息表最新的一条数据
|
||||
*
|
||||
* @return com.xinyilu.base.domain.appfileinfo.AppFileInfo
|
||||
**/
|
||||
AppFileInfo getAppFileInfoByOneId();
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.xinelu.manage.service.appfileinfo;
|
||||
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.domain.appfileinfo.AppFileInfo;
|
||||
import com.xinelu.manage.dto.appfileInfo.AppFileInfoDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 护理员App文件管理Service接口
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2022-11-15
|
||||
*/
|
||||
public interface IAppFileInfoService {
|
||||
/**
|
||||
* 查询护理员App文件管理
|
||||
*
|
||||
* @param id 护理员App文件管理主键
|
||||
* @return 护理员App文件管理
|
||||
*/
|
||||
AppFileInfo selectAppFileInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询护理员App文件管理列表
|
||||
*
|
||||
* @param appFileInfo 护理员App文件管理
|
||||
* @return 护理员App文件管理集合
|
||||
*/
|
||||
List<AppFileInfo> selectAppFileInfoList(AppFileInfo appFileInfo);
|
||||
|
||||
/**
|
||||
* 新增护理员App文件管理
|
||||
*
|
||||
* @param appFileInfo 护理员App文件管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAppFileInfo(AppFileInfo appFileInfo);
|
||||
|
||||
/**
|
||||
* 修改护理员App文件管理
|
||||
*
|
||||
* @param appFileInfo 护理员App文件管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAppFileInfo(AppFileInfo appFileInfo);
|
||||
|
||||
/**
|
||||
* 批量删除护理员App文件管理
|
||||
*
|
||||
* @param ids 需要删除的护理员App文件管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAppFileInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 护理员App上传apk
|
||||
*
|
||||
* @param appFileInfoDTO 文件及版本号
|
||||
* @return 结果
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
AjaxResult uploadAppFileInfo(AppFileInfoDTO appFileInfoDTO) throws Exception;
|
||||
}
|
||||
@ -0,0 +1,131 @@
|
||||
package com.xinelu.manage.service.appfileinfo.impl;
|
||||
|
||||
|
||||
import com.xinelu.common.config.XinELuConfig;
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.file.FileUploadUtils;
|
||||
import com.xinelu.common.utils.file.MimeTypeUtils;
|
||||
import com.xinelu.manage.domain.appfileinfo.AppFileInfo;
|
||||
import com.xinelu.manage.dto.appfileInfo.AppFileInfoDTO;
|
||||
import com.xinelu.manage.mapper.appfileinfo.AppFileInfoMapper;
|
||||
import com.xinelu.manage.service.appfileinfo.IAppFileInfoService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 护理员App文件管理Service业务层处理
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2022-11-15
|
||||
*/
|
||||
@Service
|
||||
public class AppFileInfoServiceImpl implements IAppFileInfoService {
|
||||
@Resource
|
||||
private AppFileInfoMapper appFileInfoMapper;
|
||||
@Resource
|
||||
private XinELuConfig xinYiLuConfig;
|
||||
|
||||
/**
|
||||
* 查询护理员App文件管理
|
||||
*
|
||||
* @param id 护理员App文件管理主键
|
||||
* @return 护理员App文件管理
|
||||
*/
|
||||
@Override
|
||||
public AppFileInfo selectAppFileInfoById(Long id) {
|
||||
return appFileInfoMapper.selectAppFileInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询护理员App文件管理列表
|
||||
*
|
||||
* @param appFileInfo 护理员App文件管理
|
||||
* @return 护理员App文件管理
|
||||
*/
|
||||
@Override
|
||||
public List<AppFileInfo> selectAppFileInfoList(AppFileInfo appFileInfo) {
|
||||
return appFileInfoMapper.selectAppFileInfoList(appFileInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增护理员App文件管理
|
||||
*
|
||||
* @param appFileInfo 护理员App文件管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAppFileInfo(AppFileInfo appFileInfo) {
|
||||
appFileInfo.setCreateTime(LocalDateTime.now());
|
||||
return appFileInfoMapper.insertAppFileInfo(appFileInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改护理员App文件管理
|
||||
*
|
||||
* @param appFileInfo 护理员App文件管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAppFileInfo(AppFileInfo appFileInfo) {
|
||||
appFileInfo.setUpdateTime(LocalDateTime.now());
|
||||
return appFileInfoMapper.updateAppFileInfo(appFileInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除护理员App文件管理
|
||||
*
|
||||
* @param ids 需要删除的护理员App文件管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppFileInfoByIds(Long[] ids) {
|
||||
return appFileInfoMapper.deleteAppFileInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 护理员App上传apk文件
|
||||
*
|
||||
* @param appFileInfoDTO 文件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult uploadAppFileInfo(AppFileInfoDTO appFileInfoDTO) throws Exception {
|
||||
if (StringUtils.isBlank(appFileInfoDTO.getFile().getOriginalFilename())
|
||||
|| !appFileInfoDTO.getFile().getOriginalFilename().endsWith(Constants.APK)) {
|
||||
return AjaxResult.error("文件格式不对,请上传apk格式的文件!");
|
||||
}
|
||||
if (!StringUtils.equals(Constants.APK_NAME, appFileInfoDTO.getFile().getOriginalFilename())) {
|
||||
return AjaxResult.error("泉医到家护理员Apk文件名称不正确,请将文件名称修改为:" + Constants.APK_NAME);
|
||||
}
|
||||
//获取路径名称
|
||||
String uploadPathUrl = XinELuConfig.getProfile() + xinYiLuConfig.getAppFileName();
|
||||
//上传图片
|
||||
String fileLocalPath = FileUploadUtils.uploadPersonAppApkPath(uploadPathUrl, appFileInfoDTO.getFile(), MimeTypeUtils.IMAGE_APK);
|
||||
if (StringUtils.isBlank(fileLocalPath)) {
|
||||
throw new ServiceException("护理员App文件上传失败,请联系管理员!");
|
||||
}
|
||||
AppFileInfo appFileInfo = new AppFileInfo();
|
||||
appFileInfo.setFileName(Constants.APK_NAME);
|
||||
appFileInfo.setFileUrl(xinYiLuConfig.getAppFilePath());
|
||||
appFileInfo.setFileLocalPath(fileLocalPath);
|
||||
appFileInfo.setFileVersion(appFileInfoDTO.getVersion());
|
||||
appFileInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
appFileInfo.setCreateTime(LocalDateTime.now());
|
||||
int insert = appFileInfoMapper.insertAppFileInfo(appFileInfo);
|
||||
if (insert <= 0) {
|
||||
throw new ServiceException("新增版本失败,请联系管理员!");
|
||||
}
|
||||
//获取返回值
|
||||
AjaxResult ajax = AjaxResult.success("上传成功!");
|
||||
ajax.put("imgUrl", fileLocalPath);
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,151 @@
|
||||
<?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.xinelu.manage.mapper.appfileinfo.AppFileInfoMapper">
|
||||
|
||||
<resultMap type="AppFileInfo" id="AppFileInfoResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="fileName" column="file_name"/>
|
||||
<result property="fileUrl" column="file_url"/>
|
||||
<result property="fileLocalPath" column="file_local_path"/>
|
||||
<result property="fileVersion" column="file_version"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppFileInfoVo">
|
||||
select id,
|
||||
file_name,
|
||||
file_url,
|
||||
file_local_path,
|
||||
file_version,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from app_file_info
|
||||
</sql>
|
||||
|
||||
<select id="selectAppFileInfoList" parameterType="AppFileInfo" resultMap="AppFileInfoResult">
|
||||
<include refid="selectAppFileInfoVo"/>
|
||||
<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>
|
||||
<if test="fileVersion != null and fileVersion != ''">
|
||||
and file_version = #{fileVersion}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppFileInfoById" parameterType="Long"
|
||||
resultMap="AppFileInfoResult">
|
||||
<include refid="selectAppFileInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppFileInfo" parameterType="AppFileInfo" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into app_file_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="fileName != null">file_name,
|
||||
</if>
|
||||
<if test="fileUrl != null">file_url,
|
||||
</if>
|
||||
<if test="fileLocalPath != null">file_local_path,
|
||||
</if>
|
||||
<if test="fileVersion != null">file_version,
|
||||
</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="fileName != null">#{fileName},
|
||||
</if>
|
||||
<if test="fileUrl != null">#{fileUrl},
|
||||
</if>
|
||||
<if test="fileLocalPath != null">#{fileLocalPath},
|
||||
</if>
|
||||
<if test="fileVersion != null">#{fileVersion},
|
||||
</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppFileInfo" parameterType="AppFileInfo">
|
||||
update app_file_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="fileName != null">file_name =
|
||||
#{fileName},
|
||||
</if>
|
||||
<if test="fileUrl != null">file_url =
|
||||
#{fileUrl},
|
||||
</if>
|
||||
<if test="fileLocalPath != null">file_local_path =
|
||||
#{fileLocalPath},
|
||||
</if>
|
||||
<if test="fileVersion != null">file_version =
|
||||
#{fileVersion},
|
||||
</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppFileInfoById" parameterType="Long">
|
||||
delete
|
||||
from app_file_info
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppFileInfoByIds" parameterType="String">
|
||||
delete from app_file_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getAppFileInfoByOneId" parameterType="AppFileInfo" resultType="AppFileInfo">
|
||||
select id,
|
||||
file_name,
|
||||
file_url,
|
||||
file_local_path,
|
||||
file_version,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from app_file_info
|
||||
ORDER BY id DESC LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user