|
|
@@ -455,7 +455,7 @@
|
|
|
<select id="getProduct" resultType="com.github.zuihou.business.centralToolMagazine.dto.ChfTwoDatas">
|
|
|
select oo.order_name as orderName,
|
|
|
oo.product_num as productNum,
|
|
|
- ifnull(oo.produce_num,0) as produceNum,
|
|
|
+ ifnull(oo.complete_num,0) as produceNum,
|
|
|
oo.delivery_time as deliveryTime,
|
|
|
tp.online_status as onlineStatus,
|
|
|
CASE
|
|
|
@@ -472,7 +472,8 @@
|
|
|
END AS downTime,
|
|
|
tp.name
|
|
|
<if test="planStatus==null">
|
|
|
- ,ROUND(ROUND((TIMESTAMPDIFF(MINUTE, ttn.start_time, NOW()) / bbp.rated_workHours), 3) * 100, 0) AS point
|
|
|
+ /*,ROUND(ROUND((TIMESTAMPDIFF(MINUTE, ttn.start_time, NOW()) / bbp.rated_workHours), 3) * 100, 0) AS point,*/
|
|
|
+ ,DATE_FORMAT(ttn.start_time, '%Y-%m-%d %H:%i') as startTime,bbp.rated_workHours as sumTime
|
|
|
</if>
|
|
|
from imcs_o_order oo
|
|
|
INNER JOIN imcs_p_plan pp on oo.id=pp.order_id
|
|
|
@@ -556,23 +557,38 @@
|
|
|
<select id="getYearProductCount" resultType="java.lang.Integer">
|
|
|
SELECT IFNULL(COUNT(*),0)
|
|
|
FROM (
|
|
|
- SELECT MAX(end_time) AS endTime, complete_batch_no
|
|
|
+ SELECT MAX(end_time) AS endTime, complete_batch_no,count(*) as count
|
|
|
FROM imcs_t_task
|
|
|
GROUP BY complete_batch_no
|
|
|
) a
|
|
|
WHERE a.endTime IS NOT NULL
|
|
|
- AND YEAR(a.endTime) = YEAR(CURDATE());
|
|
|
+ AND YEAR(a.endTime) = YEAR(CURDATE()) and count=4;
|
|
|
</select>
|
|
|
|
|
|
<select id="getMonthProductCount" resultType="java.lang.Integer">
|
|
|
SELECT IFNULL(COUNT(*),0)
|
|
|
FROM (
|
|
|
- SELECT MAX(end_time) AS endTime, complete_batch_no
|
|
|
+ SELECT MAX(end_time) AS endTime, complete_batch_no,count(*) as count
|
|
|
FROM imcs_t_task
|
|
|
GROUP BY complete_batch_no
|
|
|
) a
|
|
|
WHERE a.endTime IS NOT NULL
|
|
|
- AND MONTH(a.endTime) = MONTH(CURDATE());
|
|
|
+ AND WEEK(a.endTime, 1) = WEEK(CURDATE(), 1)
|
|
|
+ and count=4
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getMinTool" resultType="com.github.zuihou.business.centralToolMagazine.entity.ToolCostomAddressHistory">
|
|
|
+ SELECT t.*
|
|
|
+ FROM tool_costom_address_history t
|
|
|
+ JOIN (
|
|
|
+ SELECT ip, MIN(create_time) AS earliest_time
|
|
|
+ FROM tool_costom_address_history
|
|
|
+ WHERE DATE_FORMAT(create_time, '%Y-%m-%d %H:%i') = #{startTime} and ip=#{ip}
|
|
|
+ AND result = 'true'
|
|
|
+ GROUP BY ip
|
|
|
+ ) sub
|
|
|
+ ON t.ip = sub.ip AND t.create_time = sub.earliest_time;
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|