change - 不合格品流程

master
yinq 2 years ago
parent af375ffb0e
commit e971f3e10d

@ -94,6 +94,7 @@ public class SysLoginController
ajax.put("factoryCode", "1301");
ajax.put("factoryName", "河南民权工厂");
List<Long> postList = postService.selectPostListByUserId(user.getUserId());
ajax.put("postList", postList);
if (postList.contains(9L)){
//超级返修措施权限
ajax.put("userPermission", 2);

@ -0,0 +1,102 @@
package com.aucma.report.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.report.domain.RecordExceptionProcess;
import com.aucma.report.service.IRecordExceptionProcessService;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2024-04-24
*/
@RestController
@RequestMapping("/report/exceptionProcess")
public class RecordExceptionProcessController extends BaseController {
@Autowired
private IRecordExceptionProcessService recordExceptionProcessService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:exceptionProcess:list')")
@GetMapping("/list")
public TableDataInfo list(RecordExceptionProcess recordExceptionProcess) {
startPage();
List<RecordExceptionProcess> list = recordExceptionProcessService.selectRecordExceptionProcessList(recordExceptionProcess);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:exceptionProcess:export')")
@Log(title = "不合格品流程管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RecordExceptionProcess recordExceptionProcess) {
List<RecordExceptionProcess> list = recordExceptionProcessService.selectRecordExceptionProcessList(recordExceptionProcess);
ExcelUtil<RecordExceptionProcess> util = new ExcelUtil<RecordExceptionProcess>(RecordExceptionProcess.class);
util.exportExcel(response, list, "不合格品流程管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:exceptionProcess:query')")
@GetMapping(value = "/{objId}")
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
return success(recordExceptionProcessService.selectRecordExceptionProcessByObjId(objId));
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('report:exceptionProcess:add')")
@Log(title = "不合格品流程管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody RecordExceptionProcess recordExceptionProcess) {
return toAjax(recordExceptionProcessService.insertRecordExceptionProcess(recordExceptionProcess));
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('report:exceptionProcess:edit')")
@Log(title = "不合格品流程管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RecordExceptionProcess recordExceptionProcess) {
recordExceptionProcess.setUpdatedBy(getUsername());
recordExceptionProcess.setUpdatedTime(DateUtils.getNowDate());
return toAjax(recordExceptionProcessService.updateRecordExceptionProcess(recordExceptionProcess));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:exceptionProcess:remove')")
@Log(title = "不合格品流程管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}")
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(recordExceptionProcessService.deleteRecordExceptionProcessByObjIds(objIds));
}
}

@ -0,0 +1,402 @@
package com.aucma.report.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;
/**
* record_exception_process
*
* @author Yinq
* @date 2024-04-24
*/
public class RecordExceptionProcess extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objId;
/**
* MES
*/
@Excel(name = "MES箱体码")
private String boxBarcode;
/**
* 线
*/
@Excel(name = "产线编号")
private String productLineCode;
/**
* 线
*/
@Excel(name = "产线名称")
private String productLineName;
/**
* SAP
*/
@Excel(name = "SAP订单编号")
private String orderCode;
/** 物料型号 */
@Excel(name = "物料型号")
private String materialModel;
/**
* 1=2=3=4=,9=
*/
@Excel(name = "流转标识", readConverterExp = "1=正常流转,2=质管员拒绝,3=生产经理拒绝,4=质量经理拒绝,9=流转完成")
private String productionUserFlag;
/**
*
*/
@Excel(name = "班组")
private String teamCode;
/**
*
*/
@Excel(name = "申请原因")
private String applyReason;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date applyTime;
/**
*
*/
@Excel(name = "质管员标识", readConverterExp = "1=同意,2=拒绝")
private String qualityUserFlag;
/**
*
*/
@Excel(name = "不合格原因")
private String failureReason;
/**
* 1=
*/
// @Excel(name = "不合格类型", readConverterExp = "1==降级品")
private String failureType;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "质管员审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date qualityUserTime;
/**
*
*/
@Excel(name = "生产经理标识", readConverterExp = "1=同意,2=拒绝")
private String productionManagerFlag;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "生产经理审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date productionManagerTime;
/**
*
*/
@Excel(name = "质量经理标识", readConverterExp = "1=同意,2=拒绝")
private String qualityManagerFlag;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "质量经理审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date qualityManagerTime;
/**
*
*/
@Excel(name = "巡检班长编号")
private String inspectionUserCode;
/**
*
*/
@Excel(name = "巡检班长消息标识")
private String inspectionUserFlag;
/**
*
*/
@Excel(name = "图片地址")
private String imageAddress;
/**
*
*/
@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;
public String getProductLineCode() {
return productLineCode;
}
public void setProductLineCode(String productLineCode) {
this.productLineCode = productLineCode;
}
public String getProductLineName() {
return productLineName;
}
public void setProductLineName(String productLineName) {
this.productLineName = productLineName;
}
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getMaterialModel() {
return materialModel;
}
public void setMaterialModel(String materialModel) {
this.materialModel = materialModel;
}
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setBoxBarcode(String boxBarcode) {
this.boxBarcode = boxBarcode;
}
public String getBoxBarcode() {
return boxBarcode;
}
public void setProductionUserFlag(String productionUserFlag) {
this.productionUserFlag = productionUserFlag;
}
public String getProductionUserFlag() {
return productionUserFlag;
}
public void setTeamCode(String teamCode) {
this.teamCode = teamCode;
}
public String getTeamCode() {
return teamCode;
}
public void setApplyReason(String applyReason) {
this.applyReason = applyReason;
}
public String getApplyReason() {
return applyReason;
}
public void setApplyTime(Date applyTime) {
this.applyTime = applyTime;
}
public Date getApplyTime() {
return applyTime;
}
public void setQualityUserFlag(String qualityUserFlag) {
this.qualityUserFlag = qualityUserFlag;
}
public String getQualityUserFlag() {
return qualityUserFlag;
}
public void setFailureReason(String failureReason) {
this.failureReason = failureReason;
}
public String getFailureReason() {
return failureReason;
}
public void setFailureType(String failureType) {
this.failureType = failureType;
}
public String getFailureType() {
return failureType;
}
public void setQualityUserTime(Date qualityUserTime) {
this.qualityUserTime = qualityUserTime;
}
public Date getQualityUserTime() {
return qualityUserTime;
}
public void setProductionManagerFlag(String productionManagerFlag) {
this.productionManagerFlag = productionManagerFlag;
}
public String getProductionManagerFlag() {
return productionManagerFlag;
}
public void setProductionManagerTime(Date productionManagerTime) {
this.productionManagerTime = productionManagerTime;
}
public Date getProductionManagerTime() {
return productionManagerTime;
}
public void setQualityManagerFlag(String qualityManagerFlag) {
this.qualityManagerFlag = qualityManagerFlag;
}
public String getQualityManagerFlag() {
return qualityManagerFlag;
}
public void setQualityManagerTime(Date qualityManagerTime) {
this.qualityManagerTime = qualityManagerTime;
}
public Date getQualityManagerTime() {
return qualityManagerTime;
}
public void setInspectionUserCode(String inspectionUserCode) {
this.inspectionUserCode = inspectionUserCode;
}
public String getInspectionUserCode() {
return inspectionUserCode;
}
public void setInspectionUserFlag(String inspectionUserFlag) {
this.inspectionUserFlag = inspectionUserFlag;
}
public String getInspectionUserFlag() {
return inspectionUserFlag;
}
public void setImageAddress(String imageAddress) {
this.imageAddress = imageAddress;
}
public String getImageAddress() {
return imageAddress;
}
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("boxBarcode", getBoxBarcode())
.append("productionUserFlag", getProductionUserFlag())
.append("teamCode", getTeamCode())
.append("applyReason", getApplyReason())
.append("applyTime", getApplyTime())
.append("qualityUserFlag", getQualityUserFlag())
.append("failureReason", getFailureReason())
.append("failureType", getFailureType())
.append("qualityUserTime", getQualityUserTime())
.append("productionManagerFlag", getProductionManagerFlag())
.append("productionManagerTime", getProductionManagerTime())
.append("qualityManagerFlag", getQualityManagerFlag())
.append("qualityManagerTime", getQualityManagerTime())
.append("inspectionUserCode", getInspectionUserCode())
.append("inspectionUserFlag", getInspectionUserFlag())
.append("imageAddress", getImageAddress())
.append("remark", getRemark())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.toString();
}
}

@ -28,11 +28,25 @@ public class WeldLeakRateReport extends BaseEntity {
private String PRODUCT_LINE_NAME;
/**
*
*
*/
@Excel(name = "产品型号")
@JsonProperty("MATERIAL_MODEL")
private String MATERIAL_MODEL;
@Excel(name = "周数")
@JsonProperty("WEEK_NUMBER")
private Long WEEK_NUMBER;
/**
*
*/
@Excel(name = "开始时间")
@JsonProperty("WEEK_START")
private String WEEK_START;
/**
*
*/
@Excel(name = "结束时间")
@JsonProperty("WEEK_END")
private String WEEK_END;
/**
*
@ -71,12 +85,28 @@ public class WeldLeakRateReport extends BaseEntity {
this.PRODUCT_LINE_NAME = PRODUCT_LINE_NAME;
}
public String getMATERIAL_MODEL() {
return MATERIAL_MODEL;
public Long getWEEK_NUMBER() {
return WEEK_NUMBER;
}
public void setMATERIAL_MODEL(String MATERIAL_MODEL) {
this.MATERIAL_MODEL = MATERIAL_MODEL;
public void setWEEK_NUMBER(Long WEEK_NUMBER) {
this.WEEK_NUMBER = WEEK_NUMBER;
}
public String getWEEK_START() {
return WEEK_START;
}
public void setWEEK_START(String WEEK_START) {
this.WEEK_START = WEEK_START;
}
public String getWEEK_END() {
return WEEK_END;
}
public void setWEEK_END(String WEEK_END) {
this.WEEK_END = WEEK_END;
}
public Long getQ_SUM() {
@ -86,4 +116,20 @@ public class WeldLeakRateReport extends BaseEntity {
public void setQ_SUM(Long q_SUM) {
Q_SUM = q_SUM;
}
public Long getLEAK_SUM() {
return LEAK_SUM;
}
public void setLEAK_SUM(Long LEAK_SUM) {
this.LEAK_SUM = LEAK_SUM;
}
public String getREPAIR_RATE() {
return REPAIR_RATE;
}
public void setREPAIR_RATE(String REPAIR_RATE) {
this.REPAIR_RATE = REPAIR_RATE;
}
}

@ -0,0 +1,65 @@
package com.aucma.report.mapper;
import java.util.List;
import com.aucma.report.domain.RecordExceptionProcess;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
*
* @author Yinq
* @date 2024-04-24
*/
public interface RecordExceptionProcessMapper
{
/**
*
*
* @param objId
* @return
*/
public RecordExceptionProcess selectRecordExceptionProcessByObjId(Long objId);
/**
*
*
* @param recordExceptionProcess
* @return
*/
public List<RecordExceptionProcess> selectRecordExceptionProcessList(RecordExceptionProcess recordExceptionProcess);
/**
*
*
* @param recordExceptionProcess
* @return
*/
public int insertRecordExceptionProcess(RecordExceptionProcess recordExceptionProcess);
/**
*
*
* @param recordExceptionProcess
* @return
*/
public int updateRecordExceptionProcess(RecordExceptionProcess recordExceptionProcess);
/**
*
*
* @param objId
* @return
*/
public int deleteRecordExceptionProcessByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteRecordExceptionProcessByObjIds(Long[] objIds);
public String checkBoxBarcode(@Param("boxBarcode") String boxBarcode);
}

@ -0,0 +1,61 @@
package com.aucma.report.service;
import java.util.List;
import com.aucma.report.domain.RecordExceptionProcess;
/**
* Service
*
* @author Yinq
* @date 2024-04-24
*/
public interface IRecordExceptionProcessService
{
/**
*
*
* @param objId
* @return
*/
public RecordExceptionProcess selectRecordExceptionProcessByObjId(Long objId);
/**
*
*
* @param recordExceptionProcess
* @return
*/
public List<RecordExceptionProcess> selectRecordExceptionProcessList(RecordExceptionProcess recordExceptionProcess);
/**
*
*
* @param recordExceptionProcess
* @return
*/
public int insertRecordExceptionProcess(RecordExceptionProcess recordExceptionProcess);
/**
*
*
* @param recordExceptionProcess
* @return
*/
public int updateRecordExceptionProcess(RecordExceptionProcess recordExceptionProcess);
/**
*
*
* @param objIds
* @return
*/
public int deleteRecordExceptionProcessByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteRecordExceptionProcessByObjId(Long objId);
}

@ -0,0 +1,115 @@
package com.aucma.report.service.impl;
import java.util.List;
import com.aucma.common.exception.ServiceException;
import com.aucma.common.utils.DateUtils;
import com.aucma.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.report.mapper.RecordExceptionProcessMapper;
import com.aucma.report.domain.RecordExceptionProcess;
import com.aucma.report.service.IRecordExceptionProcessService;
import static com.aucma.common.utils.SecurityUtils.getUsername;
/**
* Service
*
* @author Yinq
* @date 2024-04-24
*/
@Service
public class RecordExceptionProcessServiceImpl implements IRecordExceptionProcessService
{
@Autowired
private RecordExceptionProcessMapper recordExceptionProcessMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public RecordExceptionProcess selectRecordExceptionProcessByObjId(Long objId)
{
return recordExceptionProcessMapper.selectRecordExceptionProcessByObjId(objId);
}
/**
*
*
* @param recordExceptionProcess
* @return
*/
@Override
public List<RecordExceptionProcess> selectRecordExceptionProcessList(RecordExceptionProcess recordExceptionProcess)
{
return recordExceptionProcessMapper.selectRecordExceptionProcessList(recordExceptionProcess);
}
/**
*
*
* @param recordExceptionProcess
* @return
*/
@Override
public int insertRecordExceptionProcess(RecordExceptionProcess recordExceptionProcess)
{
if (StringUtils.isNotNull(recordExceptionProcess.getBoxBarcode())){
String boxBarcode = recordExceptionProcessMapper.checkBoxBarcode(recordExceptionProcess.getBoxBarcode());
if (StringUtils.isEmpty(boxBarcode)){
throw new ServiceException("箱体码输入错误,请重新输入!");
}
}
RecordExceptionProcess exceptionProcess = new RecordExceptionProcess();
exceptionProcess.setBoxBarcode(recordExceptionProcess.getBoxBarcode());
exceptionProcess.setProductionUserFlag("1");
List<RecordExceptionProcess> processList = recordExceptionProcessMapper.selectRecordExceptionProcessList(exceptionProcess);
if (processList.size() > 0){
throw new ServiceException("该箱体码正在流转审批,请勿重复提交流程!");
}
recordExceptionProcess.setCreatedBy(getUsername());
recordExceptionProcess.setCreatedTime(DateUtils.getNowDate());
recordExceptionProcess.setApplyTime(DateUtils.getNowDate());
return recordExceptionProcessMapper.insertRecordExceptionProcess(recordExceptionProcess);
}
/**
*
*
* @param recordExceptionProcess
* @return
*/
@Override
public int updateRecordExceptionProcess(RecordExceptionProcess recordExceptionProcess)
{
return recordExceptionProcessMapper.updateRecordExceptionProcess(recordExceptionProcess);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteRecordExceptionProcessByObjIds(Long[] objIds)
{
return recordExceptionProcessMapper.deleteRecordExceptionProcessByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteRecordExceptionProcessByObjId(Long objId)
{
return recordExceptionProcessMapper.deleteRecordExceptionProcessByObjId(objId);
}
}

@ -804,7 +804,8 @@
WEEK_END,
NVL(COUNT(*), 0) Q_SUM,
NVL(SUM(LEAK_SUM), 0) LEAK_SUM,
TO_CHAR(ROUND(SUM(LEAK_SUM) / COUNT(*) * 100, 2), 'FM99990.00') REPAIR_RATE
TO_CHAR(ROUND(SUM(LEAK_SUM) / COUNT(*) * 100, 2), 'FM99990.00') REPAIR_RATE,
'二线' PRODUCT_LINE_NAME
FROM (
SELECT TO_NUMBER(COLUMN_A) WEEK_NUMBER,
COLUMN_B WEEK_START,

@ -0,0 +1,217 @@
<?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.report.mapper.RecordExceptionProcessMapper">
<resultMap type="RecordExceptionProcess" id="RecordExceptionProcessResult">
<result property="objId" column="obj_id"/>
<result property="boxBarcode" column="box_barcode"/>
<result property="productionUserFlag" column="production_user_flag"/>
<result property="teamCode" column="team_code"/>
<result property="applyReason" column="apply_reason"/>
<result property="applyTime" column="apply_time"/>
<result property="qualityUserFlag" column="quality_user_flag"/>
<result property="failureReason" column="failure_reason"/>
<result property="failureType" column="failure_type"/>
<result property="qualityUserTime" column="quality_user_time"/>
<result property="productionManagerFlag" column="production_manager_flag"/>
<result property="productionManagerTime" column="production_manager_time"/>
<result property="qualityManagerFlag" column="quality_manager_flag"/>
<result property="qualityManagerTime" column="quality_manager_time"/>
<result property="inspectionUserCode" column="inspection_user_code"/>
<result property="inspectionUserFlag" column="inspection_user_flag"/>
<result property="imageAddress" column="image_address"/>
<result property="remark" column="remark"/>
<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="productLineCode" column="productLineCode"/>
<result property="productLineName" column="productLineName"/>
<result property="orderCode" column="orderCode"/>
<result property="materialModel" column="materialModel"/>
</resultMap>
<sql id="selectRecordExceptionProcessVo">
select rep.obj_id,
PB.ORDER_CODE orderCode,
BP.PRODUCT_LINE_CODE productLineCode,
BP.PRODUCT_LINE_NAME productLineName,
rep.box_barcode,
ML.MATERIAL_SPECIFICATIONS materialModel,
rep.production_user_flag,
rep.team_code,
rep.apply_reason,
rep.apply_time,
rep.quality_user_flag,
rep.failure_reason,
rep.failure_type,
rep.quality_user_time,
rep.production_manager_flag,
rep.production_manager_time,
rep.quality_manager_flag,
rep.quality_manager_time,
rep.inspection_user_code,
rep.inspection_user_flag,
rep.image_address,
rep.remark,
rep.created_by,
rep.created_time,
rep.updated_by,
rep.updated_time
from record_exception_process rep
left join C##AUCMA_SCADA.PRINT_BARCODE PB ON PB.MATERIAL_BARCODE = rep.BOX_BARCODE
left join BASE_ORDERINFO bo on bo.ORDER_CODE = pb.ORDER_CODE
left join BASE_PRODUCTLINE BP ON BP.WORK_CENTER_CODE = BO.WORK_CENTER_CODE
LEFT JOIN BASE_MATERIALINFO ML ON ML.MATERIAL_CODE = PB.MATERIAL_CODE
</sql>
<select id="selectRecordExceptionProcessList" parameterType="RecordExceptionProcess"
resultMap="RecordExceptionProcessResult">
<include refid="selectRecordExceptionProcessVo"/>
<where>
<if test="boxBarcode != null and boxBarcode != ''">and rep.box_barcode = #{boxBarcode}</if>
<if test="productionUserFlag != null and productionUserFlag != ''">and rep.production_user_flag =
#{productionUserFlag}
</if>
<if test="teamCode != null and teamCode != ''">and rep.team_code = #{teamCode}</if>
<if test="applyReason != null and applyReason != ''">and rep.apply_reason = #{applyReason}</if>
<if test="params.beginApplyTime != null and params.beginApplyTime != '' and params.endApplyTime != null and params.endApplyTime != ''">
and rep.apply_time between to_date(#{params.beginApplyTime}, 'yyyy-mm-dd hh24:mi:ss') and
to_date(#{params.endApplyTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="qualityUserFlag != null and qualityUserFlag != ''">and rep.quality_user_flag = #{qualityUserFlag}
</if>
<if test="failureReason != null and failureReason != ''">and rep.failure_reason = #{failureReason}</if>
<if test="failureType != null and failureType != ''">and rep.failure_type = #{failureType}</if>
<if test="qualityUserTime != null ">and rep.quality_user_time = #{qualityUserTime}</if>
<if test="productionManagerFlag != null and productionManagerFlag != ''">and rep.production_manager_flag =
#{productionManagerFlag}
</if>
<if test="productionManagerTime != null ">and rep.production_manager_time = #{productionManagerTime}</if>
<if test="qualityManagerFlag != null and qualityManagerFlag != ''">and rep.quality_manager_flag =
#{qualityManagerFlag}
</if>
<if test="qualityManagerTime != null ">and rep.quality_manager_time = #{qualityManagerTime}</if>
<if test="inspectionUserCode != null and inspectionUserCode != ''">and rep.inspection_user_code =
#{inspectionUserCode}
</if>
<if test="inspectionUserFlag != null and inspectionUserFlag != ''">and rep.inspection_user_flag =
#{inspectionUserFlag}
</if>
<if test="imageAddress != null and imageAddress != ''">and rep.image_address = #{imageAddress}</if>
<if test="createdBy != null and createdBy != ''">and rep.created_by = #{createdBy}</if>
<if test="createdTime != null ">and rep.created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''">and rep.updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and rep.updated_time = #{updatedTime}</if>
</where>
order by rep.apply_time desc
</select>
<select id="selectRecordExceptionProcessByObjId" parameterType="Long" resultMap="RecordExceptionProcessResult">
<include refid="selectRecordExceptionProcessVo"/>
where rep.obj_id = #{objId}
</select>
<select id="checkBoxBarcode" resultType="java.lang.String">
SELECT MATERIAL_BARCODE FROM C##AUCMA_SCADA.PRINT_BARCODE WHERE MATERIAL_BARCODE = #{boxBarcode}
</select>
<insert id="insertRecordExceptionProcess" parameterType="RecordExceptionProcess">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_record_exception_process.NEXTVAL as objId FROM DUAL
</selectKey>
insert into record_exception_process
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="boxBarcode != null and boxBarcode != ''">box_barcode,</if>
<if test="productionUserFlag != null">production_user_flag,</if>
<if test="teamCode != null">team_code,</if>
<if test="applyReason != null">apply_reason,</if>
<if test="applyTime != null">apply_time,</if>
<if test="qualityUserFlag != null">quality_user_flag,</if>
<if test="failureReason != null">failure_reason,</if>
<if test="failureType != null">failure_type,</if>
<if test="qualityUserTime != null">quality_user_time,</if>
<if test="productionManagerFlag != null">production_manager_flag,</if>
<if test="productionManagerTime != null">production_manager_time,</if>
<if test="qualityManagerFlag != null">quality_manager_flag,</if>
<if test="qualityManagerTime != null">quality_manager_time,</if>
<if test="inspectionUserCode != null">inspection_user_code,</if>
<if test="inspectionUserFlag != null">inspection_user_flag,</if>
<if test="imageAddress != null">image_address,</if>
<if test="remark != null">remark,</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="boxBarcode != null and boxBarcode != ''">#{boxBarcode},</if>
<if test="productionUserFlag != null">#{productionUserFlag},</if>
<if test="teamCode != null">#{teamCode},</if>
<if test="applyReason != null">#{applyReason},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="qualityUserFlag != null">#{qualityUserFlag},</if>
<if test="failureReason != null">#{failureReason},</if>
<if test="failureType != null">#{failureType},</if>
<if test="qualityUserTime != null">#{qualityUserTime},</if>
<if test="productionManagerFlag != null">#{productionManagerFlag},</if>
<if test="productionManagerTime != null">#{productionManagerTime},</if>
<if test="qualityManagerFlag != null">#{qualityManagerFlag},</if>
<if test="qualityManagerTime != null">#{qualityManagerTime},</if>
<if test="inspectionUserCode != null">#{inspectionUserCode},</if>
<if test="inspectionUserFlag != null">#{inspectionUserFlag},</if>
<if test="imageAddress != null">#{imageAddress},</if>
<if test="remark != null">#{remark},</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="updateRecordExceptionProcess" parameterType="RecordExceptionProcess">
update record_exception_process
<trim prefix="SET" suffixOverrides=",">
<if test="boxBarcode != null and boxBarcode != ''">box_barcode = #{boxBarcode},</if>
<if test="productionUserFlag != null">production_user_flag = #{productionUserFlag},</if>
<if test="teamCode != null">team_code = #{teamCode},</if>
<if test="applyReason != null">apply_reason = #{applyReason},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="qualityUserFlag != null">quality_user_flag = #{qualityUserFlag},</if>
<if test="failureReason != null">failure_reason = #{failureReason},</if>
<if test="failureType != null">failure_type = #{failureType},</if>
<if test="qualityUserTime != null">quality_user_time = #{qualityUserTime},</if>
<if test="productionManagerFlag != null">production_manager_flag = #{productionManagerFlag},</if>
<if test="productionManagerTime != null">production_manager_time = #{productionManagerTime},</if>
<if test="qualityManagerFlag != null">quality_manager_flag = #{qualityManagerFlag},</if>
<if test="qualityManagerTime != null">quality_manager_time = #{qualityManagerTime},</if>
<if test="inspectionUserCode != null">inspection_user_code = #{inspectionUserCode},</if>
<if test="inspectionUserFlag != null">inspection_user_flag = #{inspectionUserFlag},</if>
<if test="imageAddress != null">image_address = #{imageAddress},</if>
<if test="remark != null">remark = #{remark},</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="deleteRecordExceptionProcessByObjId" parameterType="Long">
delete
from record_exception_process
where obj_id = #{objId}
</delete>
<delete id="deleteRecordExceptionProcessByObjIds" parameterType="String">
delete from record_exception_process where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save