|
@@ -126,15 +126,17 @@
|
|
|
<if test="repairOrder.pcsDeviceName != null and repairOrder.pcsDeviceName != ''"> and pcs_device_name like concat('%', #{repairOrder.pcsDeviceName}, '%')</if>
|
|
<if test="repairOrder.pcsDeviceName != null and repairOrder.pcsDeviceName != ''"> and pcs_device_name like concat('%', #{repairOrder.pcsDeviceName}, '%')</if>
|
|
|
<if test="repairOrder.teamLeaderName != null and repairOrder.teamLeaderName != ''"> and team_leader_name like concat('%', #{repairOrder.teamLeaderName}, '%')</if>
|
|
<if test="repairOrder.teamLeaderName != null and repairOrder.teamLeaderName != ''"> and team_leader_name like concat('%', #{repairOrder.teamLeaderName}, '%')</if>
|
|
|
<if test="repairOrder.scoringStatus != null"> and scoring_status = #{repairOrder.scoringStatus}</if>
|
|
<if test="repairOrder.scoringStatus != null"> and scoring_status = #{repairOrder.scoringStatus}</if>
|
|
|
- <!-- 时间范围查询条件 -->
|
|
|
|
|
<if test="repairOrder.params.beginOccurTime != null"> AND occur_time >= #{repairOrder.params.beginOccurTime}</if>
|
|
<if test="repairOrder.params.beginOccurTime != null"> AND occur_time >= #{repairOrder.params.beginOccurTime}</if>
|
|
|
<if test="repairOrder.params.endOccurTime != null"> AND occur_time <= #{repairOrder.params.endOccurTime}</if>
|
|
<if test="repairOrder.params.endOccurTime != null"> AND occur_time <= #{repairOrder.params.endOccurTime}</if>
|
|
|
|
|
+ <!-- 时间范围查询条件 - 使用结单时间 -->
|
|
|
|
|
+ <if test="repairOrder.params.beginCompleteTime != null"> AND t.id IN (SELECT DISTINCT order_id FROM gxt_repair_order_flow WHERE action_type IN ('complete','auto_finalize') AND action_time >= #{repairOrder.params.beginCompleteTime})</if>
|
|
|
|
|
+ <if test="repairOrder.params.endCompleteTime != null"> AND t.id IN (SELECT DISTINCT order_id FROM gxt_repair_order_flow WHERE action_type IN ('complete','auto_finalize') AND action_time <= #{repairOrder.params.endCompleteTime})</if>
|
|
|
<!-- 业务特定数据权限过滤条件 -->
|
|
<!-- 业务特定数据权限过滤条件 -->
|
|
|
<if test="repairOrder != null and repairOrder.params.businessDataScope != null and repairOrder.params.businessDataScope != ''">
|
|
<if test="repairOrder != null and repairOrder.params.businessDataScope != null and repairOrder.params.businessDataScope != ''">
|
|
|
${repairOrder.params.businessDataScope}
|
|
${repairOrder.params.businessDataScope}
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
- and NULLIF(scoring_status, '') IS NOT NULL and work_order_status != 'invalid'
|
|
|
|
|
|
|
+ and NULLIF(scoring_status, '') IS NOT NULL and work_order_status IN ('completed','archived')
|
|
|
</where>
|
|
</where>
|
|
|
|
|
|
|
|
UNION ALL
|
|
UNION ALL
|
|
@@ -205,15 +207,17 @@
|
|
|
<if test="workOrder.pcsDeviceName != null and workOrder.pcsDeviceName != ''"> and pcs_device_name like concat('%', #{workOrder.pcsDeviceName}, '%')</if>
|
|
<if test="workOrder.pcsDeviceName != null and workOrder.pcsDeviceName != ''"> and pcs_device_name like concat('%', #{workOrder.pcsDeviceName}, '%')</if>
|
|
|
<if test="workOrder.teamLeaderName != null and workOrder.teamLeaderName != ''"> and team_leader_name like concat('%', #{workOrder.teamLeaderName}, '%')</if>
|
|
<if test="workOrder.teamLeaderName != null and workOrder.teamLeaderName != ''"> and team_leader_name like concat('%', #{workOrder.teamLeaderName}, '%')</if>
|
|
|
<if test="workOrder.scoringStatus != null"> and scoring_status = #{workOrder.scoringStatus}</if>
|
|
<if test="workOrder.scoringStatus != null"> and scoring_status = #{workOrder.scoringStatus}</if>
|
|
|
- <!-- 时间范围查询条件 -->
|
|
|
|
|
<if test="workOrder.params.beginCreateTime != null"> AND create_time >= #{workOrder.params.beginCreateTime}</if>
|
|
<if test="workOrder.params.beginCreateTime != null"> AND create_time >= #{workOrder.params.beginCreateTime}</if>
|
|
|
<if test="workOrder.params.endCreateTime != null"> AND create_time <= #{workOrder.params.endCreateTime}</if>
|
|
<if test="workOrder.params.endCreateTime != null"> AND create_time <= #{workOrder.params.endCreateTime}</if>
|
|
|
|
|
+ <!-- 时间范围查询条件 - 使用结单时间 -->
|
|
|
|
|
+ <if test="workOrder.params.beginCompleteTime != null"> AND t.id IN (SELECT DISTINCT order_id FROM gxt_work_order_flow WHERE action_type IN ('complete','auto_finalize') AND action_time >= #{workOrder.params.beginCompleteTime})</if>
|
|
|
|
|
+ <if test="workOrder.params.endCompleteTime != null"> AND t.id IN (SELECT DISTINCT order_id FROM gxt_work_order_flow WHERE action_type IN ('complete','auto_finalize') AND action_time <= #{workOrder.params.endCompleteTime})</if>
|
|
|
<!-- 业务特定数据权限过滤条件 -->
|
|
<!-- 业务特定数据权限过滤条件 -->
|
|
|
<if test="workOrder != null and workOrder.params.businessDataScope != null and workOrder.params.businessDataScope != ''">
|
|
<if test="workOrder != null and workOrder.params.businessDataScope != null and workOrder.params.businessDataScope != ''">
|
|
|
${workOrder.params.businessDataScope}
|
|
${workOrder.params.businessDataScope}
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
- and NULLIF(scoring_status, '') IS NOT NULL and work_order_status != 'invalid'
|
|
|
|
|
|
|
+ and NULLIF(scoring_status, '') IS NOT NULL and work_order_status IN ('completed','archived')
|
|
|
</where>
|
|
</where>
|
|
|
) t
|
|
) t
|
|
|
<where>
|
|
<where>
|