|
@@ -112,6 +112,9 @@
|
|
|
update_time as update_time
|
|
update_time as update_time
|
|
|
FROM gxt_repair_order t
|
|
FROM gxt_repair_order t
|
|
|
<where>
|
|
<where>
|
|
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
|
|
+ and (work_order_project_no like concat('%', #{keyword}, '%') or pcs_device_name like concat('%', #{keyword}, '%'))
|
|
|
|
|
+ </if>
|
|
|
<if test="repairOrder.workOrderProjectNo != null and repairOrder.workOrderProjectNo != ''"> and work_order_project_no like concat('%', #{repairOrder.workOrderProjectNo}, '%')</if>
|
|
<if test="repairOrder.workOrderProjectNo != null and repairOrder.workOrderProjectNo != ''"> and work_order_project_no like concat('%', #{repairOrder.workOrderProjectNo}, '%')</if>
|
|
|
<if test="repairOrder.workOrderStatus != null and repairOrder.workOrderStatus != ''"> and work_order_status = #{repairOrder.workOrderStatus}</if>
|
|
<if test="repairOrder.workOrderStatus != null and repairOrder.workOrderStatus != ''"> and work_order_status = #{repairOrder.workOrderStatus}</if>
|
|
|
<if test="repairOrder.gxtCenterId != null"> and gxt_center_id = #{repairOrder.gxtCenterId}</if>
|
|
<if test="repairOrder.gxtCenterId != null"> and gxt_center_id = #{repairOrder.gxtCenterId}</if>
|
|
@@ -121,7 +124,7 @@
|
|
|
<if test="repairOrder.pcsDeviceId != null"> and pcs_device_id = #{repairOrder.pcsDeviceId}</if>
|
|
<if test="repairOrder.pcsDeviceId != null"> and pcs_device_id = #{repairOrder.pcsDeviceId}</if>
|
|
|
<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 repairOrder.scoringStatus != ''"> and scoring_status = #{repairOrder.scoringStatus}</if>
|
|
|
<if test="repairOrder.orderType != null and repairOrder.orderType != ''"> and 1 = #{repairOrder.orderType}</if>
|
|
<if test="repairOrder.orderType != null and repairOrder.orderType != ''"> and 1 = #{repairOrder.orderType}</if>
|
|
|
and NULLIF(scoring_status, '') IS NOT NULL
|
|
and NULLIF(scoring_status, '') IS NOT NULL
|
|
|
<!-- 业务特定数据权限过滤条件 -->
|
|
<!-- 业务特定数据权限过滤条件 -->
|
|
@@ -184,6 +187,9 @@
|
|
|
update_time as update_time
|
|
update_time as update_time
|
|
|
FROM gxt_work_order t
|
|
FROM gxt_work_order t
|
|
|
<where>
|
|
<where>
|
|
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
|
|
+ and (work_order_project_no like concat('%', #{keyword}, '%') or pcs_device_name like concat('%', #{keyword}, '%'))
|
|
|
|
|
+ </if>
|
|
|
<if test="workOrder.workOrderProjectNo != null and workOrder.workOrderProjectNo != ''"> and work_order_project_no like concat('%', #{workOrder.workOrderProjectNo}, '%')</if>
|
|
<if test="workOrder.workOrderProjectNo != null and workOrder.workOrderProjectNo != ''"> and work_order_project_no like concat('%', #{workOrder.workOrderProjectNo}, '%')</if>
|
|
|
<if test="workOrder.workOrderStatus != null and workOrder.workOrderStatus != ''"> and work_order_status = #{workOrder.workOrderStatus}</if>
|
|
<if test="workOrder.workOrderStatus != null and workOrder.workOrderStatus != ''"> and work_order_status = #{workOrder.workOrderStatus}</if>
|
|
|
<if test="workOrder.gxtCenterId != null"> and gxt_center_id = #{workOrder.gxtCenterId}</if>
|
|
<if test="workOrder.gxtCenterId != null"> and gxt_center_id = #{workOrder.gxtCenterId}</if>
|
|
@@ -193,7 +199,7 @@
|
|
|
<if test="workOrder.pcsDeviceId != null"> and pcs_device_id = #{workOrder.pcsDeviceId}</if>
|
|
<if test="workOrder.pcsDeviceId != null"> and pcs_device_id = #{workOrder.pcsDeviceId}</if>
|
|
|
<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 workOrder.scoringStatus != ''"> and scoring_status = #{workOrder.scoringStatus}</if>
|
|
|
<if test="workOrder.orderType != null and workOrder.orderType != ''"> and 2 = #{workOrder.orderType}</if>
|
|
<if test="workOrder.orderType != null and workOrder.orderType != ''"> and 2 = #{workOrder.orderType}</if>
|
|
|
and NULLIF(scoring_status, '') IS NOT NULL
|
|
and NULLIF(scoring_status, '') IS NOT NULL
|
|
|
<!-- 业务特定数据权限过滤条件 -->
|
|
<!-- 业务特定数据权限过滤条件 -->
|
|
@@ -204,6 +210,7 @@
|
|
|
) t
|
|
) t
|
|
|
ORDER BY create_time DESC
|
|
ORDER BY create_time DESC
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
<select id="selectMobileUnionOrderList" resultMap="OrderScoreInfoResult">
|
|
<select id="selectMobileUnionOrderList" resultMap="OrderScoreInfoResult">
|
|
|
SELECT * FROM (
|
|
SELECT * FROM (
|
|
|
SELECT
|
|
SELECT
|
|
@@ -354,4 +361,51 @@
|
|
|
) t
|
|
) t
|
|
|
ORDER BY create_time DESC
|
|
ORDER BY create_time DESC
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectOrderScoreStatistics" resultType="map">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ COALESCE(SUM(CASE WHEN order_type = 2 THEN score ELSE 0 END), 0) AS maintenanceScore,
|
|
|
|
|
+ COALESCE(SUM(CASE WHEN order_type = 1 THEN score ELSE 0 END), 0) AS repairScore,
|
|
|
|
|
+ COUNT(CASE WHEN order_type = 2 THEN 1 END) AS maintenanceCount,
|
|
|
|
|
+ COUNT(CASE WHEN order_type = 1 THEN 1 END) AS repairCount
|
|
|
|
|
+ FROM (
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ 2 as order_type,
|
|
|
|
|
+ score as score
|
|
|
|
|
+ FROM gxt_work_order t
|
|
|
|
|
+ <where>
|
|
|
|
|
+ scoring_status IS NOT NULL AND scoring_status != ''
|
|
|
|
|
+ <if test="workOrder.scoringStatus != null and workOrder.scoringStatus != ''">
|
|
|
|
|
+ AND scoring_status = #{workOrder.scoringStatus}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="month != null and month != ''">
|
|
|
|
|
+ AND DATE_FORMAT(real_end_time, '%Y-%m') = #{month}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!-- 业务特定数据权限过滤条件 -->
|
|
|
|
|
+ <if test="workOrder.params.businessDataScope != null and workOrder.params.businessDataScope != ''">
|
|
|
|
|
+ ${workOrder.params.businessDataScope}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+
|
|
|
|
|
+ UNION ALL
|
|
|
|
|
+
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ 1 as order_type,
|
|
|
|
|
+ score as score
|
|
|
|
|
+ FROM gxt_repair_order t
|
|
|
|
|
+ <where>
|
|
|
|
|
+ scoring_status IS NOT NULL AND scoring_status != ''
|
|
|
|
|
+ <if test="repairOrder.scoringStatus != null and repairOrder.scoringStatus != ''">
|
|
|
|
|
+ AND scoring_status = #{repairOrder.scoringStatus}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="month != null and month != ''">
|
|
|
|
|
+ AND DATE_FORMAT(real_end_time, '%Y-%m') = #{month}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!-- 业务特定数据权限过滤条件 -->
|
|
|
|
|
+ <if test="repairOrder.params.businessDataScope != null and repairOrder.params.businessDataScope != ''">
|
|
|
|
|
+ ${repairOrder.params.businessDataScope}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ) t
|
|
|
|
|
+ </select>
|
|
|
</mapper>
|
|
</mapper>
|