附件上传,异常bug修改
parent
77e06fa969
commit
203b0054e4
@ -0,0 +1,124 @@
|
||||
package com.foreverwin.mesnac.anomaly.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.anomaly.model.UploadPictures;
|
||||
import com.foreverwin.mesnac.anomaly.service.UploadPicturesService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import com.foreverwin.modular.core.util.R;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/Z-UPLOAD-PICTURES")
|
||||
public class UploadPicturesController {
|
||||
|
||||
@Autowired
|
||||
public UploadPicturesService uploadPicturesService;
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/{id:.+}")
|
||||
public R getUploadPicturesById(@PathVariable String id) {
|
||||
return R.ok( uploadPicturesService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("")
|
||||
public R getUploadPicturesList(UploadPictures uploadPictures){
|
||||
List<UploadPictures> result;
|
||||
QueryWrapper<UploadPictures> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(uploadPictures);
|
||||
result = uploadPicturesService.list(queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param frontPage 分页信息
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage<UploadPictures> frontPage, UploadPictures uploadPictures){
|
||||
IPage result;
|
||||
QueryWrapper<UploadPictures> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(uploadPictures);
|
||||
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
|
||||
//TODO modify global query
|
||||
queryWrapper.lambda().and(wrapper -> wrapper
|
||||
.like(UploadPictures::getHandle, frontPage.getGlobalQuery())
|
||||
.or().like(UploadPictures::getSite, frontPage.getGlobalQuery())
|
||||
.or().like(UploadPictures::getPicturePath, frontPage.getGlobalQuery())
|
||||
.or().like(UploadPictures::getPictureAddress, frontPage.getGlobalQuery())
|
||||
.or().like(UploadPictures::getObjectBo, frontPage.getGlobalQuery())
|
||||
.or().like(UploadPictures::getNum, frontPage.getGlobalQuery())
|
||||
.or().like(UploadPictures::getType, frontPage.getGlobalQuery())
|
||||
.or().like(UploadPictures::getCreatedUser, frontPage.getGlobalQuery())
|
||||
.or().like(UploadPictures::getModifiedUser, frontPage.getGlobalQuery())
|
||||
);
|
||||
}
|
||||
result = uploadPicturesService.page(frontPage.getPagePlus(), queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param uploadPictures 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PostMapping
|
||||
public R save(@RequestBody UploadPictures uploadPictures) {
|
||||
return R.ok(uploadPicturesService.save(uploadPictures));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param uploadPictures 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody UploadPictures uploadPictures) {
|
||||
return R.ok(uploadPicturesService.updateById(uploadPictures));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除对象
|
||||
* @param id 实体ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
|
||||
public R removeById(@PathVariable("id") String id){
|
||||
return R.ok(uploadPicturesService.removeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除对象
|
||||
* @param ids 实体集合ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
|
||||
public R removeByIds(List<String> ids){
|
||||
return R.ok(uploadPicturesService.removeByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.foreverwin.mesnac.anomaly.mapper;
|
||||
|
||||
import com.foreverwin.mesnac.anomaly.model.UploadPictures;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
@Repository
|
||||
public interface UploadPicturesMapper extends BaseMapper<UploadPictures> {
|
||||
|
||||
}
|
@ -0,0 +1,216 @@
|
||||
package com.foreverwin.mesnac.anomaly.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
|
||||
@TableName("Z_UPLOAD_PICTURES")
|
||||
|
||||
public class UploadPictures extends Model<UploadPictures> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "HANDLE", type = IdType.INPUT)
|
||||
private String handle;
|
||||
/**
|
||||
* 站点
|
||||
*/
|
||||
@TableField("SITE")
|
||||
private String site;
|
||||
/**
|
||||
* 图片路径
|
||||
*/
|
||||
@TableField("PICTURE_PATH")
|
||||
private String picturePath;
|
||||
/**
|
||||
* 图片路径详细地址
|
||||
*/
|
||||
@TableField("PICTURE_ADDRESS")
|
||||
private String pictureAddress;
|
||||
/**
|
||||
* 单号
|
||||
*/
|
||||
@TableField("OBJECT_BO")
|
||||
private String objectBo;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@TableField("NUM")
|
||||
private String num;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@TableField("TYPE")
|
||||
private String type;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("CREATED_USER")
|
||||
private String createdUser;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("CREATED_DATE_TIME")
|
||||
private LocalDateTime createdDateTime;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField("MODIFIED_USER")
|
||||
private String modifiedUser;
|
||||
/**
|
||||
* 修改日期
|
||||
*/
|
||||
@TableField("MODIFIED_DATE_TIME")
|
||||
private LocalDateTime modifiedDateTime;
|
||||
|
||||
|
||||
public String getHandle() {
|
||||
return handle;
|
||||
}
|
||||
|
||||
public void setHandle(String handle) {
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
public String getSite() {
|
||||
return site;
|
||||
}
|
||||
|
||||
public void setSite(String site) {
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
public String getPicturePath() {
|
||||
return picturePath;
|
||||
}
|
||||
|
||||
public void setPicturePath(String picturePath) {
|
||||
this.picturePath = picturePath;
|
||||
}
|
||||
|
||||
public String getPictureAddress() {
|
||||
return pictureAddress;
|
||||
}
|
||||
|
||||
public void setPictureAddress(String pictureAddress) {
|
||||
this.pictureAddress = pictureAddress;
|
||||
}
|
||||
|
||||
public String getObjectBo() {
|
||||
return objectBo;
|
||||
}
|
||||
|
||||
public void setObjectBo(String objectBo) {
|
||||
this.objectBo = objectBo;
|
||||
}
|
||||
|
||||
public String getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(String num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getCreatedUser() {
|
||||
return createdUser;
|
||||
}
|
||||
|
||||
public void setCreatedUser(String createdUser) {
|
||||
this.createdUser = createdUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedDateTime() {
|
||||
return createdDateTime;
|
||||
}
|
||||
|
||||
public void setCreatedDateTime(LocalDateTime createdDateTime) {
|
||||
this.createdDateTime = createdDateTime;
|
||||
}
|
||||
|
||||
public String getModifiedUser() {
|
||||
return modifiedUser;
|
||||
}
|
||||
|
||||
public void setModifiedUser(String modifiedUser) {
|
||||
this.modifiedUser = modifiedUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getModifiedDateTime() {
|
||||
return modifiedDateTime;
|
||||
}
|
||||
|
||||
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
|
||||
this.modifiedDateTime = modifiedDateTime;
|
||||
}
|
||||
|
||||
public static final String HANDLE = "HANDLE";
|
||||
|
||||
public static final String SITE = "SITE";
|
||||
|
||||
public static final String PICTURE_PATH = "PICTURE_PATH";
|
||||
|
||||
public static final String PICTURE_ADDRESS = "PICTURE_ADDRESS";
|
||||
|
||||
public static final String OBJECT_BO = "OBJECT_BO";
|
||||
|
||||
public static final String NUM = "NUM";
|
||||
|
||||
public static final String TYPE = "TYPE";
|
||||
|
||||
public static final String CREATED_USER = "CREATED_USER";
|
||||
|
||||
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
|
||||
|
||||
public static final String MODIFIED_USER = "MODIFIED_USER";
|
||||
|
||||
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UploadPictures{" +
|
||||
"handle = " + handle +
|
||||
", site = " + site +
|
||||
", picturePath = " + picturePath +
|
||||
", pictureAddress = " + pictureAddress +
|
||||
", objectBo = " + objectBo +
|
||||
", num = " + num +
|
||||
", type = " + type +
|
||||
", createdUser = " + createdUser +
|
||||
", createdDateTime = " + createdDateTime +
|
||||
", modifiedUser = " + modifiedUser +
|
||||
", modifiedDateTime = " + modifiedDateTime +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.foreverwin.mesnac.anomaly.service;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author zhaojiawei
|
||||
* @Since 2021-07-11
|
||||
*/
|
||||
public interface FileUploadedService {
|
||||
|
||||
public void uploadAttachment(MultipartFile fileItem, String site, String taskNo, String fileType);
|
||||
|
||||
public String showFile(HttpServletRequest request, HttpServletResponse response) throws Exception ;
|
||||
|
||||
public boolean deleteFile(String pathname, String filename);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.foreverwin.mesnac.anomaly.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.anomaly.model.UploadPictures;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
public interface UploadPicturesService extends IService<UploadPictures> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param frontPage
|
||||
* @return
|
||||
*/
|
||||
IPage<UploadPictures> selectPage(FrontPage<UploadPictures> frontPage, UploadPictures uploadPictures);
|
||||
|
||||
List<UploadPictures> selectList(UploadPictures uploadPictures);
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.foreverwin.mesnac.anomaly.service.impl;
|
||||
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.anomaly.model.UploadPictures;
|
||||
import com.foreverwin.mesnac.anomaly.mapper.UploadPicturesMapper;
|
||||
import com.foreverwin.mesnac.anomaly.service.UploadPicturesService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-07-11
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class UploadPicturesServiceImpl extends ServiceImpl<UploadPicturesMapper, UploadPictures> implements UploadPicturesService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private UploadPicturesMapper uploadPicturesMapper;
|
||||
|
||||
@Override
|
||||
public IPage<UploadPictures> selectPage(FrontPage<UploadPictures> frontPage, UploadPictures uploadPictures) {
|
||||
QueryWrapper<UploadPictures> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(uploadPictures);
|
||||
return super.page(frontPage.getPagePlus(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UploadPictures> selectList(UploadPictures uploadPictures) {
|
||||
QueryWrapper<UploadPictures> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(uploadPictures);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,418 @@
|
||||
<?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.foreverwin.mesnac.anomaly.mapper.UploadPicturesMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.anomaly.model.UploadPictures">
|
||||
<id column="HANDLE" property="handle" />
|
||||
<result column="SITE" property="site" />
|
||||
<result column="PICTURE_PATH" property="picturePath" />
|
||||
<result column="PICTURE_ADDRESS" property="pictureAddress" />
|
||||
<result column="OBJECT_BO" property="objectBo" />
|
||||
<result column="NUM" property="num" />
|
||||
<result column="TYPE" property="type" />
|
||||
<result column="CREATED_USER" property="createdUser" />
|
||||
<result column="CREATED_DATE_TIME" property="createdDateTime" />
|
||||
<result column="MODIFIED_USER" property="modifiedUser" />
|
||||
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, SITE, PICTURE_PATH, PICTURE_ADDRESS, OBJECT_BO, NUM, TYPE, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_UPLOAD_PICTURES WHERE HANDLE=#{handle}
|
||||
</select>
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_UPLOAD_PICTURES
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectBatchIds" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_UPLOAD_PICTURES WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</select>
|
||||
|
||||
<select id="selectOne" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_UPLOAD_PICTURES
|
||||
<where>
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
|
||||
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
|
||||
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
|
||||
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCount" resultType="Integer">
|
||||
SELECT COUNT(1) FROM Z_UPLOAD_PICTURES
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
|
||||
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
|
||||
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
|
||||
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_UPLOAD_PICTURES
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
|
||||
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
|
||||
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
|
||||
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMaps" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_UPLOAD_PICTURES
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
|
||||
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
|
||||
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
|
||||
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectObjs" resultType="Object">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_UPLOAD_PICTURES
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
|
||||
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
|
||||
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
|
||||
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_UPLOAD_PICTURES
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
|
||||
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
|
||||
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
|
||||
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMapsPage" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_UPLOAD_PICTURES
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
|
||||
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
|
||||
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
|
||||
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.foreverwin.mesnac.anomaly.model.UploadPictures">
|
||||
INSERT INTO Z_UPLOAD_PICTURES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="site!=null">SITE,</if>
|
||||
<if test="picturePath!=null">PICTURE_PATH,</if>
|
||||
<if test="pictureAddress!=null">PICTURE_ADDRESS,</if>
|
||||
<if test="objectBo!=null">OBJECT_BO,</if>
|
||||
<if test="num!=null">NUM,</if>
|
||||
<if test="type!=null">TYPE,</if>
|
||||
<if test="createdUser!=null">CREATED_USER,</if>
|
||||
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
||||
<if test="modifiedUser!=null">MODIFIED_USER,</if>
|
||||
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
<if test="site!=null">#{site},</if>
|
||||
<if test="picturePath!=null">#{picturePath},</if>
|
||||
<if test="pictureAddress!=null">#{pictureAddress},</if>
|
||||
<if test="objectBo!=null">#{objectBo},</if>
|
||||
<if test="num!=null">#{num},</if>
|
||||
<if test="type!=null">#{type},</if>
|
||||
<if test="createdUser!=null">#{createdUser},</if>
|
||||
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
||||
<if test="modifiedUser!=null">#{modifiedUser},</if>
|
||||
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.anomaly.model.UploadPictures">
|
||||
INSERT INTO Z_UPLOAD_PICTURES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{site},
|
||||
#{picturePath},
|
||||
#{pictureAddress},
|
||||
#{objectBo},
|
||||
#{num},
|
||||
#{type},
|
||||
#{createdUser},
|
||||
#{createdDateTime},
|
||||
#{modifiedUser},
|
||||
#{modifiedDateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateById">
|
||||
UPDATE Z_UPLOAD_PICTURES <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.picturePath!=null">PICTURE_PATH=#{et.picturePath},</if>
|
||||
<if test="et.pictureAddress!=null">PICTURE_ADDRESS=#{et.pictureAddress},</if>
|
||||
<if test="et.objectBo!=null">OBJECT_BO=#{et.objectBo},</if>
|
||||
<if test="et.num!=null">NUM=#{et.num},</if>
|
||||
<if test="et.type!=null">TYPE=#{et.type},</if>
|
||||
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.modifiedUser!=null">MODIFIED_USER=#{et.modifiedUser},</if>
|
||||
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateAllColumnById">
|
||||
UPDATE Z_UPLOAD_PICTURES <trim prefix="SET" suffixOverrides=",">
|
||||
SITE=#{et.site},
|
||||
PICTURE_PATH=#{et.picturePath},
|
||||
PICTURE_ADDRESS=#{et.pictureAddress},
|
||||
OBJECT_BO=#{et.objectBo},
|
||||
NUM=#{et.num},
|
||||
TYPE=#{et.type},
|
||||
CREATED_USER=#{et.createdUser},
|
||||
CREATED_DATE_TIME=#{et.createdDateTime},
|
||||
MODIFIED_USER=#{et.modifiedUser},
|
||||
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="update">
|
||||
UPDATE Z_UPLOAD_PICTURES <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.picturePath!=null">PICTURE_PATH=#{et.picturePath},</if>
|
||||
<if test="et.pictureAddress!=null">PICTURE_ADDRESS=#{et.pictureAddress},</if>
|
||||
<if test="et.objectBo!=null">OBJECT_BO=#{et.objectBo},</if>
|
||||
<if test="et.num!=null">NUM=#{et.num},</if>
|
||||
<if test="et.type!=null">TYPE=#{et.type},</if>
|
||||
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.modifiedUser!=null">MODIFIED_USER=#{et.modifiedUser},</if>
|
||||
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
|
||||
</trim>
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
|
||||
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
|
||||
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
|
||||
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<delete id="deleteById">
|
||||
DELETE FROM Z_UPLOAD_PICTURES WHERE HANDLE=#{handle}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByMap">
|
||||
DELETE FROM Z_UPLOAD_PICTURES
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="delete">
|
||||
DELETE FROM Z_UPLOAD_PICTURES
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
|
||||
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
|
||||
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
|
||||
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBatchIds">
|
||||
DELETE FROM Z_UPLOAD_PICTURES WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</delete>
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue