领料单+质量看板接口

master
zhaoxiaolin 1 year ago
parent cfeda7559d
commit afe322e8c9

@ -67,8 +67,8 @@ public interface MesPrepareDetailMapper {
/**
* idlist
* @param prepareId
* @param workorderCode
* @return
*/
List<MesPrepareDetail> selectPrintPrepareDetailList(String prepareId);
List<MesPrepareDetail> selectPrintPrepareDetailList(String workorderCode);
}

@ -16,7 +16,7 @@ import com.op.mes.service.IMesPrepareDetailService;
/**
* mesService
*
*
* @author Open Platform
* @date 2023-08-04
*/
@ -29,7 +29,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
/**
* mes
*
*
* @param recordId mes
* @return mes
*/
@ -40,7 +40,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
/**
* mes
*
*
* @param mesPrepareDetail mes
* @return mes
*/
@ -51,7 +51,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
/**
* mes
*
*
* @param mesPrepareDetail mes
* @return
*/
@ -63,7 +63,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
/**
* mes
*
*
* @param mesPrepareDetail mes
* @return
*/
@ -75,7 +75,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
/**
* mes
*
*
* @param recordIds mes
* @return
*/
@ -86,7 +86,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
/**
* mes
*
*
* @param recordId mes
* @return
*/
@ -103,7 +103,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
@DS("#header.poolName")
public AjaxResult printPrepareByCode(String workorderCode) {
MesPrepare mesPrepare = mesPrepareMapper.selectMesPrepareByCode(workorderCode);
List<MesPrepareDetail> mesPrepareDetailList = mesPrepareDetailMapper.selectPrintPrepareDetailList(mesPrepare.getPrepareId());
List<MesPrepareDetail> mesPrepareDetailList = mesPrepareDetailMapper.selectPrintPrepareDetailList(workorderCode);
PrintPrepareVo printPrepareVo = new PrintPrepareVo();
printPrepareVo.setMesPrepare(mesPrepare);
printPrepareVo.setMesPrepareDetailList(mesPrepareDetailList);

@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="recordId" column="record_id" />
<result property="prepareId" column="prepare_id" />
<result property="materialCode" column="material_code" />
<result property="materailName" column="materail_name" />
<result property="materialName" column="material_name" />
<result property="materailSpc" column="material_spc" />
<result property="unit" column="unit" />
<result property="quantity" column="quantity" />
@ -63,12 +63,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where record_id = #{recordId}
</select>
<select id="selectPrintPrepareDetailList" parameterType="String" resultMap="MesPrepareDetailResult">
select record_id, prepare_id, material_code,material_name, unit,
quantity, status, remark, attr1, attr2, attr3, attr4,
create_by, create_time, update_by, update_time, prod_type, factory_code,fund_quanlity
from mes_prepare_detail
where prepare_id = #{prepareId}
<select id="selectPrintPrepareDetailList" parameterType="String" resultType="com.op.mes.domain.MesPrepareDetail">
select
mp.workorder_name workorderCode,
mpd.material_code materialCode,
mpd.material_name materialName,
mpd.quantity,
mpd.unit,
mpd.status,
mpd.fund_quanlity fundQuanlity,
mpd.factory_code factoryCode,
ow.product_date productDate
from pro_order_workorder ow
left join mes_prepare mp on ow.workorder_code = mp.workorder_code
left join mes_prepare_detail mpd on mp.prepare_id = mpd.prepare_id
where ow.belong_work_order = #{workorderCode}
order by mp.workorder_name desc
</select>
<insert id="insertMesPrepareDetail" parameterType="MesPrepareDetail">

@ -39,63 +39,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMesPrepareVo">
select prepare_id, workorder_code, workorder_name, parent_order, order_id, order_code, product_id, product_code, prod_type, product_name, product_spc, wet_detail_plan_id, product_date, shift_id, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, material_code, material_name, material_spc, unit, quantity from mes_prepare
select prepare_id, workorder_code, workorder_name, parent_order, order_id, order_code, product_id,
product_code, prod_type, product_name, product_spc, wet_detail_plan_id, product_date,
shift_id, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time,
update_by, update_time, factory_code, material_code, material_name, material_spc, unit, quantity
from mes_prepare
</sql>
<select id="selectMesPrepareList" parameterType="MesPrepare" resultMap="MesPrepareResult">
<select id="selectMesPrepareList" parameterType="com.op.mes.domain.MesPrepare" resultType="com.op.mes.domain.MesPrepare">
select
ms.prepare_id,
ms.workorder_code,
ms.workorder_name,
ms.parent_order,
ms.order_id,
ms.order_code,
ms.product_id,
ms.product_code,
ms.prod_type,
ms.product_name,
ms.product_spc,
ms.wet_detail_plan_id,
ms.product_date,
ms.shift_id,
ms.ancestors,
ms.status,
ms.remark,
ms.attr1,
ms.attr2,
ms.attr3,
ms.attr4,
ms.create_by,
ms.create_time,
ms.update_by,
ms.update_time,
ms.factory_code,
msd.prepare_id id,
msd.material_code,
msd.material_name,
msd.material_spc,
msd.unit,
msd.quantity
from mes_prepare ms,mes_prepare_detail msd
ms.workorder_name workorderCodeSap,
ow.workorder_code workorderCode,
ow.product_code productCode,
ow.product_name productName,
ow.product_date productDate,
ow.quantity_split quantity,
ow.unit
from mes_prepare ms
left join pro_order_workorder ow on ms.workorder_code = ow.workorder_code
<where>
<if test="workorderCode != null and workorderCode != ''"> and workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="workorderName != null and workorderName != ''"> and workorder_name like concat('%', #{workorderName}, '%')</if>
<if test="parentOrder != null and parentOrder != ''"> and parent_order = #{parentOrder}</if>
<if test="orderId != null and orderId != ''"> and order_id like concat('%', #{orderId}, '%')</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="productCode != null and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
<if test="prodType != null and prodType != ''"> and prod_type = #{prodType}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="productSpc != null and productSpc != ''"> and product_spc = #{productSpc}</if>
<if test="wetDetailPlanId != null and wetDetailPlanId != ''"> and wet_detail_plan_id = #{wetDetailPlanId}</if>
<if test="productDate != null "> and product_date = #{productDate}</if>
<if test="shiftId != null and shiftId != ''"> and shift_id = #{shiftId}</if>
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
<if test="status != null and status != ''"> and ms.status = #{status}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
ow.del_flag = '0' and ow.parent_order = '0'
<if test="workorderCode != null and workorderCode != ''"> and ow.workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="workorderCodeSap != null and workorderCodeSap != ''"> and ms.workorder_name like concat('%', #{workorderCodeSap}, '%')</if>
<if test="productCode != null and productCode != ''"> and ow.product_code like concat('%', #{productCode}, '%')</if>
<if test="productName != null and productName != ''"> and ow.product_name like concat('%', #{productName}, '%')</if>
<if test="productDate != null "> and ow.product_date = #{productDate}</if>
and ms.del_flag = '0'
</where>
order by ow.product_date desc
</select>
<select id="selectMesPrepareByPrepareId" parameterType="String" resultMap="MesPrepareResult">

@ -5,9 +5,7 @@ import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcInterface;
import com.op.quality.service.IQcInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -37,8 +35,8 @@ public class QcInterfaceController {
* @param qcInterface
* @return
*/
@GetMapping("/getOverallInfo")
public List<QcInterface> getOverallInfo(QcInterface qcInterface) {
@PostMapping("/getOverallInfo")
public List<QcInterface> getOverallInfo(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getOverallInfo(qcInterface);
}
@ -47,8 +45,45 @@ public class QcInterfaceController {
* @param qcInterface
* @return
*/
@GetMapping("/getCheckProjectsPie")
public List<QcInterface> getCheckProjectsPie(QcInterface qcInterface) {
@PostMapping("/getCheckProjectsPie")
public List<QcInterface> getCheckProjectsPie(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getCheckProjectsPie(qcInterface);
}
/**
* --
* @param qcInterface
* @return
*/
@PostMapping("/getSupplierBadTOP5")
public List<QcInterface> getSupplierBadTOP5(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getSupplierBadTOP5(qcInterface);
}
@PostMapping("/getSupplierNoOkList")
public List<QcInterface> getSupplierNoOkList(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getSupplierNoOkList(qcInterface);
}
/**
* --
* @param qcInterface
* @return
*/
@PostMapping("/getSupplierTaskList")
public List<QcInterface> getSupplierTaskList(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getSupplierTaskList(qcInterface);
}
/**
* -
* @param qcInterface
* @return
*/
@PostMapping("/getProduceStaticInfo")
public List<QcInterface> getProduceStaticInfo(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getProduceStaticInfo(qcInterface);
}
}

@ -1,5 +1,6 @@
package com.op.quality.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
@ -20,6 +21,106 @@ public class QcInterface extends BaseEntity {
private String quality;
private String ymd;
private String projectName;
private String checkNo;
private String incomeBatchNo;
private String orderNo;
private String materialName;
private String unit;
private String supplierName;
@JsonFormat(pattern = "yyyy-MM-dd")
private String incomeTime;
private String checkStatus;
private String checkResult;
private String checkManName;
private String checkName;
public String getCheckNo() {
return checkNo;
}
public void setCheckNo(String checkNo) {
this.checkNo = checkNo;
}
public String getIncomeBatchNo() {
return incomeBatchNo;
}
public void setIncomeBatchNo(String incomeBatchNo) {
this.incomeBatchNo = incomeBatchNo;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getIncomeTime() {
return incomeTime;
}
public void setIncomeTime(String incomeTime) {
this.incomeTime = incomeTime;
}
public String getCheckStatus() {
return checkStatus;
}
public void setCheckStatus(String checkStatus) {
this.checkStatus = checkStatus;
}
public String getCheckResult() {
return checkResult;
}
public void setCheckResult(String checkResult) {
this.checkResult = checkResult;
}
public String getCheckManName() {
return checkManName;
}
public void setCheckManName(String checkManName) {
this.checkManName = checkManName;
}
public String getCheckName() {
return checkName;
}
public void setCheckName(String checkName) {
this.checkName = checkName;
}
public String getProjectName() {
return projectName;

@ -21,4 +21,10 @@ public interface QcInterfaceMapper {
List<QcInterface> getOverallInfo(QcInterface qcInterface);
List<QcInterface> getCheckProjectsPie(QcInterface qcInterface);
List<QcInterface> getSupplierBadTOP5(QcInterface qcInterface);
List<QcInterface> getSupplierTaskList(QcInterface qcInterface);
List<QcInterface> getSupplierNoOkList(QcInterface qcInterface);
}

@ -18,4 +18,12 @@ public interface IQcInterfaceService {
List<QcInterface> getOverallInfo(QcInterface qcInterface);
List<QcInterface> getCheckProjectsPie(QcInterface qcInterface);
List<QcInterface> getSupplierBadTOP5(QcInterface qcInterface);
List<QcInterface> getSupplierTaskList(QcInterface qcInterface);
List<QcInterface> getSupplierNoOkList(QcInterface qcInterface);
List<QcInterface> getProduceStaticInfo(QcInterface qcInterface);
}

@ -13,6 +13,8 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.util.Calendar;
import java.util.List;
/**
@ -63,7 +65,63 @@ public class QcInterfaceServiceImpl implements IQcInterfaceService {
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getCheckProjectsPie(qcInterface);
return dtos;
}
@Override
public List<QcInterface> getSupplierBadTOP5(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getSupplierBadTOP5(qcInterface);
return dtos;
}
@Override
public List<QcInterface> getSupplierTaskList(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getSupplierTaskList(qcInterface);
for(QcInterface dto:dtos){
String[] ymdArray = dto.getIncomeTime().split("-");
LocalDate date1 = LocalDate.of(Integer.parseInt(ymdArray[0]),
Integer.parseInt(ymdArray[1]),
Integer.parseInt(ymdArray[2]));
LocalDate date2 = LocalDate.now();
if(date1.compareTo(date2)<0){
dto.setCheckStatus("逾期未检");
}else {
dto.setCheckStatus("0".equals(dto.getCheckStatus()) ? "待检测" : "检测完成");
}
dto.setCheckResult("Y".equals(dto.getCheckResult())?"合格":"不合格");
}
return dtos;
}
@Override
public List<QcInterface> getSupplierNoOkList(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getSupplierNoOkList(qcInterface);
for(QcInterface dto:dtos){
dto.setCheckStatus("0".equals(dto.getCheckStatus())?"待检测":"检测完成");
dto.setCheckResult("Y".equals(dto.getCheckResult())?"合格":"不合格");
}
return dtos;
}
@Override
public List<QcInterface> getProduceStaticInfo(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getSupplierNoOkList(qcInterface);
return dtos;
}
}

@ -191,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
<if test="checkType != null">check_type,</if>
<if test="typeCode != null">type_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
@ -223,6 +224,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="checkType != null">#{checkType},</if>
<if test="typeCode != null">#{typeCode},</if>
</trim>
</insert>

@ -145,6 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
<if test="checkType != null">check_type,</if>
<if test="typeCode != null">type_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
@ -181,6 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="checkType != null">#{checkType},</if>
<if test="typeCode != null">#{typeCode},</if>
</trim>
</insert>

@ -128,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
<if test="checkType != null">check_type,</if>
<if test="typeCode != null">type_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
@ -159,6 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="checkType != null">#{checkType},</if>
<if test="typeCode != null">#{typeCode},</if>
</trim>
</insert>

@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from wms_raw_order_in wroi
left join base_supplier bs on bs.supplier_code = wroi.supply_code
where wroi.active_flag = '1' and wroi.quality_status = '0'
<if test="orderNo != null">and wroi.order_no like contact like ('%',#{orderNo})</if>
<if test="orderNo != null">and wroi.order_no like concat like ('%',#{orderNo})</if>
</select>
<select id="getWorkOrder" resultType="com.op.quality.domain.QcCheckTaskIncome">
select
@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
product_date incomeTime
from pro_order_workorder
where status != 'w5' and parent_order != '0' and workorder_code_sap is not null
<if test="orderNo != null">and workorder_code_sap like contact like ('%',#{orderNo})</if>
<if test="orderNo != null">and workorder_code_sap like concat like ('%',#{orderNo})</if>
order by product_date desc
</select>

@ -57,4 +57,101 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
group by qctd.project_no,qctd.rule_name
</select>
<select id="getSupplierBadTOP5" resultType="com.op.quality.domain.QcInterface">
select top 5 * from(
select
concat(t1.supplier_name,'-',t1.material_name) supplierName,
ROUND(t2.noOkNum*100.00/t1.allNum, 2) quality
from (
select count(0) allNum,
qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
from qc_check_task qct
where qct.type_code = #{typeCode}
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
group by
qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
) t1
left join (
select
count(0) noOkNum,qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
from qc_check_task qct
where qct.type_code = #{typeCode} and qct.check_result = 'N'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
group by
qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
) t2 on t1.supplier_code = t2.supplier_code and t1.material_code = t2.material_code
) t order by t.quality desc
</select>
<select id="getSupplierTaskList" resultType="com.op.quality.domain.QcInterface">
select
qct.check_no checkNo,
qct.income_batch_no incomeBatchNo,
qct.order_no orderNo,
qct.material_name materialName,
qct.quality,
qct.unit,
qct.supplier_name supplierName,
qct.income_time incomeTime,
qct.check_status checkStatus,
qct.check_result checkResult,
qct.check_man_name checkManName,
qc.check_name checkName
from qc_check_task qct
left join qc_check_type qc on qct.check_type = qc.order_code
where qct.del_flag = '0' and qct.status = '1'
and qct.type_code = #{typeCode}
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
order by qct.income_time desc,qct.check_status asc
</select>
<select id="getSupplierNoOkList" resultType="com.op.quality.domain.QcInterface">
select
qct.check_no checkNo,
qct.income_batch_no incomeBatchNo,
qct.order_no orderNo,
qct.material_name materialName,
qct.quality,
qct.unit,
qct.supplier_name supplierName,
qct.income_time incomeTime,
qct.check_result checkResult,
qct.check_man_name checkManName,
qc.check_name checkName
from qc_check_task qct
left join qc_check_type qc on qct.check_type = qc.order_code
where qct.type_code = #{typeCode} and qct.check_result = 'N'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
order by qct.income_time desc
</select>
</mapper>

@ -24,8 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.supplier_code supplierCode,qct.supplier_name supplierName,
count(0) batchs,sum(qct.quality) nums
from qc_check_task qct
left join qc_check_type qc on qc.order_code = qct.check_type
where qc.type_code = #{qc.typeCode}
where qct.type_code = #{qc.typeCode}
and qct.del_flag = '0'
and CONVERT(varchar(7),qct.income_time, 120) = #{qc.yearMonth}
<if test="qc.checkResult != null">
@ -44,8 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.supplier_code supplierCode,qct.supplier_name supplierName,
sum(qct.noOk_quality) noOkNums
from qc_check_task qct
left join qc_check_type qc on qc.order_code = qct.check_type
where qc.type_code = #{qc.typeCode}
where qct.type_code = #{qc.typeCode}
and qct.del_flag = '0'
and CONVERT(varchar(7),qct.income_time, 120) = #{qc.yearMonth}
<if test="codes != null and codes.size()>0">
@ -66,8 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.cNoOkquality,
qct.income_time
from qc_check_task qct
left join qc_check_type qc on qc.order_code = qct.check_type
where qct.del_flag = '0' and qc.type_code = 'produce'
where qct.del_flag = '0' and qct.type_code = 'produce'
<if test="materialCode != null "> and qct.material_code in (${materialCode})</if>
<if test="workCenter != null "> and qct.supplier_code = #{workCenter}</if>
<if test="ymArrayStart != null "> and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart}</if>
@ -77,8 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select distinct qct.material_code materialCode,
qct.material_name materialName
from qc_check_task qct
left join qc_check_type qc on qc.order_code = qct.check_type
where qct.del_flag = '0' and qc.type_code = 'produce'
where qct.del_flag = '0' and qct.type_code = 'produce'
<if test="materialCode != null "> and qct.material_code in (${materialCode})</if>
<if test="workCenter != null "> and qct.supplier_code = #{workCenter}</if>
<if test="ymArrayStart != null "> and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart}</if>
@ -95,8 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sum(qct.cNoOkquality) cNoOkquality,
CONVERT(varchar(7),qct.income_time, 120) incomeTime
from qc_check_task qct
left join qc_check_type qc on qc.order_code = qct.check_type
where qct.del_flag = '0' and qc.type_code = 'produce'
where qct.del_flag = '0' and qct.type_code = 'produce'
<if test="materialCode != null "> and qct.material_code in (${materialCode})</if>
<if test="workCenter != null "> and qct.supplier_code = #{workCenter}</if>
<if test="ymArrayStart != null "> and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart}</if>

Loading…
Cancel
Save