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.

61 lines
2.1 KiB
XML

<?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.op.quality.mapper.QcInterfaceMapper">
<select id="getDictData" resultType="com.op.quality.domain.QcInterface">
select dict_label ymdTypeName,
dict_value ymdType
from sys_dict_data
where dict_type = #{dictType} and status = '0'
</select>
<select id="getOverallInfo" resultType="com.op.quality.domain.QcInterface">
select count(0) quality,'all' ymdTypeName
from wms_raw_order_in
where active_flag = '1'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),receipt_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),receipt_time, 120) =SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),receipt_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
union ALL
select count(0),'unOk'
from qc_check_unqualified qcu
left join qc_check_type qct on qcu.type = qct.order_code
where qct.type_code = #{typeCode} and qcu.del_flag = '0'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qcu.create_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qcu.create_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qcu.create_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
</select>
<select id="getCheckProjectsPie" resultType="com.op.quality.domain.QcInterface">
select count(0) quality,
qctd.project_no,
qctd.rule_name projectName
from qc_check_task_detail qctd
left join qc_check_task qct on qctd.belong_to = qct.record_id
where qct.check_result = 'N' and qct.type_code = #{typeCode}
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qctd.update_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qcu.update_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qcu.update_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
group by qctd.project_no,qctd.rule_name
</select>
</mapper>