修改 总装

master
wangh 4 years ago
parent f4461e3809
commit c0c8fc6a8c

@ -51,7 +51,7 @@ public class ZZJXBroadController {
@PostMapping("/selectLossInfo")
@ApiOperation("查询Loss和分布")
private String selectLossInfo() {
return JSONArray.toJSONString(BroadDruidServiceImpl.zz_selectLossInfo());
return JSONArray.toJSONString(service.zz_selectLossInfo());
}
@PostMapping("/selectOneBadRate/{id}")
@ApiOperation("一次不合格率")

@ -78,4 +78,5 @@ public interface IBroadDataService {
List<MTKBeen> mtk_sselectQATop3();
List<BoxOutput> zz_selectLossInfo();
}

@ -147,6 +147,11 @@ public class BroadDataServiceImpl implements IBroadDataService
///////////////////////////////////////////////////////////////////////////
@Override
public List<BoxOutput> zz_selectLossInfo() {
return mapper.zz_selectLossInfo();
}
@Override
public List<BoxOutput> zz_selectProductInByTeam() {
return mapper.zz_selectProductInByTeam();

@ -408,7 +408,7 @@ FROM (select PLAN_NUMBER
order by to_number(STATION_NO)
</select>
<insert id="deleteTimp1">
delete from haiwei.temp1
TRUNCATE TABLE temp1
</insert>
<insert id="insertTimp1">
insert into haiwei.temp1 (
@ -424,45 +424,141 @@ FROM (select PLAN_NUMBER
</insert>
<select id="zz_selectLossInfo" resultType="com.ruoyi.system.domain.BoxOutput">
select case
when sysdate > to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '10:30:00', 'yyyy-MM-dd hh24:mi:ss')
select ROUND(sum(ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM) / 60, 2)-
-nvl(case
when sysdate &gt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
then
case
when sysdate > to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '15:30:00', 'yyyy-MM-dd hh24:mi:ss')
then qty - 60
else qty - 30 end
end as qty ,name
from (
select ROUND(sum(ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy) / 60, 2) as qty, 1 as name
from temp1 t1
left join TEMP1 t2 on t1.row_numbre = t2.row_numbre + 1
where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy &gt; 0)
union
select count(1) as qty, 2 as name
from temp1 t1
left join TEMP1 t2 on t1.row_numbre = t2.row_numbre + 2
where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy &gt; 0
and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy &lt;= 180
union
select count(1) as qty, 3 as name
from temp1 t1
left join TEMP1 t2 on t1.row_numbre = t2.row_numbre + 2
where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy &gt; 180
and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy &lt;= 600
union
select nvl(case
when sysdate > to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
then
case
when sysdate > to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss')
then qty - 2
else qty - 1 end
end,0) as qty,name
from (
select nvl(count(1),0) as qty, 4 as name
from temp1 t1
left join TEMP1 t2 on t1.row_numbre = t2.row_numbre + 2
where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy &gt; 600)
case
when sysdate &gt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss')
then 60 else 30 end
end
, 0) as qty,
1 as name
from (select row_number() over (order by PRODUCTION_DATE) as row_number,
PRODUCTION_DATE as day
from IMOS.IMOS_PR_PRODUCT_BARCODE ippb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end
and case when sysdate &lt; = wb.W_END then W_END else B_END end
and DETIAL_TYPE_CODE = '1004') t1
left join
(select row_number() over (order by PRODUCTION_DATE) as row_number,
PRODUCTION_DATE as day
from IMOS.IMOS_PR_PRODUCT_BARCODE ippb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end
and case when sysdate &lt; = wb.W_END then W_END else B_END end
and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1
left join
(select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3 on 1 = 1
where 0 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
union
select count(1) as qty,
2 as name
from (select row_number() over (order by PRODUCTION_DATE) as row_number,
PRODUCTION_DATE as day
from IMOS.IMOS_PR_PRODUCT_BARCODE ippb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end
and case when sysdate &lt; = wb.W_END then W_END else B_END end
and DETIAL_TYPE_CODE = '1004') t1
left join
(select row_number() over (order by PRODUCTION_DATE) as row_number,
PRODUCTION_DATE as day
from IMOS.IMOS_PR_PRODUCT_BARCODE ippb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end
and case when sysdate &lt; = wb.W_END then W_END else B_END end
and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1
left join
(select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3 on 1 = 1
where 0 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM &lt; = 180
union
select count(1) as qty,
3 as name
from (select row_number() over (order by PRODUCTION_DATE) as row_number,
PRODUCTION_DATE as day
from IMOS.IMOS_PR_PRODUCT_BARCODE ippb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end
and case when sysdate &lt; = wb.W_END then W_END else B_END end
and DETIAL_TYPE_CODE = '1004') t1
left join
(select row_number() over (order by PRODUCTION_DATE) as row_number,
PRODUCTION_DATE as day
from IMOS.IMOS_PR_PRODUCT_BARCODE ippb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end
and case when sysdate &lt; = wb.W_END then W_END else B_END end
and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1
left join
(select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3 on 1 = 1
where 180 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM &lt; = 600
union
select count(1)-nvl(case
when sysdate &gt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
then
case
when sysdate &gt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss')
then 2 else 1 end
end
, 0) as qty,
4 as name
from (select row_number() over (order by PRODUCTION_DATE) as row_number,
PRODUCTION_DATE as day
from IMOS.IMOS_PR_PRODUCT_BARCODE ippb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end
and case when sysdate &lt; = wb.W_END then W_END else B_END end
and DETIAL_TYPE_CODE = '1004') t1
left join
(select row_number() over (order by PRODUCTION_DATE) as row_number,
PRODUCTION_DATE as day
from IMOS.IMOS_PR_PRODUCT_BARCODE ippb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end
and case when sysdate &lt; = wb.W_END then W_END else B_END end
and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1
left join
(select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3 on 1 = 1
where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
</select>
<select id="mtk_selectInStore3d" resultType="com.ruoyi.system.domain.BoxOutput">
@ -491,8 +587,8 @@ from (
select (
case when
TO_CHAR(SYSDATE, 'hh24')-1 &lt; 0
then '23' else TO_CHAR(SYSDATE, 'hh24')-1 end
|| ':30') as name,
then '23:30' else TO_CHAR(SYSDATE, 'hh24')-1 || ':30' end
) as name,
nvl(sum(actual_qty), 0) as qty
from IMOS.IMOS_PR_PLAN xhq
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb on 1 = 1

Loading…
Cancel
Save