update - add质检工位/缺陷维护
parent
12570a5997
commit
afff593346
@ -0,0 +1,103 @@
|
||||
package com.aucma.base.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.aucma.common.utils.DateUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.aucma.common.annotation.Log;
|
||||
import com.aucma.common.core.controller.BaseController;
|
||||
import com.aucma.common.core.domain.AjaxResult;
|
||||
import com.aucma.common.enums.BusinessType;
|
||||
import com.aucma.base.domain.StationDefectRelation;
|
||||
import com.aucma.base.service.IStationDefectRelationService;
|
||||
import com.aucma.common.utils.poi.ExcelUtil;
|
||||
import com.aucma.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 质检工位/缺陷维护Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/stationDefectRelation" )
|
||||
public class StationDefectRelationController extends BaseController {
|
||||
@Autowired
|
||||
private IStationDefectRelationService stationDefectRelationService;
|
||||
|
||||
/**
|
||||
* 查询质检工位/缺陷维护列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:stationDefectRelation:list')" )
|
||||
@GetMapping("/list" )
|
||||
public TableDataInfo list(StationDefectRelation stationDefectRelation) {
|
||||
startPage();
|
||||
List<StationDefectRelation> list = stationDefectRelationService.selectStationDefectRelationList(stationDefectRelation);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出质检工位/缺陷维护列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:stationDefectRelation:export')" )
|
||||
@Log(title = "质检工位/缺陷维护" , businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export" )
|
||||
public void export(HttpServletResponse response, StationDefectRelation stationDefectRelation) {
|
||||
List<StationDefectRelation> list = stationDefectRelationService.selectStationDefectRelationList(stationDefectRelation);
|
||||
ExcelUtil<StationDefectRelation> util = new ExcelUtil<StationDefectRelation>(StationDefectRelation. class);
|
||||
util.exportExcel(response, list, "质检工位/缺陷维护数据" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取质检工位/缺陷维护详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:stationDefectRelation:query')" )
|
||||
@GetMapping(value = "/{objId}" )
|
||||
public AjaxResult getInfo(@PathVariable("objId" ) Long objId) {
|
||||
return success(stationDefectRelationService.selectStationDefectRelationByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增质检工位/缺陷维护
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:stationDefectRelation:add')" )
|
||||
@Log(title = "质检工位/缺陷维护" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody StationDefectRelation stationDefectRelation) {
|
||||
stationDefectRelation.setCreatedBy(getUsername());
|
||||
stationDefectRelation.setCreatedTime(DateUtils.getNowDate());
|
||||
return toAjax(stationDefectRelationService.insertStationDefectRelation(stationDefectRelation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改质检工位/缺陷维护
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:stationDefectRelation:edit')" )
|
||||
@Log(title = "质检工位/缺陷维护" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody StationDefectRelation stationDefectRelation) {
|
||||
stationDefectRelation.setUpdatedBy(getUsername());
|
||||
stationDefectRelation.setUpdatedTime(DateUtils.getNowDate());
|
||||
return toAjax(stationDefectRelationService.updateStationDefectRelation(stationDefectRelation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除质检工位/缺陷维护
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:stationDefectRelation:remove')" )
|
||||
@Log(title = "质检工位/缺陷维护" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}" )
|
||||
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||
return toAjax(stationDefectRelationService.deleteStationDefectRelationByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,219 @@
|
||||
package com.aucma.base.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.aucma.common.annotation.Excel;
|
||||
import com.aucma.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 质检工位/缺陷维护对象 station_defect_relation
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-27
|
||||
*/
|
||||
public class StationDefectRelation extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
private Long objId;
|
||||
|
||||
/**
|
||||
* 质检工位编号
|
||||
*/
|
||||
@Excel(name = "质检工位编号")
|
||||
private String stationCode;
|
||||
|
||||
/**
|
||||
* 质检工位名称
|
||||
*/
|
||||
@Excel(name = "质检工位名称")
|
||||
private String stationName;
|
||||
|
||||
/**
|
||||
* 缺陷编号
|
||||
*/
|
||||
@Excel(name = "缺陷编号")
|
||||
private String defectCode;
|
||||
|
||||
/**
|
||||
* 缺陷名称
|
||||
*/
|
||||
@Excel(name = "缺陷名称")
|
||||
private String defectName;
|
||||
|
||||
/**
|
||||
* 所属产线
|
||||
*/
|
||||
@Excel(name = "所属产线")
|
||||
private String productionLine;
|
||||
|
||||
/**
|
||||
* 启用标识
|
||||
*/
|
||||
@Excel(name = "启用标识")
|
||||
private Long isFlag;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Excel(name = "创建人")
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@Excel(name = "更新人")
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedTime;
|
||||
|
||||
/**
|
||||
* 物料大类
|
||||
*/
|
||||
@Excel(name = "物料大类")
|
||||
private String materialCategories;
|
||||
|
||||
/**
|
||||
* 物料小类
|
||||
*/
|
||||
@Excel(name = "物料小类")
|
||||
private String materialSubclass;
|
||||
|
||||
public String getMaterialCategories() {
|
||||
return materialCategories;
|
||||
}
|
||||
|
||||
public void setMaterialCategories(String materialCategories) {
|
||||
this.materialCategories = materialCategories;
|
||||
}
|
||||
|
||||
public String getMaterialSubclass() {
|
||||
return materialSubclass;
|
||||
}
|
||||
|
||||
public void setMaterialSubclass(String materialSubclass) {
|
||||
this.materialSubclass = materialSubclass;
|
||||
}
|
||||
|
||||
public void setObjId(Long objId) {
|
||||
this.objId = objId;
|
||||
}
|
||||
|
||||
public Long getObjId() {
|
||||
return objId;
|
||||
}
|
||||
|
||||
public void setStationCode(String stationCode) {
|
||||
this.stationCode = stationCode;
|
||||
}
|
||||
|
||||
public String getStationCode() {
|
||||
return stationCode;
|
||||
}
|
||||
|
||||
public void setStationName(String stationName) {
|
||||
this.stationName = stationName;
|
||||
}
|
||||
|
||||
public String getStationName() {
|
||||
return stationName;
|
||||
}
|
||||
|
||||
public void setDefectCode(String defectCode) {
|
||||
this.defectCode = defectCode;
|
||||
}
|
||||
|
||||
public String getDefectCode() {
|
||||
return defectCode;
|
||||
}
|
||||
|
||||
public void setDefectName(String defectName) {
|
||||
this.defectName = defectName;
|
||||
}
|
||||
|
||||
public String getDefectName() {
|
||||
return defectName;
|
||||
}
|
||||
|
||||
public void setProductionLine(String productionLine) {
|
||||
this.productionLine = productionLine;
|
||||
}
|
||||
|
||||
public String getProductionLine() {
|
||||
return productionLine;
|
||||
}
|
||||
|
||||
public void setIsFlag(Long isFlag) {
|
||||
this.isFlag = isFlag;
|
||||
}
|
||||
|
||||
public Long getIsFlag() {
|
||||
return isFlag;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedTime(Date createdTime) {
|
||||
this.createdTime = createdTime;
|
||||
}
|
||||
|
||||
public Date getCreatedTime() {
|
||||
return createdTime;
|
||||
}
|
||||
|
||||
public void setUpdatedBy(String updatedBy) {
|
||||
this.updatedBy = updatedBy;
|
||||
}
|
||||
|
||||
public String getUpdatedBy() {
|
||||
return updatedBy;
|
||||
}
|
||||
|
||||
public void setUpdatedTime(Date updatedTime) {
|
||||
this.updatedTime = updatedTime;
|
||||
}
|
||||
|
||||
public Date getUpdatedTime() {
|
||||
return updatedTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("objId", getObjId())
|
||||
.append("stationCode", getStationCode())
|
||||
.append("stationName", getStationName())
|
||||
.append("defectCode", getDefectCode())
|
||||
.append("defectName", getDefectName())
|
||||
.append("productionLine", getProductionLine())
|
||||
.append("isFlag", getIsFlag())
|
||||
.append("createdBy", getCreatedBy())
|
||||
.append("createdTime", getCreatedTime())
|
||||
.append("updatedBy", getUpdatedBy())
|
||||
.append("updatedTime", getUpdatedTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.aucma.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.base.domain.StationDefectRelation;
|
||||
|
||||
/**
|
||||
* 质检工位/缺陷维护Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-27
|
||||
*/
|
||||
public interface StationDefectRelationMapper
|
||||
{
|
||||
/**
|
||||
* 查询质检工位/缺陷维护
|
||||
*
|
||||
* @param objId 质检工位/缺陷维护主键
|
||||
* @return 质检工位/缺陷维护
|
||||
*/
|
||||
public StationDefectRelation selectStationDefectRelationByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询质检工位/缺陷维护列表
|
||||
*
|
||||
* @param stationDefectRelation 质检工位/缺陷维护
|
||||
* @return 质检工位/缺陷维护集合
|
||||
*/
|
||||
public List<StationDefectRelation> selectStationDefectRelationList(StationDefectRelation stationDefectRelation);
|
||||
|
||||
/**
|
||||
* 新增质检工位/缺陷维护
|
||||
*
|
||||
* @param stationDefectRelation 质检工位/缺陷维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStationDefectRelation(StationDefectRelation stationDefectRelation);
|
||||
|
||||
/**
|
||||
* 修改质检工位/缺陷维护
|
||||
*
|
||||
* @param stationDefectRelation 质检工位/缺陷维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStationDefectRelation(StationDefectRelation stationDefectRelation);
|
||||
|
||||
/**
|
||||
* 删除质检工位/缺陷维护
|
||||
*
|
||||
* @param objId 质检工位/缺陷维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStationDefectRelationByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除质检工位/缺陷维护
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStationDefectRelationByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.aucma.base.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.base.domain.StationDefectRelation;
|
||||
|
||||
/**
|
||||
* 质检工位/缺陷维护Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-27
|
||||
*/
|
||||
public interface IStationDefectRelationService
|
||||
{
|
||||
/**
|
||||
* 查询质检工位/缺陷维护
|
||||
*
|
||||
* @param objId 质检工位/缺陷维护主键
|
||||
* @return 质检工位/缺陷维护
|
||||
*/
|
||||
public StationDefectRelation selectStationDefectRelationByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询质检工位/缺陷维护列表
|
||||
*
|
||||
* @param stationDefectRelation 质检工位/缺陷维护
|
||||
* @return 质检工位/缺陷维护集合
|
||||
*/
|
||||
public List<StationDefectRelation> selectStationDefectRelationList(StationDefectRelation stationDefectRelation);
|
||||
|
||||
/**
|
||||
* 新增质检工位/缺陷维护
|
||||
*
|
||||
* @param stationDefectRelation 质检工位/缺陷维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStationDefectRelation(StationDefectRelation stationDefectRelation);
|
||||
|
||||
/**
|
||||
* 修改质检工位/缺陷维护
|
||||
*
|
||||
* @param stationDefectRelation 质检工位/缺陷维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStationDefectRelation(StationDefectRelation stationDefectRelation);
|
||||
|
||||
/**
|
||||
* 批量删除质检工位/缺陷维护
|
||||
*
|
||||
* @param objIds 需要删除的质检工位/缺陷维护主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStationDefectRelationByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除质检工位/缺陷维护信息
|
||||
*
|
||||
* @param objId 质检工位/缺陷维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStationDefectRelationByObjId(Long objId);
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package com.aucma.base.service.impl;
|
||||
|
||||
import java.sql.SQLIntegrityConstraintViolationException;
|
||||
import java.util.List;
|
||||
|
||||
import com.aucma.common.exception.ServiceException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.aucma.base.mapper.StationDefectRelationMapper;
|
||||
import com.aucma.base.domain.StationDefectRelation;
|
||||
import com.aucma.base.service.IStationDefectRelationService;
|
||||
|
||||
/**
|
||||
* 质检工位/缺陷维护Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-27
|
||||
*/
|
||||
@Service
|
||||
public class StationDefectRelationServiceImpl implements IStationDefectRelationService
|
||||
{
|
||||
@Autowired
|
||||
private StationDefectRelationMapper stationDefectRelationMapper;
|
||||
|
||||
/**
|
||||
* 查询质检工位/缺陷维护
|
||||
*
|
||||
* @param objId 质检工位/缺陷维护主键
|
||||
* @return 质检工位/缺陷维护
|
||||
*/
|
||||
@Override
|
||||
public StationDefectRelation selectStationDefectRelationByObjId(Long objId)
|
||||
{
|
||||
return stationDefectRelationMapper.selectStationDefectRelationByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询质检工位/缺陷维护列表
|
||||
*
|
||||
* @param stationDefectRelation 质检工位/缺陷维护
|
||||
* @return 质检工位/缺陷维护
|
||||
*/
|
||||
@Override
|
||||
public List<StationDefectRelation> selectStationDefectRelationList(StationDefectRelation stationDefectRelation)
|
||||
{
|
||||
return stationDefectRelationMapper.selectStationDefectRelationList(stationDefectRelation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增质检工位/缺陷维护
|
||||
*
|
||||
* @param stationDefectRelation 质检工位/缺陷维护
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertStationDefectRelation(StationDefectRelation stationDefectRelation)
|
||||
{
|
||||
|
||||
int i = 0;
|
||||
try {
|
||||
i = stationDefectRelationMapper.insertStationDefectRelation(stationDefectRelation);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("该工位已绑定此缺陷!");
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改质检工位/缺陷维护
|
||||
*
|
||||
* @param stationDefectRelation 质检工位/缺陷维护
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateStationDefectRelation(StationDefectRelation stationDefectRelation)
|
||||
{
|
||||
int i = 0;
|
||||
try {
|
||||
i = stationDefectRelationMapper.updateStationDefectRelation(stationDefectRelation);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("该工位已绑定此缺陷!");
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除质检工位/缺陷维护
|
||||
*
|
||||
* @param objIds 需要删除的质检工位/缺陷维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStationDefectRelationByObjIds(Long[] objIds)
|
||||
{
|
||||
return stationDefectRelationMapper.deleteStationDefectRelationByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除质检工位/缺陷维护信息
|
||||
*
|
||||
* @param objId 质检工位/缺陷维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStationDefectRelationByObjId(Long objId)
|
||||
{
|
||||
return stationDefectRelationMapper.deleteStationDefectRelationByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
<?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.aucma.base.mapper.StationDefectRelationMapper">
|
||||
|
||||
<resultMap type="StationDefectRelation" id="StationDefectRelationResult">
|
||||
<result property="objId" column="obj_id" />
|
||||
<result property="stationCode" column="station_code" />
|
||||
<result property="stationName" column="station_name" />
|
||||
<result property="defectCode" column="defect_code" />
|
||||
<result property="defectName" column="defect_name" />
|
||||
<result property="productionLine" column="production_line" />
|
||||
<result property="isFlag" column="is_flag" />
|
||||
<result property="createdBy" column="created_by" />
|
||||
<result property="createdTime" column="created_time" />
|
||||
<result property="updatedBy" column="updated_by" />
|
||||
<result property="updatedTime" column="updated_time" />
|
||||
<result property="materialCategories" column="material_categories" />
|
||||
<result property="materialSubclass" column="material_subclass" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectStationDefectRelationVo">
|
||||
select sdr.obj_id,
|
||||
sdr.station_code,
|
||||
pl.PRODUCT_LINE_NAME station_name,
|
||||
sdr.defect_code,
|
||||
qii.QUALITY_DEFECT_NAME defect_name,
|
||||
pl.PARENT_ID production_line,
|
||||
qii.MATERIAL_CATEGORIES material_categories,
|
||||
qii.MATERIAL_SUBCLASS material_subclass,
|
||||
sdr.is_flag,
|
||||
sdr.created_by,
|
||||
sdr.created_time,
|
||||
sdr.updated_by,
|
||||
sdr.updated_time
|
||||
from station_defect_relation sdr
|
||||
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = sdr.station_code
|
||||
left join BASE_QUALITY_INSPECTION_ITEM qii on qii.QUALITY_DEFECT_CODE = sdr.defect_code
|
||||
</sql>
|
||||
|
||||
<select id="selectStationDefectRelationList" parameterType="StationDefectRelation" resultMap="StationDefectRelationResult">
|
||||
<include refid="selectStationDefectRelationVo"/>
|
||||
<where>
|
||||
<if test="stationCode != null and stationCode != ''"> and sdr.station_code = #{stationCode}</if>
|
||||
<if test="stationName != null and stationName != ''"> and sdr.station_name like concat(concat('%', #{stationName}), '%')</if>
|
||||
<if test="defectCode != null and defectCode != ''"> and sdr.defect_code = #{defectCode}</if>
|
||||
<if test="defectName != null and defectName != ''"> and sdr.defect_name like concat(concat('%', #{defectName}), '%')</if>
|
||||
<if test="productionLine != null and productionLine != ''"> and sdr.production_line = #{productionLine}</if>
|
||||
<if test="isFlag != null "> and sdr.is_flag = #{isFlag}</if>
|
||||
<if test="createdBy != null and createdBy != ''"> and sdr.created_by = #{createdBy}</if>
|
||||
<if test="createdTime != null "> and sdr.created_time = #{createdTime}</if>
|
||||
<if test="updatedBy != null and updatedBy != ''"> and sdr.updated_by = #{updatedBy}</if>
|
||||
<if test="updatedTime != null "> and sdr.updated_time = #{updatedTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectStationDefectRelationByObjId" parameterType="Long" resultMap="StationDefectRelationResult">
|
||||
<include refid="selectStationDefectRelationVo"/>
|
||||
where sdr.obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertStationDefectRelation" parameterType="StationDefectRelation">
|
||||
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
||||
SELECT seq_station_defect_relation.NEXTVAL as objId FROM DUAL
|
||||
</selectKey>
|
||||
insert into station_defect_relation
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">obj_id,</if>
|
||||
<if test="stationCode != null">station_code,</if>
|
||||
<if test="stationName != null">station_name,</if>
|
||||
<if test="defectCode != null">defect_code,</if>
|
||||
<if test="defectName != null">defect_name,</if>
|
||||
<if test="productionLine != null">production_line,</if>
|
||||
<if test="isFlag != null">is_flag,</if>
|
||||
<if test="createdBy != null">created_by,</if>
|
||||
<if test="createdTime != null">created_time,</if>
|
||||
<if test="updatedBy != null">updated_by,</if>
|
||||
<if test="updatedTime != null">updated_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">#{objId},</if>
|
||||
<if test="stationCode != null">#{stationCode},</if>
|
||||
<if test="stationName != null">#{stationName},</if>
|
||||
<if test="defectCode != null">#{defectCode},</if>
|
||||
<if test="defectName != null">#{defectName},</if>
|
||||
<if test="productionLine != null">#{productionLine},</if>
|
||||
<if test="isFlag != null">#{isFlag},</if>
|
||||
<if test="createdBy != null">#{createdBy},</if>
|
||||
<if test="createdTime != null">#{createdTime},</if>
|
||||
<if test="updatedBy != null">#{updatedBy},</if>
|
||||
<if test="updatedTime != null">#{updatedTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateStationDefectRelation" parameterType="StationDefectRelation">
|
||||
update station_defect_relation
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="stationCode != null">station_code = #{stationCode},</if>
|
||||
<if test="stationName != null">station_name = #{stationName},</if>
|
||||
<if test="defectCode != null">defect_code = #{defectCode},</if>
|
||||
<if test="defectName != null">defect_name = #{defectName},</if>
|
||||
<if test="productionLine != null">production_line = #{productionLine},</if>
|
||||
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
||||
<if test="createdBy != null">created_by = #{createdBy},</if>
|
||||
<if test="createdTime != null">created_time = #{createdTime},</if>
|
||||
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
||||
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteStationDefectRelationByObjId" parameterType="Long">
|
||||
delete from station_defect_relation where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteStationDefectRelationByObjIds" parameterType="String">
|
||||
delete from station_defect_relation where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue