代码提交
This commit is contained in:
parent
3fe0fe901d
commit
3f42f95b41
|
|
@ -635,6 +635,7 @@
|
||||||
|
|
||||||
LEFT JOIN v_mtp_status vs on mm.ID = vs.maId
|
LEFT JOIN v_mtp_status vs on mm.ID = vs.maId
|
||||||
WHERE 30> to_days(ifnull(mm.NEXT_CHECK_TIME,now())) - to_days(now())
|
WHERE 30> to_days(ifnull(mm.NEXT_CHECK_TIME,now())) - to_days(now())
|
||||||
|
group by mm.ID
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -692,19 +693,23 @@
|
||||||
<select id="getTotalChangeWarn" parameterType="com.bonus.index.beans.IndexTotalWarnBean" resultType="com.bonus.index.beans.IndexTotalWarnBean">
|
<select id="getTotalChangeWarn" parameterType="com.bonus.index.beans.IndexTotalWarnBean" resultType="com.bonus.index.beans.IndexTotalWarnBean">
|
||||||
SELECT
|
SELECT
|
||||||
mt.ID,
|
mt.ID,
|
||||||
mt2.`NAME` as maType,
|
mt2.`NAME` AS maType,
|
||||||
mt.`NAME` as maName,
|
mt.`NAME` AS maName,
|
||||||
mt.UNIT as maUnit,
|
mt.UNIT AS maUnit,
|
||||||
mt.is_count as isCount,
|
mt.is_count AS isCount,
|
||||||
t1.TIME as time,
|
t1.TIME AS time,
|
||||||
t1.content
|
t1.content
|
||||||
FROM ma_total_change t1
|
FROM ma_total_change t1
|
||||||
LEFT JOIN mm_type mt on mt.ID = t1.type_id
|
LEFT JOIN mm_type mt ON mt.ID = t1.type_id
|
||||||
LEFT JOIN mm_type mt2 on mt.PARENT_ID = mt2.ID
|
LEFT JOIN mm_type mt2 ON mt.PARENT_ID = mt2.ID
|
||||||
WHERE NOT EXISTS (
|
WHERE
|
||||||
|
DATEDIFF(NOW(), t1.time) < 30
|
||||||
|
AND NOT EXISTS (
|
||||||
SELECT 1
|
SELECT 1
|
||||||
FROM ma_total_change t2
|
FROM ma_total_change t2
|
||||||
WHERE t2.type_id = t1.type_id AND t2.time > t1.time
|
WHERE
|
||||||
|
t2.type_id = t1.type_id
|
||||||
|
AND t2.time > t1.time
|
||||||
)
|
)
|
||||||
<if test="maType != null and maType != ''">
|
<if test="maType != null and maType != ''">
|
||||||
and mt2.`NAME` like concat('%', #{maType}, '%')
|
and mt2.`NAME` like concat('%', #{maType}, '%')
|
||||||
|
|
@ -1387,7 +1392,9 @@
|
||||||
LEFT JOIN bm_project bp ON cpa.pro_id = bp.ID
|
LEFT JOIN bm_project bp ON cpa.pro_id = bp.ID
|
||||||
LEFT JOIN car_ma_type_info cmti ON cpd.model_id = cmti.id
|
LEFT JOIN car_ma_type_info cmti ON cpd.model_id = cmti.id
|
||||||
WHERE bp.`NAME` IS NOT NULL
|
WHERE bp.`NAME` IS NOT NULL
|
||||||
and cpa.status = 1
|
and cpa.status = 2
|
||||||
|
and cpa.dispatch_num = 0
|
||||||
|
and cpa.status_type = 1
|
||||||
<if test="projectName != null and projectName != ''">
|
<if test="projectName != null and projectName != ''">
|
||||||
and bp.`NAME` like concat('%', #{projectName}, '%')
|
and bp.`NAME` like concat('%', #{projectName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -1414,7 +1421,9 @@
|
||||||
LEFT JOIN st_plan_apply spa ON spd.apply_id = spa.id
|
LEFT JOIN st_plan_apply spa ON spd.apply_id = spa.id
|
||||||
LEFT JOIN bm_project bp ON spa.project_id = bp.ID
|
LEFT JOIN bm_project bp ON spa.project_id = bp.ID
|
||||||
WHERE bp.`NAME` IS NOT NULL
|
WHERE bp.`NAME` IS NOT NULL
|
||||||
and spa.status = 1
|
and spa.status = 2
|
||||||
|
and spa.ck_num = 0
|
||||||
|
and spa.status_type = 1
|
||||||
<if test="projectName != null and projectName != ''">
|
<if test="projectName != null and projectName != ''">
|
||||||
and bp.`NAME` like concat('%', #{projectName}, '%')
|
and bp.`NAME` like concat('%', #{projectName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -1442,7 +1451,8 @@
|
||||||
LEFT JOIN t_plan_apply tpa on tpa.id=tpd.apply_id
|
LEFT JOIN t_plan_apply tpa on tpa.id=tpd.apply_id
|
||||||
LEFT JOIN bm_project pro on tpa.project_id=pro.ID
|
LEFT JOIN bm_project pro on tpa.project_id=pro.ID
|
||||||
WHERE pro.`NAME` is not null
|
WHERE pro.`NAME` is not null
|
||||||
and tpa.status = 1
|
and tpa.status = 2
|
||||||
|
and tpa.status_type = 1
|
||||||
<if test="maName != null and maName != ''">
|
<if test="maName != null and maName != ''">
|
||||||
and tpd.`NAME` like concat('%', #{maName}, '%')
|
and tpd.`NAME` like concat('%', #{maName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -198,21 +198,30 @@
|
||||||
SELECT
|
SELECT
|
||||||
0 AS storageNum,
|
0 AS storageNum,
|
||||||
0 AS checkNum,
|
0 AS checkNum,
|
||||||
COUNT(DISTINCT maId) as useNum,
|
COUNT(*) AS useNum,
|
||||||
0 as changeNum
|
0 AS changeNum
|
||||||
FROM
|
FROM (
|
||||||
(
|
SELECT 1
|
||||||
SELECT
|
|
||||||
DISTINCT ps.machine as maId,
|
|
||||||
to_days(now()) -to_days(ps.start_date) as days
|
|
||||||
FROM
|
FROM
|
||||||
ma_type_project_storage ps
|
ma_type_project_storage ps
|
||||||
LEFT JOIN mm_machines mm on ps.machine = mm.ID
|
INNER JOIN mm_machines mm ON ps.machine = mm.ID
|
||||||
WHERE ps.`status` =1 and ps.is_count = 0
|
INNER JOIN mm_type mt ON mm.TYPE = mt.ID
|
||||||
and mm.BATCH_STATUS = 6
|
LEFT JOIN mm_type mt2 ON mt.PARENT_ID = mt2.ID
|
||||||
GROUP BY ps.machine
|
LEFT JOIN wf_lease_agreement wla ON ps.agreement_id = wla.ID
|
||||||
) rs
|
LEFT JOIN bm_project bp ON wla.PROJECT = bp.ID
|
||||||
WHERE rs.days> 180
|
LEFT JOIN bm_company bc ON bp.COMPANY_ID = bc.ID
|
||||||
|
WHERE
|
||||||
|
ps.status = 1
|
||||||
|
AND ps.end_date IS NULL
|
||||||
|
AND mm.BATCH_STATUS = 6
|
||||||
|
AND DATEDIFF(NOW(), ps.start_date) > 180
|
||||||
|
GROUP BY
|
||||||
|
mt.ID,
|
||||||
|
mt2.ID,
|
||||||
|
wla.ID,
|
||||||
|
bp.ID,
|
||||||
|
bc.ID
|
||||||
|
) AS t
|
||||||
UNION
|
UNION
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue