You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

502 lines
26 KiB
XML

2 years ago
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
1 year ago
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2 years ago
<mapper namespace="com.op.quality.mapper.QcStaticTableMapper">
1 year ago
<select id="selectQcStaticTableList" parameterType="com.op.quality.domain.QcStaticTable"
resultType="com.op.quality.domain.QcStaticTable">
11 months ago
<!--
1 year ago
SELECT
bs.supplier_id supplierId,
bs.supplier_code supplierCode,
bs.zh_desc supplierName
from base_supplier bs
where bs.del_flag = '0' and bs.active_flag = '1'
<if test="supplierCodes != null and supplierCodes.size()>0">
and bs.supplier_code in
<foreach collection="supplierCodes" item="supplierCode" index="index" separator="," open="(" close=")">
#{supplierCode}
</foreach>
11 months ago
</if>-->
select DISTINCT qct.supplier_code supplierCode,
qct.supplier_name supplierName
from qc_check_task qct
where qct.type_code = 'material' and qct.del_flag = '0'
and CONVERT(varchar(7),qct.income_time, 120) = #{yearMonth}
1 year ago
</select>
<select id="selectPcMap" resultType="com.op.quality.domain.QcStaticTable">
SELECT
qct.supplier_code supplierCode,qct.supplier_name supplierName,
count(0) batchs,sum(qct.quality) nums
from qc_check_task qct
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">
and qct.check_result = #{qc.checkResult}
</if>
<if test="codes != null and codes.size()>0">
and qct.supplier_code in
<foreach collection="codes" item="item" index="index" separator="," open="(" close=")">
#{item.supplierCode}
</foreach>
</if>
group by qct.supplier_code,qct.supplier_name
</select>
<select id="selectNumMap" resultType="com.op.quality.domain.QcStaticTable">
SELECT
qct.supplier_code supplierCode,qct.supplier_name supplierName,
sum(qct.noOk_quality) noOkNums
from qc_check_task qct
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">
and qct.supplier_code in
<foreach collection="codes" item="item" index="index" separator="," open="(" close=")">
#{item.supplierCode}
</foreach>
</if>
group by qct.supplier_code,qct.supplier_name
</select>
2 years ago
<select id="getProduceChartData" resultType="com.op.quality.domain.QcStaticTable">
11 months ago
<!--
1 year ago
select concat(qct.material_code,CONVERT(varchar(10),qct.income_time, 120)) materailDate,
qct.material_code materialCode,
qct.material_name materialName,
qct.sample_quality sampleQuality,
qct.aNoOkquality,
qct.bNoOkquality,
qct.cNoOkquality,
qct.income_time
from qc_check_task qct
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>
11 months ago
<if test="ymArrayEnd != null ">and #{ymArrayEnd}>= CONVERT(varchar(10),qct.income_time, 120)</if>-->
select CONVERT(varchar(10),qct.income_time, 120) materailDate,
sum(qct.sample_quality) sampleQuality,
sum(qctd1.noOk_quality)*type1.ratio aNoOkquality,
sum(qctd2.noOk_quality)*type2.ratio bNoOkquality,
sum(qctd3.noOk_quality)*type3.ratio cNoOkquality
from qc_check_task qct
left join qc_check_task_defect qctd1 on qct.record_id = qctd1.belong_to and qctd1.defect_code = '20231212001'
left join qc_defect_type type1 on qctd1.defect_code = type1.defect_code
left join qc_check_task_defect qctd2 on qct.record_id = qctd2.belong_to and qctd2.defect_code = '20231212002'
left join qc_defect_type type2 on qctd2.defect_code = type2.defect_code
left join qc_check_task_defect qctd3 on qct.record_id = qctd3.belong_to and qctd3.defect_code = '20231212003'
left join qc_defect_type type3 on qctd3.defect_code = type3.defect_code
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.create_time, 120) >= #{ymArrayStart}</if>
<if test="ymArrayEnd != null ">and #{ymArrayEnd}>= CONVERT(varchar(10),qct.create_time, 120)</if>
group by CONVERT(varchar(10),qct.income_time, 120),type1.ratio,type2.ratio,type3.ratio
1 year ago
</select>
<select id="getProduceNames" resultType="com.op.quality.domain.QcStaticTable">
select distinct qct.material_code materialCode,
qct.material_name materialName
from qc_check_task qct
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>
<if test="ymArrayEnd != null ">and #{ymArrayEnd}>= CONVERT(varchar(10),qct.income_time, 120)</if>
</select>
<select id="getProduceChartDataYM" resultType="com.op.quality.domain.QcStaticTable">
11 months ago
<!--
1 year ago
select
<if test='dataType=="ymd" '>
concat(qct.material_code,CONVERT(varchar(10),qct.income_time, 120)) materailDate,
</if>
<if test='dataType=="ym" '>
concat(qct.material_code,CONVERT(varchar(7),qct.income_time, 120)) materailDate,
</if>
qct.material_code materialCode,
qct.material_name materialName,
sum(qct.sample_quality) sampleQuality,
sum(qct.aNoOkquality) aNoOkquality,
sum(qct.bNoOkquality) bNoOkquality,
sum(qct.cNoOkquality) cNoOkquality,
CONVERT(varchar(7),qct.income_time, 120)
from qc_check_task qct
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 dataType=="ym" '>and CONVERT(varchar(7),qct.income_time, 120) >=
#{ymArrayStart}
</if>
<if test='ymArrayEnd != null and dataType=="ym"'>and #{ymArrayEnd}>= CONVERT(varchar(7),qct.income_time, 120)
</if>
<if test='ymArrayStart != null and dataType=="ymd" '>and CONVERT(varchar(10),qct.income_time, 120) >=
#{ymArrayStart}
</if>
<if test='ymArrayEnd != null and dataType=="ymd"'>and #{ymArrayEnd}>= CONVERT(varchar(10),qct.income_time,
120)
</if>
group by qct.material_code ,
qct.material_name
<if test='dataType=="ymd" '>
,CONVERT(varchar(10),qct.income_time, 120)
</if>
<if test='dataType=="ym" '>
,CONVERT(varchar(7),qct.income_time, 120)
</if>
11 months ago
-->
select
<if test='dataType=="ymd" '>
CONVERT(varchar(10),qct.income_time, 120) materailDate,
</if>
<if test='dataType=="ym" '>
CONVERT(varchar(7),qct.income_time, 120) materailDate,
</if>
sum(qct.sample_quality) sampleQuality,
sum(qctd1.noOk_quality)*type1.ratio aNoOkquality,
sum(qctd2.noOk_quality)*type2.ratio bNoOkquality,
sum(qctd3.noOk_quality)*type3.ratio cNoOkquality
from qc_check_task qct
left join qc_check_task_defect qctd1 on qct.record_id = qctd1.belong_to and qctd1.defect_code = '20231212001'
left join qc_defect_type type1 on qctd1.defect_code = type1.defect_code
left join qc_check_task_defect qctd2 on qct.record_id = qctd2.belong_to and qctd2.defect_code = '20231212002'
left join qc_defect_type type2 on qctd2.defect_code = type2.defect_code
left join qc_check_task_defect qctd3 on qct.record_id = qctd3.belong_to and qctd3.defect_code = '20231212003'
left join qc_defect_type type3 on qctd3.defect_code = type3.defect_code
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 dataType=="ym" '>and CONVERT(varchar(7),qct.income_time, 120) >=#{ymArrayStart}</if>
<if test='ymArrayEnd != null and dataType=="ym"'>and #{ymArrayEnd}>= CONVERT(varchar(7),qct.income_time, 120)</if>
<if test='ymArrayStart != null and dataType=="ymd" '>and CONVERT(varchar(10),qct.income_time, 120) >=#{ymArrayStart}</if>
<if test='ymArrayEnd != null and dataType=="ymd"'>and #{ymArrayEnd}>= CONVERT(varchar(10),qct.income_time,120)</if>
group by type1.ratio,type2.ratio,type3.ratio
<if test='dataType=="ymd" '>
,CONVERT(varchar(10),qct.income_time, 120)
</if>
<if test='dataType=="ym" '>
,CONVERT(varchar(7),qct.income_time, 120)
</if>
1 year ago
</select>
<select id="getWorkcenterList" resultType="com.op.system.api.domain.quality.FactoryDto">
select factory_name factoryName,
factory_code factoryCode
from sys_factory where f_type = 'c'
2 years ago
</select>
2 years ago
<select id="getXJCheckTableList" resultType="com.op.quality.domain.QcStaticTable">
1 year ago
select distinct
11 months ago
qct.order_no orderNo,
qct.material_code materialCode, qct.material_name materialName,
qct.quality,qct.unit,
qct.supplier_code supplierCode,qct.supplier_name supplierName,
pow.product_date incomeTimeStr,
pow.shift_id shiftId
from qc_check_task qct
left join pro_order_workorder pow on pow.workorder_code = qct.order_no
where qct.check_type = 'checkTypeSCXJ' and qct.del_flag = '0'
<if test="orderNo != null ">and qct.check_no like concat('%',#{orderNo},'%')</if>
<if test="materialCode != null ">and qct.material_code like concat('%',#{materialCode},'%')</if>
<if test="incomeBatchNo != null ">and qct.income_batch_no like concat('%',#{incomeBatchNo},'%')</if>
<if test="incomeTimeStr != null ">and CONVERT(varchar(10),pow.product_date, 120) = #{incomeTimeStr}
1 year ago
</if>
11 months ago
order by pow.product_date desc
1 year ago
</select>
<select id="getXJProjects" resultType="com.op.quality.domain.QcStaticTable">
2 years ago
select qct.rule_name ruleName,
qctp.project_id projectId,
qctp.project_no projectNo
from qc_check_type_project qctp
left join qc_check_project qct on qctp.project_id = qct.id
where qctp.type_id = 'checkTypeSCXJ' and qctp.del_flag = '0' and qct.del_flag = '0'
order by qctp.sort
</select>
1 year ago
<select id="getProjectDetail" resultType="com.op.quality.domain.QcStaticTable">
1 year ago
select qctd.record_id recordId,
qctd.project_id projectId,
qctd.record_id detailId,
2 years ago
qctd.status,
1 year ago
qctd.remark,
CONVERT(VARCHAR(5),qctd.create_time, 108),
2 years ago
concat(qctd.project_id,
case when '09:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '08:00' then '08'
when '10:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '09:00' then '09'
when '11:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '10:00' then '10'
when '12:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '11:00' then '11'
when '13:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '12:30' then '12'
when '14:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '13:30' then '13'
when '15:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '14:30' then '14'
when '16:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '15:30' then '15'
when '17:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '16:30' then '16'
when '19:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '18:00' then '18'
when '20:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '19:00' then '19'
when '21:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '20:00' then '20'
2 years ago
else '-' end
)ymdms
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
where qct.order_no = #{orderNo} and qct.check_type = 'checkTypeSCXJ' and qct.check_status = '2'
2 years ago
order by qctd.create_time
</select>
1 year ago
<select id="getProjectDetailNight" resultType="com.op.quality.domain.QcStaticTable">
select qctd.record_id recordId,
qctd.project_id projectId,
qctd.record_id detailId,
1 year ago
qctd.status,
qctd.remark,
CONVERT(VARCHAR(5),qctd.create_time, 108),
concat(qctd.project_id,
case when '21:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '20:30' then '08'
when '22:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '21:30' then '09'
when '23:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '22:30' then '10'
when '23:59'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '23:30' then '11'
when '01:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '00:00' then '11'
when '02:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '01:30' then '12'
when '03:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '02:30' then '13'
when '04:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '03:30' then '14'
when '05:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '04:30' then '15'
when '06:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '05:30' then '16'
when '07:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '06:30' then '18'
when '08:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '07:30' then '19'
else '-' end
)ymdms
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
where qct.order_no = #{orderNo} and qct.check_type = 'checkTypeSCXJ' and qct.check_status = '2'
order by qctd.create_time
</select>
1 year ago
<select id="getBatchnos" resultType="java.lang.String">
select powb.batch_code batchCode
from pro_order_workorder_batch powb
left join pro_order_workorder pow on powb.workorder_id = pow.workorder_id
where powb.del_flag = '0' and pow.del_flag = '0'
and pow.workorder_code = #{orderNo}
</select>
1 year ago
<select id="getLegendData" resultType="com.op.quality.domain.QcStaticTable">
select DISTINCT supplier_code supplierCode,
supplier_name supplierName
from qc_check_task
where check_type = 'checkTypeSCXJ' and del_flag = '0'
and CONVERT(varchar(10),income_time, 120) = #{ymdms}
</select>
1 year ago
<select id="getXJMapData" resultType="com.op.quality.domain.QcStaticTable">
11 months ago
<!--
1 year ago
select qct.supplier_code supplierCode,
qct.supplier_name supplierName,
sum(qct.sample_quality) sampleQuality,
sum(qct.noOk_quality) noOkNums,
concat(qct.supplier_code,CONVERT(VARCHAR(2), qct.check_time, 108)) ymdms
from qc_check_task qct
where qct.check_type = 'checkTypeSCXJ' and qct.del_flag = '0'
and CONVERT(varchar(10),qct.income_time, 120) = #{ymdms}
<if test="orderNo != null ">and qct.check_no like concat('%',#{orderNo},'%')</if>
<if test="materialCode != null ">and qct.material_code like concat('%',#{materialCode},'%')</if>
group by qct.supplier_code,qct.supplier_name,CONVERT(VARCHAR(2), qct.check_time, 108)
11 months ago
-->
select
sum(qct.sample_quality) sampleQuality,
sum(qct.noOk_quality) noOkNums,
CONVERT(VARCHAR(2), qct.check_time, 108) ymdms
from qc_check_task qct
where qct.check_type = 'checkTypeSCXJ' and qct.del_flag = '0'
and CONVERT(varchar(10),qct.income_time, 120) = #{ymdms}
group by CONVERT(VARCHAR(2), qct.check_time, 108)
1 year ago
</select>
<select id="getQmsRateTable" resultType="com.op.quality.domain.QcStaticTable">
select qct.supplier_code supplierCode,
qct.supplier_name supplierName,
<if test="orderNo != null ">qct.order_no orderNo, qct.unit,</if>
11 months ago
<if test="incomeBatchNo != null ">qct.income_batch_no incomeBatchNo,</if>
<if test="materialCode != null ">qct.material_code materialCode,qct.material_name materialName,</if>
1 year ago
sum(quality) quality,
sum(qct.sample_quality) sampleQuality,
sum(qct.noOk_quality) noOkNums
from qc_check_task qct
where qct.del_flag = '0'
<if test="orderNo != null ">and qct.order_no = #{orderNo}</if>
<if test="incomeBatchNo != null ">and qct.income_batch_no like concat('%',#{incomeBatchNo},'%')</if>
<if test="materialCode != null ">and qct.material_code like concat('%',#{materialCode},'%')</if>
<if test="supplierCode != null ">and qct.supplier_code = #{supplierCode}</if>
<if test="typeCode != null ">and qct.type_code = #{typeCode}</if>
<if test="checkType != null ">and qct.check_type = #{checkType}</if>
<if test="ymArrayStart != null ">and CONVERT(varchar(10),qct.income_time, 120) >=
CONVERT(varchar(10),#{ymArrayStart}, 120)
</if>
<if test="ymArrayEnd != null ">and CONVERT(varchar(10),#{ymArrayEnd}, 120)>=CONVERT(varchar(10),qct.income_time,
120)
</if>
group by qct.supplier_code,qct.supplier_name
<if test="orderNo != null ">,qct.order_no,qct.unit</if>
<if test="incomeBatchNo != null ">,qct.income_batch_no</if>
<if test="materialCode != null ">,qct.material_code,qct.material_name</if>
</select>
<select id="getCheckTypeList" resultType="com.op.quality.domain.QcCheckType">
select order_code checkType,
check_name checkName
from qc_check_type
where del_flag = '0' and type_code= #{typeCode}
</select>
<select id="getSupplier" resultType="com.op.quality.domain.QcStaticTable">
select supplier_code supplierCode,
zh_desc supplierName
from base_supplier where del_flag = '0'
</select>
1 year ago
<select id="getLocList" resultType="com.op.quality.domain.QcStaticTable">
select warehouse_code supplierCode,
warehouse_name supplierName
from base_warehouse
where del_flag = '0' and active_flag = '1'
</select>
1 year ago
<select id="getWorkcenter" resultType="com.op.quality.domain.QcStaticTable">
select factory_name supplierName,
factory_code supplierCode
from sys_factory where f_type = 'c'
</select>
1 year ago
<select id="picsMap" resultType="com.op.quality.domain.QcStaticTable">
SELECT
t.source_id recordId,
STUFF(
(SELECT ',' + file_address
FROM (
select file_address,source_id from base_file where source_id in(
select record_id from qc_check_task_detail where beLong_to in (
select record_id from qc_check_task
where order_no = #{orderNo} and check_type = 'checkTypeSCXJ')
)
) t0
WHERE t.source_id = t0.source_id
FOR xml path('')
),1,1,''
) projectId
FROM (
select file_address,source_id from base_file where source_id in(
select record_id from qc_check_task_detail where beLong_to in (
select record_id from qc_check_task
where order_no = #{orderNo} and check_type = 'checkTypeSCXJ')
)
) t
GROUP by t.source_id
</select>
1 year ago
<select id="getDLTableTitle" resultType="com.op.quality.domain.QcStaticTable">
1 year ago
select t0.* ,bp.product_desc_zh materialName from(
SELECT
concat(q.material_code,'-',q.project_no,'-',CONVERT(varchar(10),q.ymdms, 120)) yearMonth,
material_code materialCode,
ymdms,rule_name ruleName,
project_no projectNo,
STUFF(
(SELECT ',' + t.actual_value
FROM (select
qct.material_code,qct.material_name,
CONVERT(varchar(10),qct.income_time, 120) ymdms,
qctd.rule_name, qctd.project_no,qctd.actual_value
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
where qct.check_type = #{checkType} and qctd.property_code = '1' and qct.check_time is not null
<if test="ymArrayStart != null ">and CONVERT(varchar(10),qct.income_time, 120) >=
CONVERT(varchar(10),#{ymArrayStart}, 120)
</if>
<if test="ymArrayEnd != null ">and CONVERT(varchar(10),#{ymArrayEnd}, 120)>=CONVERT(varchar(10),qct.income_time,
120)
</if>
<if test="projectNoArray != null ">and qctd.project_id in(
<foreach collection="projectNoArray" separator="," item="projectId">
#{projectId}
</foreach>
)
</if>
<if test="orderNo != null ">
and qct.order_no = #{orderNo}
</if>
<if test="materialCode != null ">
and qct.material_code = #{materialCode}
</if>
<if test="supplierCode != null ">
and qct.supplier_code = #{supplierCode}
</if>
1 year ago
) t
WHERE t.material_code = q.material_code and t.project_no = q.project_no and t.ymdms=q.ymdms
FOR xml path('')
),1,1,''
) quality
FROM (
select
qct.material_code,
CONVERT(varchar(10),qct.income_time, 120) ymdms,
qctd.rule_name,qctd.project_no,qctd.actual_value
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
where qct.check_type = #{checkType} and qctd.property_code = '1' and qct.check_time is not null
<if test="ymArrayStart != null ">and CONVERT(varchar(10),qct.income_time, 120) >=
CONVERT(varchar(10),#{ymArrayStart}, 120)
</if>
<if test="ymArrayEnd != null ">and CONVERT(varchar(10),#{ymArrayEnd}, 120)>=CONVERT(varchar(10),qct.income_time,
120)
</if>
<if test="projectNoArray != null ">and qctd.project_id in(
<foreach collection="projectNoArray" separator="," item="projectId">
#{projectId}
</foreach>
)
</if>
<if test="orderNo != null ">
and qct.order_no = #{orderNo}
</if>
<if test="materialCode != null ">
and qct.material_code = #{materialCode}
</if>
<if test="supplierCode != null ">
and qct.supplier_code = #{supplierCode}
</if>
) q
GROUP BY q.material_code, q.ymdms,q.rule_name,q.project_no
) t0 left join base_product bp on bp.product_code = t0.materialCode
where t0.quality is not null
1 year ago
</select>
1 year ago
<select id="getProjectList" resultType="com.op.quality.domain.QcStaticTable">
select qcp.id recordId,
qcp.rule_name ruleName
from qc_check_type_project qctp
1 year ago
left join qc_check_project qcp on qctp.project_id = qcp.id
where qctp.type_id = #{checkType} and qctp.property_code = '1'
1 year ago
and qctp.material_code is null and qcp.rule_name is not null
1 year ago
</select>
<select id="getUpAndDown" resultType="com.op.quality.domain.QcStaticTable">
select ISNULL(upper_diff,0) upperDiff,
ISNULL(down_diff, 0) downDiff
from qc_check_type_project where project_id = #{projectNo}
and type_id = #{checkType}
</select>
<select id="defectMap" resultType="com.op.quality.domain.QcStaticTable">
SELECT
qctd.belong_to,
qctd.belong_to_detail detailId,
STUFF(
(SELECT ';' + defect_subclass+':'+ CONVERT(NVARCHAR(15), noOk_quality)
FROM qc_check_task_defect
WHERE belong_to = qctd.belong_to and belong_to_detail = qctd.belong_to_detail
FOR xml path('')
),1,1,''
) remark
FROM qc_check_task_defect qctd
left join qc_check_task qct on qctd.belong_to = qct.record_id
where qctd.del_flag = '0' and qct.order_no = #{orderNo}
GROUP by qctd.belong_to,qctd.belong_to_detail
</select>
11 months ago
<select id="getTableHzTitle" resultType="java.lang.String">
select dict_label from base_dict_data
where dict_type = #{dataType}
and remark = #{remark} order by dict_sort
</select>
<select id="getTableHzTitle2" resultType="java.lang.String">
select defect_subclass from qc_defect_type where defect_type = #{typeCode} and del_flag = '0'
</select>
2 years ago
</mapper>