修改 总装

master
wangh 4 years ago
parent f4461e3809
commit c0c8fc6a8c

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

@ -78,4 +78,5 @@ public interface IBroadDataService {
List<MTKBeen> mtk_sselectQATop3(); 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 @Override
public List<BoxOutput> zz_selectProductInByTeam() { public List<BoxOutput> zz_selectProductInByTeam() {
return mapper.zz_selectProductInByTeam(); return mapper.zz_selectProductInByTeam();

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