|
|
|
@ -19,6 +19,19 @@ |
|
|
|
t.engineer, |
|
|
|
t.priority_level, |
|
|
|
t.proofing_number, |
|
|
|
t.proofing_number AS sampleQty, |
|
|
|
t.pm_inquery_time, |
|
|
|
-- 打样完成日期口径:actuality_delivery_date(DeliveryPackage 完成时回写),未完成则为空。 |
|
|
|
CASE WHEN t.actuality_delivery_date IS NULL THEN NULL ELSE YEAR(t.actuality_delivery_date) END AS sampleMakingYear, |
|
|
|
CASE WHEN t.actuality_delivery_date IS NULL THEN NULL ELSE MONTH(t.actuality_delivery_date) END AS sampleMakingMonth, |
|
|
|
CASE |
|
|
|
WHEN t.actuality_delivery_date IS NULL OR t.plan_start_date IS NULL THEN NULL |
|
|
|
ELSE DATEDIFF(DAY, t.plan_start_date, t.actuality_delivery_date) |
|
|
|
END AS sampleLt, |
|
|
|
CASE |
|
|
|
WHEN t.actuality_delivery_date IS NULL OR t.pm_inquery_time IS NULL THEN NULL |
|
|
|
ELSE DATEDIFF(DAY, t.pm_inquery_time, t.actuality_delivery_date) |
|
|
|
END AS sampleLtInquery, |
|
|
|
t.plan_start_date, |
|
|
|
t.required_delivery_date, |
|
|
|
t.baseline, |
|
|
|
@ -167,6 +180,21 @@ |
|
|
|
<if test="query.endDate != null"> |
|
|
|
and #{query.endDate,jdbcType=DATE} >= t.plan_start_date |
|
|
|
</if> |
|
|
|
<if test="query.sampleMakingYear != null"> |
|
|
|
<!-- 无打样完成日期的记录不能按年/月命中,避免把未完成单据算进完成年/月。 --> |
|
|
|
and t.actuality_delivery_date is not null |
|
|
|
and YEAR(t.actuality_delivery_date) = #{query.sampleMakingYear} |
|
|
|
</if> |
|
|
|
<if test="query.sampleMakingMonth != null"> |
|
|
|
and t.actuality_delivery_date is not null |
|
|
|
and MONTH(t.actuality_delivery_date) = #{query.sampleMakingMonth} |
|
|
|
</if> |
|
|
|
<if test="query.pmInqueryTimeStart != null"> |
|
|
|
and t.pm_inquery_time >= #{query.pmInqueryTimeStart,jdbcType=DATE} |
|
|
|
</if> |
|
|
|
<if test="query.pmInqueryTimeEnd != null"> |
|
|
|
and #{query.pmInqueryTimeEnd,jdbcType=DATE} >= t.pm_inquery_time |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
order by t.create_date desc |
|
|
|
</select> |
|
|
|
@ -224,6 +252,7 @@ |
|
|
|
required_delivery_date, |
|
|
|
baseline, |
|
|
|
actuality_delivery_date, |
|
|
|
pm_inquery_time, |
|
|
|
comments, |
|
|
|
remark, |
|
|
|
create_date, |
|
|
|
@ -424,11 +453,11 @@ |
|
|
|
INSERT INTO plm_proofing_information_tracking |
|
|
|
(id, site, project_id, project_part_id, proofing_id, proofing_no, proofing_status, project_phase, project_category, |
|
|
|
tracker, engineer, priority_level, proofing_number, plan_start_date, required_delivery_date, baseline, actuality_delivery_date, |
|
|
|
comments, remark, create_date, create_by, update_date, update_by) |
|
|
|
pm_inquery_time, comments, remark, create_date, create_by, update_date, update_by) |
|
|
|
VALUES |
|
|
|
(#{trackingId}, #{site}, #{projectId}, #{projectPartId}, #{proofingId}, #{proofingNo}, #{proofingStatus}, #{projectPhase}, #{projectCategory}, |
|
|
|
#{tracker}, #{engineer}, #{priorityLevel}, #{proofingNumber}, #{planStartDate,jdbcType=DATE}, #{requiredDeliveryDate,jdbcType=DATE}, #{baseline,jdbcType=DATE}, #{actualityDeliveryDate,jdbcType=DATE}, |
|
|
|
#{comments}, #{remark}, GETDATE(), #{createBy}, GETDATE(), #{updateBy}) |
|
|
|
#{pmInqueryTime,jdbcType=DATE}, #{comments}, #{remark}, GETDATE(), #{createBy}, GETDATE(), #{updateBy}) |
|
|
|
</insert> |
|
|
|
|
|
|
|
<select id="selectProcessValuesByTrackingIds" resultType="com.xujie.sys.modules.sampletracking.data.ProofTrackingProcessValueData"> |
|
|
|
@ -520,6 +549,7 @@ |
|
|
|
proofing_number = #{proofingNumber}, |
|
|
|
plan_start_date = #{planStartDate,jdbcType=DATE}, |
|
|
|
required_delivery_date = #{requiredDeliveryDate,jdbcType=DATE}, |
|
|
|
pm_inquery_time = #{pmInqueryTime,jdbcType=DATE}, |
|
|
|
project_phase = #{projectPhase}, |
|
|
|
proofing_status = #{proofingStatus}, |
|
|
|
update_date = GETDATE(), |
|
|
|
@ -537,6 +567,7 @@ |
|
|
|
plan_start_date = #{planStartDate,jdbcType=DATE}, |
|
|
|
required_delivery_date = #{requiredDeliveryDate,jdbcType=DATE}, |
|
|
|
baseline = #{baseline,jdbcType=DATE}, |
|
|
|
pm_inquery_time = #{pmInqueryTime,jdbcType=DATE}, |
|
|
|
tracker = #{tracker}, |
|
|
|
engineer = #{engineer}, |
|
|
|
priority_level = #{priorityLevel}, |
|
|
|
@ -592,6 +623,7 @@ |
|
|
|
t.required_delivery_date, |
|
|
|
t.baseline, |
|
|
|
t.actuality_delivery_date, |
|
|
|
t.pm_inquery_time, |
|
|
|
t.comments, |
|
|
|
t.remark, |
|
|
|
t.create_date, |
|
|
|
|