定量分析

master
zhaoxiaolin 7 months ago
parent 3a2c074bfa
commit b5f14e9f37

@ -310,86 +310,88 @@
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 = #{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>
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>
) 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 = #{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.material_name, q.ymdms,q.rule_name,q.project_no
) 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
</select>
<select id="getProjectList" resultType="com.op.quality.domain.QcStaticTable">
select qcp.id recordId,
qcp.rule_name ruleName
from qc_check_type_project qctp
left join qc_check_project qcp on qctp.project_id = qcp.id
left join qc_check_project qcp on qctp.project_id = qcp.id
where qctp.type_id = #{checkType} and qctp.property_code = '1'
and qctp.material_code is null
and qctp.material_code is null and qcp.rule_name is not null
</select>
</mapper>

@ -351,6 +351,15 @@ public class BaseProduct extends BaseEntity {
*/
@Excel(name = "报工汇率")
private BigDecimal reportRate;
private String mvgr5Nm;
public String getMvgr5Nm() {
return mvgr5Nm;
}
public void setMvgr5Nm(String mvgr5Nm) {
this.mvgr5Nm = mvgr5Nm;
}
public void setCategory(String category) {
this.category = category;

@ -65,6 +65,8 @@
<result property="supportPlate" column="support_plate"/>
<result property="other" column="other"/>
<result property="reportRate" column="report_rate"/>
<result property="mvgr5Nm" column="mvgr5_nm"/>
<!--附属属性-->
<result property="id" column="id"/>
</resultMap>
@ -164,7 +166,7 @@
bp.append_flag,
bp.append_percent,
bp.mtart,
bp.report_rate,
bp.report_rate,bp.mvgr5_nm,
bpa.id,
bpa.category,
bpa.pc,
@ -235,6 +237,7 @@
<if test="appendFlag != null">append_flag,</if>
<if test="appendPercent != null">append_percent,</if>
<if test="mtart != null">mtart,</if>
<if test="mvgr5Nm != null">mvgr5_nm,</if>
report_rate,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -281,6 +284,7 @@
<if test="appendFlag != null">#{appendFlag},</if>
<if test="appendPercent != null">#{appendPercent},</if>
<if test="mtart != null">#{mtart},</if>
<if test="mvgr5Nm != null">#{mvgr5Nm},</if>
#{reportRate},
</trim>
</insert>
@ -329,6 +333,8 @@
<if test="appendFlag != null">append_flag = #{appendFlag},</if>
<if test="appendPercent != null">append_percent = #{appendPercent},</if>
<if test="mtart != null and mtart != ''">mtart = #{mtart},</if>
<if test="mvgr5Nm != null and mvgr5Nm != ''">mvgr5_nm = #{mvgr5Nm},</if>
report_rate = #{reportRate},
</trim>
where product_id = #{productId}

Loading…
Cancel
Save