update - 添加质检记录管理

master
yinq 2 years ago
parent e392559785
commit 2eeef36acb

@ -90,6 +90,19 @@ public class BaseProductLine extends BaseEntity {
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
/**
*
*/
private String processCode;
public String getProcessCode() {
return processCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getParentName() {
return parentName;
}

@ -5,19 +5,20 @@
<mapper namespace="com.aucma.base.mapper.BaseProductLineMapper">
<resultMap type="BaseProductLine" id="BaseProductLineResult">
<result property="objId" column="obj_id" />
<result property="productLineCode" column="product_line_code" />
<result property="productLineName" column="product_line_name" />
<result property="productLineType" column="product_line_type" />
<result property="plantCode" column="plant_code" />
<result property="plantName" column="plantName" />
<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="parentId" column="parent_id" />
<result property="parentName" column="parentName" />
<result property="objId" column="obj_id"/>
<result property="productLineCode" column="product_line_code"/>
<result property="productLineName" column="product_line_name"/>
<result property="productLineType" column="product_line_type"/>
<result property="plantCode" column="plant_code"/>
<result property="plantName" column="plantName"/>
<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="parentId" column="parent_id"/>
<result property="parentName" column="parentName"/>
<result property="processCode" column="processCode"/>
</resultMap>
<sql id="selectBaseProductLineVo">
@ -26,7 +27,7 @@
bpl.PRODUCT_LINE_NAME,
bpl.PRODUCT_LINE_TYPE,
bpl.plant_code,
bf.factory_name plantName,
bf.factory_name plantName,
bpl.is_flag,
bpl.created_by,
bpl.created_time,
@ -41,78 +42,93 @@
<select id="selectBaseProductLineList" parameterType="BaseProductLine" resultMap="BaseProductLineResult">
<include refid="selectBaseProductLineVo"/>
<if test="processCode != null and processCode != ''">
join
(SELECT PROCESS_CODE,
TRIM(REGEXP_SUBSTR(PARENT_ID, '[^,]+', 1, LEVEL)) AS station_code
FROM BASE_PROCESS_STATION
CONNECT BY PRIOR PROCESS_CODE = PROCESS_CODE
AND PRIOR DBMS_RANDOM.VALUE IS NOT NULL
AND LENGTH(REGEXP_REPLACE(PARENT_ID, '[^,]+')) + 1 >= LEVEL
ORDER BY PROCESS_CODE, LEVEL) ST ON st.station_code = bpl.PRODUCT_LINE_CODE AND ST.PROCESS_CODE = #{processCode}
</if>
<where>
<if test="productLineCode != null and productLineCode != ''"> and bpl.product_line_code = #{productLineCode}</if>
<if test="productLineName != null and productLineName != ''"> and bpl.product_line_name like concat(concat('%', #{productLineName}), '%')</if>
<if test="productLineType != null "> and bpl.product_line_type = #{productLineType}</if>
<if test="plantCode != null and plantCode != ''"> and bpl.plant_code = #{plantCode}</if>
<if test="isFlag != null "> and bpl.is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''"> and bpl.created_by = #{createdBy}</if>
<if test="createdTime != null "> and bpl.created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''"> and bpl.updated_by = #{updatedBy}</if>
<if test="updatedTime != null "> and bpl.updated_time = #{updatedTime}</if>
<if test="parentId != null "> and bpl.parent_id = #{parentId}</if>
<if test="productLineCode != null and productLineCode != ''">and bpl.product_line_code = #{productLineCode}
</if>
<if test="productLineName != null and productLineName != ''">and bpl.product_line_name like
concat(concat('%', #{productLineName}), '%')
</if>
<if test="productLineType != null ">and bpl.product_line_type = #{productLineType}</if>
<if test="plantCode != null and plantCode != ''">and bpl.plant_code = #{plantCode}</if>
<if test="isFlag != null ">and bpl.is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''">and bpl.created_by = #{createdBy}</if>
<if test="createdTime != null ">and bpl.created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''">and bpl.updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and bpl.updated_time = #{updatedTime}</if>
<if test="parentId != null ">and bpl.parent_id = #{parentId}</if>
</where>
order by bpl.PRODUCT_LINE_CODE
</select>
<select id="selectBaseProductLineByObjId" parameterType="Long" resultMap="BaseProductLineResult">
<include refid="selectBaseProductLineVo"/>
where bpl.obj_id = #{objId}
<include refid="selectBaseProductLineVo"/>
where bpl.obj_id = #{objId}
</select>
<insert id="insertBaseProductLine" parameterType="BaseProductLine">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_base_productline.NEXTVAL as objId FROM DUAL
</selectKey>
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_base_productline.NEXTVAL as objId FROM DUAL
</selectKey>
insert into base_productline
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="productLineCode != null">product_line_code,</if>
<if test="productLineName != null">product_line_name,</if>
<if test="productLineType != null">product_line_type,</if>
<if test="plantCode != null">plant_code,</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>
<if test="parentId != null">parent_id,</if>
<if test="objId != null">obj_id,</if>
<if test="productLineCode != null">product_line_code,</if>
<if test="productLineName != null">product_line_name,</if>
<if test="productLineType != null">product_line_type,</if>
<if test="plantCode != null">plant_code,</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>
<if test="parentId != null">parent_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<if test="productLineCode != null">#{productLineCode},</if>
<if test="productLineName != null">#{productLineName},</if>
<if test="productLineType != null">#{productLineType},</if>
<if test="plantCode != null">#{plantCode},</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>
<if test="parentId != null">#{parentId},</if>
<if test="objId != null">#{objId},</if>
<if test="productLineCode != null">#{productLineCode},</if>
<if test="productLineName != null">#{productLineName},</if>
<if test="productLineType != null">#{productLineType},</if>
<if test="plantCode != null">#{plantCode},</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>
<if test="parentId != null">#{parentId},</if>
</trim>
</insert>
<update id="updateBaseProductLine" parameterType="BaseProductLine">
update base_productline
<trim prefix="SET" suffixOverrides=",">
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
<if test="productLineName != null">product_line_name = #{productLineName},</if>
<if test="productLineType != null">product_line_type = #{productLineType},</if>
<if test="plantCode != null">plant_code = #{plantCode},</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>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
<if test="productLineName != null">product_line_name = #{productLineName},</if>
<if test="productLineType != null">product_line_type = #{productLineType},</if>
<if test="plantCode != null">plant_code = #{plantCode},</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>
<if test="parentId != null">parent_id = #{parentId},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteBaseProductLineByObjId" parameterType="Long">
delete from base_productline where obj_id = #{objId}
delete
from base_productline
where obj_id = #{objId}
</delete>
<delete id="deleteBaseProductLineByObjIds" parameterType="String">

@ -79,12 +79,17 @@
</select>
<select id="getQualityDefects" parameterType="String" resultMap="BaseQualityInspectionItemResult">
select bq2.obj_id,
bq2.quality_defect_code,
bq2.quality_defect_name,
bq1.station_code
bq1.quality_defect_code station_code,
bq1.quality_defect_name station_name,
bq2.quality_defect_code,
bq2.quality_defect_name,
bq1.station_code
from base_quality_inspection_item bq1
left join base_quality_inspection_item bq2 on bq2.PARENT_ID = bq1.quality_defect_code
where bq1.station_code = '1003'
left join base_quality_inspection_item bq2 on bq2.PARENT_ID = bq1.quality_defect_code
<where>
bq2.quality_defect_code is not null
<if test="stationCode != null ">and bq1.station_code = #{stationCode}</if>
</where>
</select>
<insert id="insertBaseQualityInspectionItem" parameterType="BaseQualityInspectionItem">

@ -0,0 +1,101 @@
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.ReportQualityInspection;
import com.aucma.report.service.IReportQualityInspectionService;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2023-11-21
*/
@RestController
@RequestMapping("/report/qualityInspection" )
public class ReportQualityInspectionController extends BaseController {
@Autowired
private IReportQualityInspectionService reportQualityInspectionService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:qualityInspection:list')" )
@GetMapping("/list" )
public TableDataInfo list(ReportQualityInspection reportQualityInspection) {
startPage();
List<ReportQualityInspection> list = reportQualityInspectionService.selectReportQualityInspectionList(reportQualityInspection);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:qualityInspection:export')" )
@Log(title = "质检记录管理" , businessType = BusinessType.EXPORT)
@PostMapping("/export" )
public void export(HttpServletResponse response, ReportQualityInspection reportQualityInspection) {
List<ReportQualityInspection> list = reportQualityInspectionService.selectReportQualityInspectionList(reportQualityInspection);
ExcelUtil<ReportQualityInspection> util = new ExcelUtil<ReportQualityInspection>(ReportQualityInspection. class);
util.exportExcel(response, list, "质检记录管理数据" );
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:qualityInspection:query')" )
@GetMapping(value = "/{objId}" )
public AjaxResult getInfo(@PathVariable("objId" ) Long objId) {
return success(reportQualityInspectionService.selectReportQualityInspectionByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:qualityInspection:add')" )
@Log(title = "质检记录管理" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ReportQualityInspection reportQualityInspection) {
return toAjax(reportQualityInspectionService.insertReportQualityInspection(reportQualityInspection));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:qualityInspection:edit')" )
@Log(title = "质检记录管理" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ReportQualityInspection reportQualityInspection) {
reportQualityInspection.setUpdatedBy(getUsername());
reportQualityInspection.setUpdatedTime(DateUtils.getNowDate());
return toAjax(reportQualityInspectionService.updateReportQualityInspection(reportQualityInspection));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:qualityInspection:remove')" )
@Log(title = "质检记录管理" , businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}" )
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(reportQualityInspectionService.deleteReportQualityInspectionByObjIds(objIds));
}
}

@ -0,0 +1,280 @@
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;
/**
* report_quality_inspection
*
* @author Yinq
* @date 2023-11-21
*/
public class ReportQualityInspection extends BaseEntity
{
private static final long serialVersionUID=1L;
/** 主键标识 */
private Long objId;
/** 产品条码 */
@Excel(name = "产品条码")
private String barCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 工序编号 */
@Excel(name = "工序编号")
private String processCode;
/** 检测项编号 */
@Excel(name = "检测项编号")
private String testItemCode;
/** 质量缺陷编码 */
@Excel(name = "质量缺陷编码")
private String qualityDefectCode;
/** 质量缺陷名称 */
@Excel(name = "质量缺陷名称")
private String qualityDefectName;
/** 处理措施 */
@Excel(name = "处理措施")
private String treatmentMeasure;
/** 处理结果 */
@Excel(name = "处理结果")
private String processResult;
/** 是否下静态线1-是2-否) */
@Excel(name = "是否下静态线", readConverterExp = "1=-是2-否")
private String isLowerLine;
/** 班组编号 */
@Excel(name = "班组编号")
private String groupCode;
/** 检测人员 */
@Excel(name = "检测人员")
private String inspectorCode;
/** 检测时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "检测时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date inspectorTime;
/** 返修次数 */
@Excel(name = "返修次数")
private Long reworkNumber;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date finishTime;
/** 是否标识 */
@Excel(name = "是否标识")
private Long isFlag;
/** 更新人 */
@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 void setObjId(Long objId)
{
this.objId = objId;
}
public Long getObjId()
{
return objId;
}
public void setBarCode(String barCode)
{
this.barCode = barCode;
}
public String getBarCode()
{
return barCode;
}
public void setMaterialName(String materialName)
{
this.materialName = materialName;
}
public String getMaterialName()
{
return materialName;
}
public void setProcessCode(String processCode)
{
this.processCode = processCode;
}
public String getProcessCode()
{
return processCode;
}
public void setTestItemCode(String testItemCode)
{
this.testItemCode = testItemCode;
}
public String getTestItemCode()
{
return testItemCode;
}
public void setQualityDefectCode(String qualityDefectCode)
{
this.qualityDefectCode = qualityDefectCode;
}
public String getQualityDefectCode()
{
return qualityDefectCode;
}
public void setQualityDefectName(String qualityDefectName)
{
this.qualityDefectName = qualityDefectName;
}
public String getQualityDefectName()
{
return qualityDefectName;
}
public void setTreatmentMeasure(String treatmentMeasure)
{
this.treatmentMeasure = treatmentMeasure;
}
public String getTreatmentMeasure()
{
return treatmentMeasure;
}
public void setProcessResult(String processResult)
{
this.processResult = processResult;
}
public String getProcessResult()
{
return processResult;
}
public void setIsLowerLine(String isLowerLine)
{
this.isLowerLine = isLowerLine;
}
public String getIsLowerLine()
{
return isLowerLine;
}
public void setGroupCode(String groupCode)
{
this.groupCode = groupCode;
}
public String getGroupCode()
{
return groupCode;
}
public void setInspectorCode(String inspectorCode)
{
this.inspectorCode = inspectorCode;
}
public String getInspectorCode()
{
return inspectorCode;
}
public void setInspectorTime(Date inspectorTime)
{
this.inspectorTime = inspectorTime;
}
public Date getInspectorTime()
{
return inspectorTime;
}
public void setReworkNumber(Long reworkNumber)
{
this.reworkNumber = reworkNumber;
}
public Long getReworkNumber()
{
return reworkNumber;
}
public void setFinishTime(Date finishTime)
{
this.finishTime = finishTime;
}
public Date getFinishTime()
{
return finishTime;
}
public void setIsFlag(Long isFlag)
{
this.isFlag = isFlag;
}
public Long getIsFlag()
{
return isFlag;
}
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("barCode",getBarCode())
.append("materialName",getMaterialName())
.append("processCode",getProcessCode())
.append("testItemCode",getTestItemCode())
.append("qualityDefectCode",getQualityDefectCode())
.append("qualityDefectName",getQualityDefectName())
.append("treatmentMeasure",getTreatmentMeasure())
.append("processResult",getProcessResult())
.append("isLowerLine",getIsLowerLine())
.append("groupCode",getGroupCode())
.append("inspectorCode",getInspectorCode())
.append("inspectorTime",getInspectorTime())
.append("reworkNumber",getReworkNumber())
.append("finishTime",getFinishTime())
.append("isFlag",getIsFlag())
.append("updatedBy",getUpdatedBy())
.append("updatedTime",getUpdatedTime())
.toString();
}
}

@ -0,0 +1,61 @@
package com.aucma.report.mapper;
import java.util.List;
import com.aucma.report.domain.ReportQualityInspection;
/**
* Mapper
*
* @author Yinq
* @date 2023-11-21
*/
public interface ReportQualityInspectionMapper
{
/**
*
*
* @param objId
* @return
*/
public ReportQualityInspection selectReportQualityInspectionByObjId(Long objId);
/**
*
*
* @param reportQualityInspection
* @return
*/
public List<ReportQualityInspection> selectReportQualityInspectionList(ReportQualityInspection reportQualityInspection);
/**
*
*
* @param reportQualityInspection
* @return
*/
public int insertReportQualityInspection(ReportQualityInspection reportQualityInspection);
/**
*
*
* @param reportQualityInspection
* @return
*/
public int updateReportQualityInspection(ReportQualityInspection reportQualityInspection);
/**
*
*
* @param objId
* @return
*/
public int deleteReportQualityInspectionByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteReportQualityInspectionByObjIds(Long[] objIds);
}

@ -0,0 +1,61 @@
package com.aucma.report.service;
import java.util.List;
import com.aucma.report.domain.ReportQualityInspection;
/**
* Service
*
* @author Yinq
* @date 2023-11-21
*/
public interface IReportQualityInspectionService
{
/**
*
*
* @param objId
* @return
*/
public ReportQualityInspection selectReportQualityInspectionByObjId(Long objId);
/**
*
*
* @param reportQualityInspection
* @return
*/
public List<ReportQualityInspection> selectReportQualityInspectionList(ReportQualityInspection reportQualityInspection);
/**
*
*
* @param reportQualityInspection
* @return
*/
public int insertReportQualityInspection(ReportQualityInspection reportQualityInspection);
/**
*
*
* @param reportQualityInspection
* @return
*/
public int updateReportQualityInspection(ReportQualityInspection reportQualityInspection);
/**
*
*
* @param objIds
* @return
*/
public int deleteReportQualityInspectionByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteReportQualityInspectionByObjId(Long objId);
}

@ -0,0 +1,93 @@
package com.aucma.report.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.report.mapper.ReportQualityInspectionMapper;
import com.aucma.report.domain.ReportQualityInspection;
import com.aucma.report.service.IReportQualityInspectionService;
/**
* Service
*
* @author Yinq
* @date 2023-11-21
*/
@Service
public class ReportQualityInspectionServiceImpl implements IReportQualityInspectionService
{
@Autowired
private ReportQualityInspectionMapper reportQualityInspectionMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public ReportQualityInspection selectReportQualityInspectionByObjId(Long objId)
{
return reportQualityInspectionMapper.selectReportQualityInspectionByObjId(objId);
}
/**
*
*
* @param reportQualityInspection
* @return
*/
@Override
public List<ReportQualityInspection> selectReportQualityInspectionList(ReportQualityInspection reportQualityInspection)
{
return reportQualityInspectionMapper.selectReportQualityInspectionList(reportQualityInspection);
}
/**
*
*
* @param reportQualityInspection
* @return
*/
@Override
public int insertReportQualityInspection(ReportQualityInspection reportQualityInspection)
{
return reportQualityInspectionMapper.insertReportQualityInspection(reportQualityInspection);
}
/**
*
*
* @param reportQualityInspection
* @return
*/
@Override
public int updateReportQualityInspection(ReportQualityInspection reportQualityInspection)
{
return reportQualityInspectionMapper.updateReportQualityInspection(reportQualityInspection);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteReportQualityInspectionByObjIds(Long[] objIds)
{
return reportQualityInspectionMapper.deleteReportQualityInspectionByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteReportQualityInspectionByObjId(Long objId)
{
return reportQualityInspectionMapper.deleteReportQualityInspectionByObjId(objId);
}
}

@ -0,0 +1,170 @@
<?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.ReportQualityInspectionMapper">
<resultMap type="ReportQualityInspection" id="ReportQualityInspectionResult">
<result property="objId" column="obj_id"/>
<result property="barCode" column="bar_code"/>
<result property="materialName" column="material_name"/>
<result property="processCode" column="process_code"/>
<result property="testItemCode" column="test_item_code"/>
<result property="qualityDefectCode" column="quality_defect_code"/>
<result property="qualityDefectName" column="quality_defect_name"/>
<result property="treatmentMeasure" column="treatment_measure"/>
<result property="processResult" column="process_result"/>
<result property="isLowerLine" column="is_lower_line"/>
<result property="groupCode" column="group_code"/>
<result property="inspectorCode" column="inspector_code"/>
<result property="inspectorTime" column="inspector_time"/>
<result property="reworkNumber" column="rework_number"/>
<result property="finishTime" column="finish_time"/>
<result property="isFlag" column="is_flag"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time"/>
</resultMap>
<sql id="selectReportQualityInspectionVo">
select obj_id,
bar_code,
material_name,
process_code,
test_item_code,
quality_defect_code,
quality_defect_name,
treatment_measure,
process_result,
is_lower_line,
group_code,
inspector_code,
inspector_time,
rework_number,
finish_time,
is_flag,
updated_by,
updated_time
from report_quality_inspection
</sql>
<select id="selectReportQualityInspectionList" parameterType="ReportQualityInspection"
resultMap="ReportQualityInspectionResult">
<include refid="selectReportQualityInspectionVo"/>
<where>
<if test="barCode != null and barCode != ''">and bar_code = #{barCode}</if>
<if test="materialName != null and materialName != ''">and material_name like concat(concat('%',
#{materialName}), '%')
</if>
<if test="processCode != null and processCode != ''">and process_code = #{processCode}</if>
<if test="testItemCode != null and testItemCode != ''">and test_item_code = #{testItemCode}</if>
<if test="qualityDefectCode != null and qualityDefectCode != ''">and quality_defect_code =
#{qualityDefectCode}
</if>
<if test="qualityDefectName != null and qualityDefectName != ''">and quality_defect_name like
concat(concat('%', #{qualityDefectName}), '%')
</if>
<if test="treatmentMeasure != null and treatmentMeasure != ''">and treatment_measure =
#{treatmentMeasure}
</if>
<if test="processResult != null and processResult != ''">and process_result = #{processResult}</if>
<if test="isLowerLine != null and isLowerLine != ''">and is_lower_line = #{isLowerLine}</if>
<if test="groupCode != null and groupCode != ''">and group_code = #{groupCode}</if>
<if test="inspectorCode != null and inspectorCode != ''">and inspector_code = #{inspectorCode}</if>
<if test="inspectorTime != null ">and inspector_time = #{inspectorTime}</if>
<if test="reworkNumber != null ">and rework_number = #{reworkNumber}</if>
<if test="finishTime != null ">and finish_time = #{finishTime}</if>
<if test="isFlag != null ">and is_flag = #{isFlag}</if>
<if test="updatedBy != null and updatedBy != ''">and updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and updated_time = #{updatedTime}</if>
</where>
</select>
<select id="selectReportQualityInspectionByObjId" parameterType="Long" resultMap="ReportQualityInspectionResult">
<include refid="selectReportQualityInspectionVo"/>
where obj_id = #{objId}
</select>
<insert id="insertReportQualityInspection" parameterType="ReportQualityInspection">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_report_quality_inspection.NEXTVAL as objId FROM DUAL
</selectKey>
insert into report_quality_inspection
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="barCode != null">bar_code,</if>
<if test="materialName != null">material_name,</if>
<if test="processCode != null">process_code,</if>
<if test="testItemCode != null">test_item_code,</if>
<if test="qualityDefectCode != null">quality_defect_code,</if>
<if test="qualityDefectName != null">quality_defect_name,</if>
<if test="treatmentMeasure != null">treatment_measure,</if>
<if test="processResult != null">process_result,</if>
<if test="isLowerLine != null">is_lower_line,</if>
<if test="groupCode != null">group_code,</if>
<if test="inspectorCode != null">inspector_code,</if>
<if test="inspectorTime != null">inspector_time,</if>
<if test="reworkNumber != null">rework_number,</if>
<if test="finishTime != null">finish_time,</if>
<if test="isFlag != null">is_flag,</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="barCode != null">#{barCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="processCode != null">#{processCode},</if>
<if test="testItemCode != null">#{testItemCode},</if>
<if test="qualityDefectCode != null">#{qualityDefectCode},</if>
<if test="qualityDefectName != null">#{qualityDefectName},</if>
<if test="treatmentMeasure != null">#{treatmentMeasure},</if>
<if test="processResult != null">#{processResult},</if>
<if test="isLowerLine != null">#{isLowerLine},</if>
<if test="groupCode != null">#{groupCode},</if>
<if test="inspectorCode != null">#{inspectorCode},</if>
<if test="inspectorTime != null">#{inspectorTime},</if>
<if test="reworkNumber != null">#{reworkNumber},</if>
<if test="finishTime != null">#{finishTime},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
</trim>
</insert>
<update id="updateReportQualityInspection" parameterType="ReportQualityInspection">
update report_quality_inspection
<trim prefix="SET" suffixOverrides=",">
<if test="barCode != null">bar_code = #{barCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="processCode != null">process_code = #{processCode},</if>
<if test="testItemCode != null">test_item_code = #{testItemCode},</if>
<if test="qualityDefectCode != null">quality_defect_code = #{qualityDefectCode},</if>
<if test="qualityDefectName != null">quality_defect_name = #{qualityDefectName},</if>
<if test="treatmentMeasure != null">treatment_measure = #{treatmentMeasure},</if>
<if test="processResult != null">process_result = #{processResult},</if>
<if test="isLowerLine != null">is_lower_line = #{isLowerLine},</if>
<if test="groupCode != null">group_code = #{groupCode},</if>
<if test="inspectorCode != null">inspector_code = #{inspectorCode},</if>
<if test="inspectorTime != null">inspector_time = #{inspectorTime},</if>
<if test="reworkNumber != null">rework_number = #{reworkNumber},</if>
<if test="finishTime != null">finish_time = #{finishTime},</if>
<if test="isFlag != null">is_flag = #{isFlag},</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="deleteReportQualityInspectionByObjId" parameterType="Long">
delete
from report_quality_inspection
where obj_id = #{objId}
</delete>
<delete id="deleteReportQualityInspectionByObjIds" parameterType="String">
delete from report_quality_inspection where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save