|
|
|
@ -82,23 +82,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getProduceChartDataYM" resultType="com.op.quality.domain.QcStaticTable">
|
|
|
|
|
select
|
|
|
|
|
concat(qct.material_code,CONVERT(varchar(7),qct.income_time, 120)) materailDate,
|
|
|
|
|
<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) incomeTime
|
|
|
|
|
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 CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart}</if>
|
|
|
|
|
<if test="ymArrayEnd != null "> and #{ymArrayEnd}>= CONVERT(varchar(10),qct.income_time, 120)</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 ,
|
|
|
|
|
CONVERT(varchar(7),qct.income_time, 120)
|
|
|
|
|
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>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getWorkcenterList" resultType="com.op.system.api.domain.quality.FactoryDto">
|
|
|
|
|
select factory_name factoryName,
|
|
|
|
@ -255,4 +267,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
) t
|
|
|
|
|
GROUP by t.source_id
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getDLTableTitle" resultType="com.op.quality.domain.QcStaticTable">
|
|
|
|
|
SELECT
|
|
|
|
|
concat(q.material_code,'-',q.project_no,'-',CONVERT(varchar(10),q.ymdms, 120)) yearMonth,
|
|
|
|
|
material_code materialCode,
|
|
|
|
|
material_name materialName,
|
|
|
|
|
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 = 'checkTypeLL' 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>
|
|
|
|
|
) 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,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 = 'checkTypeLL' 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>
|
|
|
|
|
) q
|
|
|
|
|
GROUP BY q.material_code,q.material_name, q.ymdms,q.rule_name,q.project_no
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|