Merge remote-tracking branch 'origin/master'

master
夜笙歌 4 years ago
commit d02940844c

@ -58,7 +58,7 @@ public class AllBroadHTMLController {
public String week() { public String week() {
return "broad/week"; return "broad/week";
} }
//5 //5 yue
@GetMapping("/month") @GetMapping("/month")
public String month() { public String month() {
return "broad/month"; return "broad/month";

@ -30,7 +30,7 @@ public class BoxBroadController {
@PostMapping("/planCompletion") @PostMapping("/planCompletion")
@ApiOperation("箱壳查询计划数量完成情况") @ApiOperation("箱壳查询计划数量完成情况")
public String selectplanCompletion() { public String selectplanCompletion() {
BoxPlanCompletion completion = service.selectplanCompletion("1002"); BoxPlanCompletion completion = service.selectplanCompletion();
return JSONObject.toJSONString(completion); return JSONObject.toJSONString(completion);
} }

@ -37,11 +37,17 @@ public class ZZJXBroadController {
private String selectProductInByTeam(@PathVariable("id") int id) { private String selectProductInByTeam(@PathVariable("id") int id) {
if (id == 0) { if (id == 0) {
int tag = service.zz_countNightProductIn();
if (tag > 0) {
return JSONArray.toJSONString(service.zz_selectProductInByTeamNight());
}
return JSONArray.toJSONString(service.zz_selectProductInByTeam()); return JSONArray.toJSONString(service.zz_selectProductInByTeam());
} else { } else {
return JSONArray.toJSONString(service.zz_selectProductInByDay()); return JSONArray.toJSONString(service.zz_selectProductInByDay());
} }
} }
@PostMapping("/selectProductInTarget") @PostMapping("/selectProductInTarget")
@ApiOperation("成品入库统计-目标") @ApiOperation("成品入库统计-目标")
private String selectProductInTarget() { private String selectProductInTarget() {
@ -51,38 +57,48 @@ public class ZZJXBroadController {
@PostMapping("/selectLossInfo") @PostMapping("/selectLossInfo")
@ApiOperation("查询Loss和分布") @ApiOperation("查询Loss和分布")
private String selectLossInfo() { private String selectLossInfo() {
return JSONArray.toJSONString(service.zz_selectLossInfo()); int tag = service.zz_countNightProductIn();
if (tag > 0) {
return JSONArray.toJSONString(service.zz_selectLossInfo(2));
} }
return JSONArray.toJSONString(service.zz_selectLossInfo(1));
}
@PostMapping("/selectOneBadRate/{id}") @PostMapping("/selectOneBadRate/{id}")
@ApiOperation("一次不合格率") @ApiOperation("一次不合格率")
private String selectOneBadRate(@PathVariable("id")int id){ private String selectOneBadRate(@PathVariable("id") int id) {
if (id==0){ if (id == 0) {
// ban // ban
return JSONArray.toJSONString(service.selectOneBadRate()); int tag = service.zz_countNightProductIn();
}else { if (tag > 0) {
return JSONArray.toJSONString(service.selectOneBadRate(2));
}
return JSONArray.toJSONString(service.selectOneBadRate(1));
} else {
// tian // tian
return JSONArray.toJSONString(service.selectOneBadRateByDay()); return JSONArray.toJSONString(service.selectOneBadRateByDay());
} }
} }
@PostMapping("/selectOneBadRateMb") @PostMapping("/selectOneBadRateMb")
@ApiOperation("一次不合格率目标") @ApiOperation("一次不合格率目标")
private String selectOneBadRateMb( ){ private String selectOneBadRateMb() {
return JSONArray.toJSONString(service.zz_selectOneBadRateMb()); return JSONArray.toJSONString(service.zz_selectOneBadRateMb());
} }
@PostMapping("/selectInStoreTag") @PostMapping("/selectInStoreTag")
@ApiOperation("入库节拍") @ApiOperation("入库节拍")
private String selectInStoreTag(){ private String selectInStoreTag() {
return JSONObject.toJSONString(BroadDruidServiceImpl.zz_selectInStoreTag()); return JSONObject.toJSONString(BroadDruidServiceImpl.zz_selectInStoreTag());
} }
@PostMapping("/selectInStoreOrderInfo") @PostMapping("/selectInStoreOrderInfo")
@ApiOperation("入库执行订单") @ApiOperation("入库执行订单")
private String selectInStoreOrderInfo(){ private String selectInStoreOrderInfo() {
return JSONObject.toJSONString(service.zz_selectInStoreOrderInfo()); return JSONObject.toJSONString(service.zz_selectInStoreOrderInfo());
} }
} }

@ -63,15 +63,16 @@ public interface BroadDataMapper {
// 6// zz_() // 6// zz_()
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
List<BoxOutput> zz_selectProductInByTeam(); List<BoxOutput> zz_selectProductInByTeam();
List<BoxOutput> zz_selectProductInByTeamNight();
List<BoxOutput> zz_selectProductInByDay(); List<BoxOutput> zz_selectProductInByDay();
List<BoxOutput> zz_selectLossInfo(); List<BoxOutput> zz_selectLossInfo(int state);
void insertTimp1(); void insertTimp1();
void deleteTimp1(); void deleteTimp1();
List<BoxOutput> selectOneBadRate(); List<BoxOutput> selectOneBadRate(int state);
List<BoxOutput> selectOneBadRateByDay(); List<BoxOutput> selectOneBadRateByDay();
@ -95,7 +96,7 @@ public interface BroadDataMapper {
List<MTKBeen> mtk_sselectQATop3(); List<MTKBeen> mtk_sselectQATop3();
List<BoxOutput> mtk_selectQAZD(); List<BoxOutput> mtk_selectQAZD();
int zz_countNightProductIn();
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// 周看板 // 周看板
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
@ -108,4 +109,6 @@ public interface BroadDataMapper {
List<BoxOutput> zhou_selectOrderRateTatle(); List<BoxOutput> zhou_selectOrderRateTatle();
List<BoxOutput> yue_selectProductInStore(); List<BoxOutput> yue_selectProductInStore();
} }

@ -11,7 +11,7 @@ import java.util.List;
public interface IBroadDataService { public interface IBroadDataService {
BoxPlanCompletion selectplanCompletion(String gxid); BoxPlanCompletion selectplanCompletion();
List<BoxStock> selectStock(String id); List<BoxStock> selectStock(String id);
@ -52,11 +52,12 @@ public interface IBroadDataService {
List<BoxOutput> mtk_selectInStore3d(); List<BoxOutput> mtk_selectInStore3d();
List<BoxOutput> zz_selectProductInByTeam(); List<BoxOutput> zz_selectProductInByTeam();
List<BoxOutput> zz_selectProductInByTeamNight();
List<BoxOutput> zz_selectProductInByDay(); List<BoxOutput> zz_selectProductInByDay();
List<BoxOutput> selectOneBadRate(); List<BoxOutput> selectOneBadRate(int state);
List<BoxOutput> selectOneBadRateByDay(); List<BoxOutput> selectOneBadRateByDay();
@ -78,7 +79,7 @@ public interface IBroadDataService {
List<MTKBeen> mtk_sselectQATop3(); List<MTKBeen> mtk_sselectQATop3();
List<BoxOutput> zz_selectLossInfo(); List<BoxOutput> zz_selectLossInfo(int state);
List<BoxOutput> mtk_selectQAZD(); List<BoxOutput> mtk_selectQAZD();
@ -89,4 +90,6 @@ public interface IBroadDataService {
List<BoxOutput> zhou_selectOrderRateTatle(); List<BoxOutput> zhou_selectOrderRateTatle();
List<BoxOutput> yue_selectProductInStore(); List<BoxOutput> yue_selectProductInStore();
int zz_countNightProductIn();
} }

@ -24,7 +24,7 @@ public class BroadDataServiceImpl implements IBroadDataService
@Override @Override
public BoxPlanCompletion selectplanCompletion(String gxid) { public BoxPlanCompletion selectplanCompletion() {
return mapper.selectplanCompletion(); return mapper.selectplanCompletion();
} }
@ -148,14 +148,23 @@ public class BroadDataServiceImpl implements IBroadDataService
@Override @Override
public List<BoxOutput> zz_selectLossInfo() { public int zz_countNightProductIn() {
return mapper.zz_selectLossInfo(); return mapper.zz_countNightProductIn();
}
@Override
public List<BoxOutput> zz_selectLossInfo(int state) {
return mapper.zz_selectLossInfo( state);
} }
@Override @Override
public List<BoxOutput> zz_selectProductInByTeam() { public List<BoxOutput> zz_selectProductInByTeam() {
return mapper.zz_selectProductInByTeam(); return mapper.zz_selectProductInByTeam();
} }
@Override
public List<BoxOutput> zz_selectProductInByTeamNight() {
return mapper.zz_selectProductInByTeamNight();
}
@Override @Override
public List<BoxOutput> zz_selectProductInByDay() { public List<BoxOutput> zz_selectProductInByDay() {
@ -163,8 +172,8 @@ public class BroadDataServiceImpl implements IBroadDataService
} }
@Override @Override
public List<BoxOutput> selectOneBadRate() { public List<BoxOutput> selectOneBadRate(int state) {
return mapper.selectOneBadRate(); return mapper.selectOneBadRate(state);
} }
@Override @Override

@ -40,9 +40,9 @@ public class BroadDruidServiceImpl implements IBroadDruidService {
@Override @Override
public List<BoxOutput> zz_selectLossInfo() { public List<BoxOutput> zz_selectLossInfo() {
mapper.deleteTimp1(); // mapper.deleteTimp1();
mapper.insertTimp1(); // mapper.insertTimp1();
return mapper.zz_selectLossInfo(); return mapper.zz_selectLossInfo(1);
} }
@Override @Override

@ -13,16 +13,9 @@
<select id="selectplanCompletion" resultType="com.ruoyi.system.domain.BoxPlanCompletion"> <select id="selectplanCompletion" resultType="com.ruoyi.system.domain.BoxPlanCompletion">
select select
-- (SELECT * ( select sum(PLAN_QTY) qty
-- FROM (select PLAN_NUMBER from imos_ta_material
-- from haiwei.BASE_BOX_PLAN where DISPLAY_FLAG = 1) AS planned_number,
-- where rownum = 1
-- ORDER BY CREATE_TIME DESC)) AS planned_number,
(SELECT *
FROM (select PLAN_NUMBER
from haiwei.BASE_BOX_PLAN
where rownum = 1
ORDER BY CREATE_TIME DESC)) AS planned_number,
nvl(sum(actual_qty), 0) AS quantity_number nvl(sum(actual_qty), 0) AS quantity_number
from IMOS_PR_PLAN from IMOS_PR_PLAN
@ -540,7 +533,7 @@ where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
<select id="zz_selectLossInfo" resultType="com.ruoyi.system.domain.BoxOutput"> <select id="zz_selectLossInfo" resultType="com.ruoyi.system.domain.BoxOutput">
select ROUND(sum(ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM) / 60, 2)- select ROUND(sum(ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM) / 60, 2)-
-nvl(case nvl(case
when sysdate &gt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss') when sysdate &gt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
then then
case case
@ -556,8 +549,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb where ROWNUM = 1) wb
on 1 = 1 on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end where ippb.PRODUCTION_DATE between
and case when sysdate &lt; = wb.W_END then W_END else B_END end case
when #{state} = 1 then W_START
when #{state} = 2 then W_END end
and
case
when #{state} = 1 then W_END
when #{state} = 2 then B_END end
and DETIAL_TYPE_CODE = '1004') t1 and DETIAL_TYPE_CODE = '1004') t1
left join left join
(select row_number() over (order by PRODUCTION_DATE) as row_number, (select row_number() over (order by PRODUCTION_DATE) as row_number,
@ -567,8 +566,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb where ROWNUM = 1) wb
on 1 = 1 on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end where ippb.PRODUCTION_DATE between
and case when sysdate &lt; = wb.W_END then W_END else B_END end case
when #{state} = 1 then W_START
when #{state} = 2 then W_END end
and
case
when #{state} = 1 then W_END
when #{state} = 2 then B_END end
and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1 and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1
left join left join
(select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3 on 1 = 1 (select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3 on 1 = 1
@ -587,8 +592,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb where ROWNUM = 1) wb
on 1 = 1 on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end where ippb.PRODUCTION_DATE between
and case when sysdate &lt; = wb.W_END then W_END else B_END end case
when #{state} = 1 then W_START
when #{state} = 2 then W_END end
and
case
when #{state} = 1 then W_END
when #{state} = 2 then B_END end
and DETIAL_TYPE_CODE = '1004') t1 and DETIAL_TYPE_CODE = '1004') t1
left join left join
(select row_number() over (order by PRODUCTION_DATE) as row_number, (select row_number() over (order by PRODUCTION_DATE) as row_number,
@ -598,8 +609,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb where ROWNUM = 1) wb
on 1 = 1 on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end where ippb.PRODUCTION_DATE between
and case when sysdate &lt; = wb.W_END then W_END else B_END end case
when #{state} = 1 then W_START
when #{state} = 2 then W_END end
and
case
when #{state} = 1 then W_END
when #{state} = 2 then B_END end
and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1 and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1
left join left join
(select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3 on 1 = 1 (select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3 on 1 = 1
@ -616,8 +633,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb where ROWNUM = 1) wb
on 1 = 1 on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end where ippb.PRODUCTION_DATE between
and case when sysdate &lt; = wb.W_END then W_END else B_END end case
when #{state} = 1 then W_START
when #{state} = 2 then W_END end
and
case
when #{state} = 1 then W_END
when #{state} = 2 then B_END end
and DETIAL_TYPE_CODE = '1004') t1 and DETIAL_TYPE_CODE = '1004') t1
left join left join
(select row_number() over (order by PRODUCTION_DATE) as row_number, (select row_number() over (order by PRODUCTION_DATE) as row_number,
@ -627,8 +650,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb where ROWNUM = 1) wb
on 1 = 1 on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end where ippb.PRODUCTION_DATE between
and case when sysdate &lt; = wb.W_END then W_END else B_END end case
when #{state} = 1 then W_START
when #{state} = 2 then W_END end
and
case
when #{state} = 1 then W_END
when #{state} = 2 then B_END end
and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1 and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1
left join left join
(select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3 on 1 = 1 (select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3 on 1 = 1
@ -638,6 +667,10 @@ where 180 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
union union
select
case when qty &lt; 0 then 0 else qty end as qty,name
from
(
select count(1)-nvl(case 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') when sysdate &gt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
then then
@ -654,8 +687,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb where ROWNUM = 1) wb
on 1 = 1 on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end where ippb.PRODUCTION_DATE between
and case when sysdate &lt; = wb.W_END then W_END else B_END end case
when #{state} = 1 then W_START
when #{state} = 2 then W_END end
and
case
when #{state} = 1 then W_END
when #{state} = 2 then B_END end
and DETIAL_TYPE_CODE = '1004') t1 and DETIAL_TYPE_CODE = '1004') t1
left join left join
(select row_number() over (order by PRODUCTION_DATE) as row_number, (select row_number() over (order by PRODUCTION_DATE) as row_number,
@ -665,13 +704,20 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb where ROWNUM = 1) wb
on 1 = 1 on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end where ippb.PRODUCTION_DATE between
and case when sysdate &lt; = wb.W_END then W_END else B_END end case
when #{state} = 1 then W_START
when #{state} = 2 then W_END end
and
case
when #{state} = 1 then W_END
when #{state} = 2 then B_END end
and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1 and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1
left join left join
(select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3 on 1 = 1 (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 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">
@ -770,76 +816,218 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
group by to_char(PRODUCTION_DATE, 'hh24') group by to_char(PRODUCTION_DATE, 'hh24')
order by to_char(PRODUCTION_DATE, 'hh24') order by to_char(PRODUCTION_DATE, 'hh24')
</select> </select>
<select id="zz_selectProductInByTeamNight" resultType="com.ruoyi.system.domain.BoxOutput">
select name,qty
from (
select '19:30' as name, nvl(count(1), 0) as qty,1 as ord
from IMOS_PR_PRODUCT_BARCODE ippb
left join (
select W_END as day1, W_END + interval '1' HOUR as day2
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
where qt = 1
) t1 on 1 = 1
where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between day1 and day2
union
select '20:30' as name, nvl(count(1), 0) as qty,2 as ord
from IMOS_PR_PRODUCT_BARCODE ippb
left join (
-- 2022-07-28 20:30:00
select W_END + interval '1' HOUR as day1, W_END + interval '2' HOUR as day2
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
where qt = 1
) t1 on 1 = 1
where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between day1 and day2
union
select '21:30' as name, nvl(count(1), 0) as qty,3 as ord
from IMOS_PR_PRODUCT_BARCODE ippb
left join (
-- 2022-07-28 21:30:00
select W_END + interval '2' HOUR as day1, W_END + interval '3' HOUR as day2
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
where qt = 1
) t1 on 1 = 1
where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between day1 and day2
union
select '22:30' as name, nvl(count(1), 0) as qty,4 as ord
from IMOS_PR_PRODUCT_BARCODE ippb
left join (
-- 2022-07-28 22:30:00
select W_END + interval '3' HOUR as day1, W_END + interval '4' HOUR as day2
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
where qt = 1
) t1 on 1 = 1
where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between day1 and day2
union
select '23:30' as name, nvl(count(1), 0) as qty,5 as ord
from IMOS_PR_PRODUCT_BARCODE ippb
left join (
-- 2022-07-28 23:30:00
select W_END + interval '4' HOUR as day1, W_END + interval '5' HOUR as day2
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
where qt = 1
) t1 on 1 = 1
where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between day1 and day2
union
select '00:30' as name, nvl(count(1), 0) as qty,6 as ord
from IMOS_PR_PRODUCT_BARCODE ippb
left join (
-- 2022-07-29 00:30:00
select W_END + interval '5' HOUR as day1, W_END + interval '6' HOUR as day2
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
where qt = 1
) t1 on 1 = 1
where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between day1 and day2
union
select '01:30' as name, nvl(count(1), 0) as qty,7 as ord
from IMOS_PR_PRODUCT_BARCODE ippb
left join (
-- 2022-07-29 01:30:00
select W_END + interval '6' HOUR as day1, W_END + interval '7' HOUR as day2
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
where qt = 1
) t1 on 1 = 1
where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between day1 and day2
union
select '02:30' as name, nvl(count(1), 0) as qty,8 as ord
from IMOS_PR_PRODUCT_BARCODE ippb
left join (
select W_END + interval '7' HOUR as day1, W_END + interval '8' HOUR as day2
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
where qt = 1
) t1 on 1 = 1
where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between day1 and day2
union
select '03:30' as name, nvl(count(1), 0) as qty,9 as ord
from IMOS_PR_PRODUCT_BARCODE ippb
left join (
select W_END + interval '8' HOUR as day1, W_END + interval '9' HOUR as day2
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
where qt = 1
) t1 on 1 = 1
where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between day1 and day2
union
select '04:30' as name, nvl(count(1), 0) as qty,10 as ord
from IMOS_PR_PRODUCT_BARCODE ippb
left join (
select W_END + interval '9' HOUR as day1, W_END + interval '10' HOUR as day2
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
where qt = 1
) t1 on 1 = 1
where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between day1 and day2
union
select '05:30' as name, nvl(count(1), 0) as qty,11 as ord
from IMOS_PR_PRODUCT_BARCODE ippb
left join (
select W_END + interval '10' HOUR as day1, W_END + interval '11' HOUR as day2
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
where qt = 1
) t1 on 1 = 1
where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between day1 and day2
union
select '06:30' as name, nvl(count(1), 0) as qty,12 as ord
from IMOS_PR_PRODUCT_BARCODE ippb
left join (
select W_END + interval '11' HOUR as day1, W_END + interval '12' HOUR as day2
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
where qt = 1
) t1 on 1 = 1
where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between day1 and day2
)
order by ord
</select>
<select id="zz_selectProductInByTeam" resultType="com.ruoyi.system.domain.BoxOutput"> <select id="zz_selectProductInByTeam" resultType="com.ruoyi.system.domain.BoxOutput">
select '07:30' as name, nvl(count(1),0) as qty select '07:30' as name, nvl(count(1),0) as qty
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
where DETIAL_TYPE_CODE = '1004' where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', 'yyyy-MM-dd hh24:mi:ss') and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', 'yyyy-MM-dd hh24:mi:ss')
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '08:30:00', 'yyyy-MM-dd hh24:mi:ss') and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '08:30:00', 'yyyy-MM-dd hh24:mi:ss')
union union
select '08:30' as name, nvl(count(1),0) as qty select '08:30' as name, nvl(count(1),0) as qty
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
where DETIAL_TYPE_CODE = '1004' where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '08:30:00', 'yyyy-MM-dd hh24:mi:ss') and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '08:30:00', 'yyyy-MM-dd hh24:mi:ss')
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss') and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
union union
select '09:30' as name, nvl(count(1),0) as qty select '09:30' as name, nvl(count(1),0) as qty
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
where DETIAL_TYPE_CODE = '1004' where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss') and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '10:30:00', 'yyyy-MM-dd hh24:mi:ss') and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '10:30:00', 'yyyy-MM-dd hh24:mi:ss')
union union
select '10:30' as name, nvl(count(1),0) as qty select '10:30' as name, nvl(count(1),0) as qty
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
where DETIAL_TYPE_CODE = '1004' where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '10:30:00', 'yyyy-MM-dd hh24:mi:ss') and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '10:30:00', 'yyyy-MM-dd hh24:mi:ss')
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '11:30:00', 'yyyy-MM-dd hh24:mi:ss') and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '11:30:00', 'yyyy-MM-dd hh24:mi:ss')
union union
select '11:30' as name, nvl(count(1),0) as qty select '11:30' as name, nvl(count(1),0) as qty
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
where DETIAL_TYPE_CODE = '1004' where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '11:30:00', 'yyyy-MM-dd hh24:mi:ss') and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '11:30:00', 'yyyy-MM-dd hh24:mi:ss')
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '12:30:00', 'yyyy-MM-dd hh24:mi:ss') and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '12:30:00', 'yyyy-MM-dd hh24:mi:ss')
union union
select '12:30' as name, nvl(count(1),0) as qty select '12:30' as name, nvl(count(1),0) as qty
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
where DETIAL_TYPE_CODE = '1004' where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '12:30:00', 'yyyy-MM-dd hh24:mi:ss') and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '12:30:00', 'yyyy-MM-dd hh24:mi:ss')
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '13:30:00', 'yyyy-MM-dd hh24:mi:ss') and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '13:30:00', 'yyyy-MM-dd hh24:mi:ss')
union union
select '13:30' as name, nvl(count(1),0) as qty select '13:30' as name, nvl(count(1),0) as qty
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
where DETIAL_TYPE_CODE = '1004' where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '13:30:00', 'yyyy-MM-dd hh24:mi:ss') and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '13:30:00', 'yyyy-MM-dd hh24:mi:ss')
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss') and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss')
union union
select '14:30' as name, nvl(count(1),0) as qty select '14:30' as name, nvl(count(1),0) as qty
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
where DETIAL_TYPE_CODE = '1004' where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss') and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss')
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '15:30:00', 'yyyy-MM-dd hh24:mi:ss') and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '15:30:00', 'yyyy-MM-dd hh24:mi:ss')
union union
select '15:30' as name, nvl(count(1),0) as qty select '15:30' as name, nvl(count(1),0) as qty
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
where DETIAL_TYPE_CODE = '1004' where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '15:30:00', 'yyyy-MM-dd hh24:mi:ss') and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '15:30:00', 'yyyy-MM-dd hh24:mi:ss')
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '16:30:00', 'yyyy-MM-dd hh24:mi:ss') and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '16:30:00', 'yyyy-MM-dd hh24:mi:ss')
union union
select '16:30' as name, nvl(count(1),0) as qty select '16:30' as name, nvl(count(1),0) as qty
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
where DETIAL_TYPE_CODE = '1004' where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '16:30:00', 'yyyy-MM-dd hh24:mi:ss') and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '16:30:00', 'yyyy-MM-dd hh24:mi:ss')
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '17:30:00', 'yyyy-MM-dd hh24:mi:ss') and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '17:30:00', 'yyyy-MM-dd hh24:mi:ss')
union union
select '17:30' as name, nvl(count(1),0) as qty select '17:30' as name, nvl(count(1),0) as qty
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
where DETIAL_TYPE_CODE = '1004' where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '17:30:00', 'yyyy-MM-dd hh24:mi:ss') and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '17:30:00', 'yyyy-MM-dd hh24:mi:ss')
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '18:30:00', 'yyyy-MM-dd hh24:mi:ss') and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '18:30:00', 'yyyy-MM-dd hh24:mi:ss')
union union
select '18:30' as name, nvl(count(1),0) as qty select '18:30' as name, nvl(count(1),0) as qty
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
where DETIAL_TYPE_CODE = '1004' where DETIAL_TYPE_CODE = '1004'
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '18:30:00', 'yyyy-MM-dd hh24:mi:ss') and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '18:30:00', 'yyyy-MM-dd hh24:mi:ss')
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss') and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss')
</select> </select>
@ -864,7 +1052,11 @@ where DETIAL_TYPE_CODE = '1004'
order by name order by name
</select> </select>
<select id="selectOneBadRate" resultType="com.ruoyi.system.domain.BoxOutput"> <select id="selectOneBadRate" resultType="com.ruoyi.system.domain.BoxOutput">
select nvl(qty1,0) as qty, select sum(qty) as qty,
name,
sum (rate) as rate
from
(select nvl(qty1,0) as qty,
name, name,
nvl(round((qty1/a.qty)*100,2),0) as rate nvl(round((qty1/a.qty)*100,2),0) as rate
from ( from (
@ -872,8 +1064,17 @@ where DETIAL_TYPE_CODE = '1004'
from IMOS_PR_PRODUCT_BARCODE ippb from IMOS_PR_PRODUCT_BARCODE ippb
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb
on 1 = 1 on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt; = wb.W_END then W_START else W_END end where ippb.PRODUCTION_DATE between
and case when sysdate &lt; = wb.W_END then W_END else B_END end case
when #{state} = 1 then W_START
when #{state} = 2 then W_END
end
and
case
when #{state} = 1 then W_END
when #{state} = 2 then B_END
end
and DETIAL_TYPE_CODE = '1004' and DETIAL_TYPE_CODE = '1004'
group by to_char(PRODUCTION_DATE, 'hh24') group by to_char(PRODUCTION_DATE, 'hh24')
order by to_char(PRODUCTION_DATE, 'hh24') order by to_char(PRODUCTION_DATE, 'hh24')
@ -883,6 +1084,13 @@ where DETIAL_TYPE_CODE = '1004'
where ITEM_CODE = '1006' where ITEM_CODE = '1006'
and to_char(CREATION_DATE, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd') and to_char(CREATION_DATE, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
group by to_char(CREATION_DATE, 'hh24')) on name=name1 group by to_char(CREATION_DATE, 'hh24')) on name=name1
union
select 0 as qty ,case
when #{state} = 1 then '07:30'
when #{state} = 2 then '19:30'
end as name ,0 as rate from dual
)
group by name
order by name order by name
</select> </select>
@ -1053,7 +1261,16 @@ where DETIAL_TYPE_CODE = '1004'
<select id="zz_selectOneBadRateMb" resultType="com.ruoyi.system.domain.BoxOutput"> <select id="zz_selectOneBadRateMb" resultType="com.ruoyi.system.domain.BoxOutput">
select * from (select rate,'不合格率目标' from haiwei.BASE_ONE_UNQUQLIFIED_RATE order by CREATE_TIME desc) where ROWNUM=1 select * from (select rate,'不合格率目标' from haiwei.BASE_ONE_UNQUQLIFIED_RATE order by CREATE_TIME desc) where ROWNUM=1
</select> </select>
<select id="zz_countNightProductIn" resultType="integer">
select count(1)
from IMOS.IMOS_PR_PRODUCT_BARCODE
where PRODUCTION_DATE &gt; (
select W_END + interval '5' MINUTE
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc )
where ROWNUM = 1
)
and ROWNUM &lt; 10
</select>
<select id="mtk_selectQAZD" resultType="com.ruoyi.system.domain.BoxOutput"> <select id="mtk_selectQAZD" resultType="com.ruoyi.system.domain.BoxOutput">
select round((CASE select round((CASE
WHEN Sum_Value = 0 THEN 0.00 WHEN Sum_Value = 0 THEN 0.00
@ -1095,7 +1312,7 @@ where DETIAL_TYPE_CODE = '1004'
<resultMap id="MTKBeen" type="com.ruoyi.system.domain.MTKBeen"> <resultMap id="MTKBeen" type="com.ruoyi.system.domain.MTKBeen">
<result column="code" property="code"/> <result column="code" property="code"/>
<collection property="list" javaType="java.util.List" resultMap="BoxOutputBeen" /> <collection property="list" javaType="java.util.List" resultMap="BoxOutputBeen"/>
</resultMap> </resultMap>
<resultMap id="BoxOutputBeen" type="com.ruoyi.system.domain.BoxOutput"> <resultMap id="BoxOutputBeen" type="com.ruoyi.system.domain.BoxOutput">
<result column="name" property="name"/> <result column="name" property="name"/>

Loading…
Cancel
Save