设备模块更新、新增刀具
parent
ed3d2f510a
commit
1a76d572a2
@ -0,0 +1,130 @@
|
||||
package com.foreverwin.mesnac.production.controller;
|
||||
|
||||
import com.foreverwin.modular.core.util.R;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import com.foreverwin.modular.core.util.CommonMethods;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.foreverwin.mesnac.production.service.ToolService;
|
||||
import com.foreverwin.mesnac.production.model.Tool;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author pavel.liu
|
||||
* @since 2021-07-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/Z-TOOL")
|
||||
public class ToolController {
|
||||
|
||||
@Autowired
|
||||
public ToolService toolService;
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/{id:.+}")
|
||||
public R getToolById(@PathVariable String id) {
|
||||
return R.ok( toolService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("")
|
||||
public R getToolList(Tool tool){
|
||||
String site = CommonMethods.getSite();
|
||||
tool.setSite(site);
|
||||
List<Tool> result;
|
||||
QueryWrapper<Tool> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(tool);
|
||||
result = toolService.list(queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param frontPage 分页信息
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage<Tool> frontPage, Tool tool){
|
||||
IPage result;
|
||||
QueryWrapper<Tool> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(tool);
|
||||
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
|
||||
//TODO modify global query
|
||||
queryWrapper.lambda().and(wrapper -> wrapper
|
||||
.like(Tool::getHandle, frontPage.getGlobalQuery())
|
||||
.or().like(Tool::getSite, frontPage.getGlobalQuery())
|
||||
.or().like(Tool::getTool, frontPage.getGlobalQuery())
|
||||
.or().like(Tool::getDescription, frontPage.getGlobalQuery())
|
||||
.or().like(Tool::getStatus, frontPage.getGlobalQuery())
|
||||
.or().like(Tool::getToolType, frontPage.getGlobalQuery())
|
||||
.or().like(Tool::getSpecification, frontPage.getGlobalQuery())
|
||||
.or().like(Tool::getBrand, frontPage.getGlobalQuery())
|
||||
.or().like(Tool::getRemark, frontPage.getGlobalQuery())
|
||||
.or().like(Tool::getCreateUser, frontPage.getGlobalQuery())
|
||||
.or().like(Tool::getModifyUser, frontPage.getGlobalQuery())
|
||||
);
|
||||
}
|
||||
result = toolService.page(frontPage.getPagePlus(), queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param tool 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PostMapping
|
||||
public R save(@RequestBody Tool tool) {
|
||||
return R.ok(toolService.save(tool));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param tool 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody Tool tool) {
|
||||
return R.ok(toolService.updateById(tool));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除对象
|
||||
* @param id 实体ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
|
||||
public R removeById(@PathVariable("id") String id){
|
||||
return R.ok(toolService.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(toolService.removeByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.foreverwin.mesnac.production.mapper;
|
||||
|
||||
import com.foreverwin.mesnac.production.model.Tool;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 工具表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author pavel.liu
|
||||
* @since 2021-07-14
|
||||
*/
|
||||
@Repository
|
||||
public interface ToolMapper extends BaseMapper<Tool> {
|
||||
|
||||
}
|
@ -0,0 +1,249 @@
|
||||
package com.foreverwin.mesnac.production.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 工具表
|
||||
* </p>
|
||||
*
|
||||
* @author pavel.liu
|
||||
* @since 2021-07-14
|
||||
*/
|
||||
|
||||
@TableName("Z_TOOL")
|
||||
|
||||
public class Tool extends Model<Tool> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "HANDLE", type = IdType.INPUT)
|
||||
private String handle;
|
||||
/**
|
||||
* 站点
|
||||
*/
|
||||
@TableField("SITE")
|
||||
private String site;
|
||||
/**
|
||||
* 工具具编号
|
||||
*/
|
||||
@TableField("TOOL")
|
||||
private String tool;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@TableField("DESCRIPTION")
|
||||
private String description;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField("STATUS")
|
||||
private String status;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@TableField("TOOL_TYPE")
|
||||
private String toolType;
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@TableField("SPECIFICATION")
|
||||
private String specification;
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
@TableField("BRAND")
|
||||
private String brand;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("REMARK")
|
||||
private String remark;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("CREATE_USER")
|
||||
private String createUser;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("CREATED_DATE_TIME")
|
||||
private LocalDateTime createdDateTime;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField("MODIFY_USER")
|
||||
private String modifyUser;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@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 getTool() {
|
||||
return tool;
|
||||
}
|
||||
|
||||
public void setTool(String tool) {
|
||||
this.tool = tool;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getToolType() {
|
||||
return toolType;
|
||||
}
|
||||
|
||||
public void setToolType(String toolType) {
|
||||
this.toolType = toolType;
|
||||
}
|
||||
|
||||
public String getSpecification() {
|
||||
return specification;
|
||||
}
|
||||
|
||||
public void setSpecification(String specification) {
|
||||
this.specification = specification;
|
||||
}
|
||||
|
||||
public String getBrand() {
|
||||
return brand;
|
||||
}
|
||||
|
||||
public void setBrand(String brand) {
|
||||
this.brand = brand;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(String createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedDateTime() {
|
||||
return createdDateTime;
|
||||
}
|
||||
|
||||
public void setCreatedDateTime(LocalDateTime createdDateTime) {
|
||||
this.createdDateTime = createdDateTime;
|
||||
}
|
||||
|
||||
public String getModifyUser() {
|
||||
return modifyUser;
|
||||
}
|
||||
|
||||
public void setModifyUser(String modifyUser) {
|
||||
this.modifyUser = modifyUser;
|
||||
}
|
||||
|
||||
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 TOOL = "TOOL";
|
||||
|
||||
public static final String DESCRIPTION = "DESCRIPTION";
|
||||
|
||||
public static final String STATUS = "STATUS";
|
||||
|
||||
public static final String TOOL_TYPE = "TOOL_TYPE";
|
||||
|
||||
public static final String SPECIFICATION = "SPECIFICATION";
|
||||
|
||||
public static final String BRAND = "BRAND";
|
||||
|
||||
public static final String REMARK = "REMARK";
|
||||
|
||||
public static final String CREATE_USER = "CREATE_USER";
|
||||
|
||||
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
|
||||
|
||||
public static final String MODIFY_USER = "MODIFY_USER";
|
||||
|
||||
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Tool{" +
|
||||
"handle = " + handle +
|
||||
", site = " + site +
|
||||
", tool = " + tool +
|
||||
", description = " + description +
|
||||
", status = " + status +
|
||||
", toolType = " + toolType +
|
||||
", specification = " + specification +
|
||||
", brand = " + brand +
|
||||
", remark = " + remark +
|
||||
", createUser = " + createUser +
|
||||
", createdDateTime = " + createdDateTime +
|
||||
", modifyUser = " + modifyUser +
|
||||
", modifiedDateTime = " + modifiedDateTime +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.foreverwin.mesnac.production.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.production.model.Tool;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 工具表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author pavel.liu
|
||||
* @since 2021-07-14
|
||||
*/
|
||||
public interface ToolService extends IService<Tool> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param frontPage
|
||||
* @return
|
||||
*/
|
||||
IPage<Tool> selectPage(FrontPage<Tool> frontPage, Tool tool);
|
||||
|
||||
List<Tool> selectList(Tool tool);
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.foreverwin.mesnac.production.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.production.model.Tool;
|
||||
import com.foreverwin.mesnac.production.mapper.ToolMapper;
|
||||
import com.foreverwin.mesnac.production.service.ToolService;
|
||||
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 pavel.liu
|
||||
* @since 2021-07-14
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ToolServiceImpl extends ServiceImpl<ToolMapper, Tool> implements ToolService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ToolMapper toolMapper;
|
||||
|
||||
@Override
|
||||
public IPage<Tool> selectPage(FrontPage<Tool> frontPage, Tool tool) {
|
||||
QueryWrapper<Tool> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(tool);
|
||||
return super.page(frontPage.getPagePlus(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Tool> selectList(Tool tool) {
|
||||
QueryWrapper<Tool> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(tool);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,450 @@
|
||||
<?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.production.mapper.ToolMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.production.model.Tool">
|
||||
<id column="HANDLE" property="handle" />
|
||||
<result column="SITE" property="site" />
|
||||
<result column="TOOL" property="tool" />
|
||||
<result column="DESCRIPTION" property="description" />
|
||||
<result column="STATUS" property="status" />
|
||||
<result column="TOOL_TYPE" property="toolType" />
|
||||
<result column="SPECIFICATION" property="specification" />
|
||||
<result column="BRAND" property="brand" />
|
||||
<result column="REMARK" property="remark" />
|
||||
<result column="CREATE_USER" property="createUser" />
|
||||
<result column="CREATED_DATE_TIME" property="createdDateTime" />
|
||||
<result column="MODIFY_USER" property="modifyUser" />
|
||||
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, SITE, TOOL, DESCRIPTION, STATUS, TOOL_TYPE, SPECIFICATION, BRAND, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_TOOL WHERE HANDLE=#{handle}
|
||||
</select>
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_TOOL
|
||||
<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_TOOL 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_TOOL
|
||||
<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.tool!=null"> AND TOOL=#{ew.entity.tool}</if>
|
||||
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.toolType!=null"> AND TOOL_TYPE=#{ew.entity.toolType}</if>
|
||||
<if test="ew.entity.specification!=null"> AND SPECIFICATION=#{ew.entity.specification}</if>
|
||||
<if test="ew.entity.brand!=null"> AND BRAND=#{ew.entity.brand}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</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_TOOL
|
||||
<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.tool!=null"> AND TOOL=#{ew.entity.tool}</if>
|
||||
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.toolType!=null"> AND TOOL_TYPE=#{ew.entity.toolType}</if>
|
||||
<if test="ew.entity.specification!=null"> AND SPECIFICATION=#{ew.entity.specification}</if>
|
||||
<if test="ew.entity.brand!=null"> AND BRAND=#{ew.entity.brand}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</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_TOOL
|
||||
<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.tool!=null"> AND TOOL=#{ew.entity.tool}</if>
|
||||
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.toolType!=null"> AND TOOL_TYPE=#{ew.entity.toolType}</if>
|
||||
<if test="ew.entity.specification!=null"> AND SPECIFICATION=#{ew.entity.specification}</if>
|
||||
<if test="ew.entity.brand!=null"> AND BRAND=#{ew.entity.brand}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</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_TOOL
|
||||
<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.tool!=null"> AND TOOL=#{ew.entity.tool}</if>
|
||||
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.toolType!=null"> AND TOOL_TYPE=#{ew.entity.toolType}</if>
|
||||
<if test="ew.entity.specification!=null"> AND SPECIFICATION=#{ew.entity.specification}</if>
|
||||
<if test="ew.entity.brand!=null"> AND BRAND=#{ew.entity.brand}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</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_TOOL
|
||||
<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.tool!=null"> AND TOOL=#{ew.entity.tool}</if>
|
||||
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.toolType!=null"> AND TOOL_TYPE=#{ew.entity.toolType}</if>
|
||||
<if test="ew.entity.specification!=null"> AND SPECIFICATION=#{ew.entity.specification}</if>
|
||||
<if test="ew.entity.brand!=null"> AND BRAND=#{ew.entity.brand}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</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_TOOL
|
||||
<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.tool!=null"> AND TOOL=#{ew.entity.tool}</if>
|
||||
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.toolType!=null"> AND TOOL_TYPE=#{ew.entity.toolType}</if>
|
||||
<if test="ew.entity.specification!=null"> AND SPECIFICATION=#{ew.entity.specification}</if>
|
||||
<if test="ew.entity.brand!=null"> AND BRAND=#{ew.entity.brand}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</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_TOOL
|
||||
<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.tool!=null"> AND TOOL=#{ew.entity.tool}</if>
|
||||
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.toolType!=null"> AND TOOL_TYPE=#{ew.entity.toolType}</if>
|
||||
<if test="ew.entity.specification!=null"> AND SPECIFICATION=#{ew.entity.specification}</if>
|
||||
<if test="ew.entity.brand!=null"> AND BRAND=#{ew.entity.brand}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</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.production.model.Tool">
|
||||
INSERT INTO Z_TOOL
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="site!=null">SITE,</if>
|
||||
<if test="tool!=null">TOOL,</if>
|
||||
<if test="description!=null">DESCRIPTION,</if>
|
||||
<if test="status!=null">STATUS,</if>
|
||||
<if test="toolType!=null">TOOL_TYPE,</if>
|
||||
<if test="specification!=null">SPECIFICATION,</if>
|
||||
<if test="brand!=null">BRAND,</if>
|
||||
<if test="remark!=null">REMARK,</if>
|
||||
<if test="createUser!=null">CREATE_USER,</if>
|
||||
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
||||
<if test="modifyUser!=null">MODIFY_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="tool!=null">#{tool},</if>
|
||||
<if test="description!=null">#{description},</if>
|
||||
<if test="status!=null">#{status},</if>
|
||||
<if test="toolType!=null">#{toolType},</if>
|
||||
<if test="specification!=null">#{specification},</if>
|
||||
<if test="brand!=null">#{brand},</if>
|
||||
<if test="remark!=null">#{remark},</if>
|
||||
<if test="createUser!=null">#{createUser},</if>
|
||||
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
||||
<if test="modifyUser!=null">#{modifyUser},</if>
|
||||
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.production.model.Tool">
|
||||
INSERT INTO Z_TOOL
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{site},
|
||||
#{tool},
|
||||
#{description},
|
||||
#{status},
|
||||
#{toolType},
|
||||
#{specification},
|
||||
#{brand},
|
||||
#{remark},
|
||||
#{createUser},
|
||||
#{createdDateTime},
|
||||
#{modifyUser},
|
||||
#{modifiedDateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateById">
|
||||
UPDATE Z_TOOL <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.tool!=null">TOOL=#{et.tool},</if>
|
||||
<if test="et.description!=null">DESCRIPTION=#{et.description},</if>
|
||||
<if test="et.status!=null">STATUS=#{et.status},</if>
|
||||
<if test="et.toolType!=null">TOOL_TYPE=#{et.toolType},</if>
|
||||
<if test="et.specification!=null">SPECIFICATION=#{et.specification},</if>
|
||||
<if test="et.brand!=null">BRAND=#{et.brand},</if>
|
||||
<if test="et.remark!=null">REMARK=#{et.remark},</if>
|
||||
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</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_TOOL <trim prefix="SET" suffixOverrides=",">
|
||||
SITE=#{et.site},
|
||||
TOOL=#{et.tool},
|
||||
DESCRIPTION=#{et.description},
|
||||
STATUS=#{et.status},
|
||||
TOOL_TYPE=#{et.toolType},
|
||||
SPECIFICATION=#{et.specification},
|
||||
BRAND=#{et.brand},
|
||||
REMARK=#{et.remark},
|
||||
CREATE_USER=#{et.createUser},
|
||||
CREATED_DATE_TIME=#{et.createdDateTime},
|
||||
MODIFY_USER=#{et.modifyUser},
|
||||
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_TOOL <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.tool!=null">TOOL=#{et.tool},</if>
|
||||
<if test="et.description!=null">DESCRIPTION=#{et.description},</if>
|
||||
<if test="et.status!=null">STATUS=#{et.status},</if>
|
||||
<if test="et.toolType!=null">TOOL_TYPE=#{et.toolType},</if>
|
||||
<if test="et.specification!=null">SPECIFICATION=#{et.specification},</if>
|
||||
<if test="et.brand!=null">BRAND=#{et.brand},</if>
|
||||
<if test="et.remark!=null">REMARK=#{et.remark},</if>
|
||||
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</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.tool!=null"> AND TOOL=#{ew.entity.tool}</if>
|
||||
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.toolType!=null"> AND TOOL_TYPE=#{ew.entity.toolType}</if>
|
||||
<if test="ew.entity.specification!=null"> AND SPECIFICATION=#{ew.entity.specification}</if>
|
||||
<if test="ew.entity.brand!=null"> AND BRAND=#{ew.entity.brand}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</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_TOOL WHERE HANDLE=#{handle}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByMap">
|
||||
DELETE FROM Z_TOOL
|
||||
<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_TOOL
|
||||
<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.tool!=null"> AND TOOL=#{ew.entity.tool}</if>
|
||||
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.toolType!=null"> AND TOOL_TYPE=#{ew.entity.toolType}</if>
|
||||
<if test="ew.entity.specification!=null"> AND SPECIFICATION=#{ew.entity.specification}</if>
|
||||
<if test="ew.entity.brand!=null"> AND BRAND=#{ew.entity.brand}</if>
|
||||
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</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_TOOL WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</delete>
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue