Merge remote-tracking branch 'origin/master'

master
夜笙歌 3 years ago
commit 9f10769bf7

@ -21,11 +21,12 @@ public class BaseDtNeng extends BaseEntity
/** 年份 */
@Excel(name = "年份")
private Long yearName;
private String target;
/** 1月 */
@Excel(name = "1月")
private String month1;
/** 2月 */
@Excel(name = "2月")
private String month2;
@ -70,7 +71,15 @@ public class BaseDtNeng extends BaseEntity
@Excel(name = "12月")
private String month12;
public void setId(Long id)
public String getTarget() {
return target;
}
public void setTarget(String target) {
this.target = target;
}
public void setId(Long id)
{
this.id = id;
}

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="BaseDtNeng" id="BaseDtNengResult">
<result property="id" column="id" />
<result property="yearName" column="year_name" />
<result property="target" column="target" />
<result property="month1" column="month1" />
<result property="month2" column="month2" />
<result property="month3" column="month3" />
@ -22,11 +23,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectBaseDtNengVo">
select id, year_name, month1, month2, month3, month4, month5, month6, month7, month8, month9, month10, month11, month12 from base_dt_neng
select id, year_name, month1, month2, month3, month4, month5,
month6, month7, month8, month9, month10, month11, month12,target from base_dt_neng
</sql>
<select id="selectBaseDtNengList1" parameterType="BaseDtNeng" resultMap="BaseDtNengResult">
select id, year_name, month1, month2, month3, month4, month5, month6, month7, month8, month9, month10, month11, month12 from base_dt_neng
select target,year_name, month1, month2, month3, month4, month5, month6,
month7, month8, month9, month10, month11, month12 from base_dt_neng
where year_name=to_number(to_char(sysdate,'yyyy'))
</select>
<select id="selectBaseDtNengList" parameterType="BaseDtNeng" resultMap="BaseDtNengResult">

@ -110,6 +110,154 @@
group by TO_CHAR(CREATION_DATE, 'hh24')
</select>
<select id="selectOutputByTime1" resultType="com.ruoyi.system.domain.BoxOutput">
select name, qty
from (
select '19:30' as name, sum(QTY3) as qty,1 as ord
from IMOS.BASE_BOX_OUTPUT_RECORD 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 ippb.CREATE_TIME &gt;= day1 and ippb.CREATE_TIME &lt; day2
union
select '20:30' as name, sum(QTY3) as qty, 2 as ord
from IMOS.BASE_BOX_OUTPUT_RECORD 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 ippb.CREATE_TIME &gt;
= day1 and ippb.CREATE_TIME &lt;
day2
union
select '21:30' as name, sum(QTY3) as qty, 3 as ord
from IMOS.BASE_BOX_OUTPUT_RECORD 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 ippb.CREATE_TIME &gt;
= day1 and ippb.CREATE_TIME &lt;
day2
union
select '22:30' as name, sum(QTY3) as qty, 4 as ord
from IMOS.BASE_BOX_OUTPUT_RECORD 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 ippb.CREATE_TIME &gt;
= day1 and ippb.CREATE_TIME &lt;
day2
union
select '23:30' as name, sum(QTY3) as qty, 5 as ord
from IMOS.BASE_BOX_OUTPUT_RECORD 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 ippb.CREATE_TIME &gt;
= day1 and ippb.CREATE_TIME &lt;
day2
union
select '00:30' as name, sum(QTY3) as qty, 6 as ord
from IMOS.BASE_BOX_OUTPUT_RECORD 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 ippb.CREATE_TIME &gt;
= day1 and ippb.CREATE_TIME &lt;
day2
union
select '01:30' as name, sum(QTY3) as qty, 7 as ord
from IMOS.BASE_BOX_OUTPUT_RECORD 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 ippb.CREATE_TIME &gt;
= day1 and ippb.CREATE_TIME &lt;
day2
union
select '02:30' as name, sum(QTY3) as qty, 8 as ord
from IMOS.BASE_BOX_OUTPUT_RECORD 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 ippb.CREATE_TIME &gt;
= day1 and ippb.CREATE_TIME &lt;
day2
union
select '03:30' as name, sum(QTY3) as qty, 9 as ord
from IMOS.BASE_BOX_OUTPUT_RECORD 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 ippb.CREATE_TIME &gt;
= day1 and ippb.CREATE_TIME &lt;
day2
union
select '04:30' as name, sum(QTY3) as qty, 10 as ord
from IMOS.BASE_BOX_OUTPUT_RECORD 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 ippb.CREATE_TIME &gt;
= day1 and ippb.CREATE_TIME &lt;
day2
union
select '05:30' as name, sum(QTY3) as qty, 11 as ord
from IMOS.BASE_BOX_OUTPUT_RECORD 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 ippb.CREATE_TIME &gt;
= day1 and ippb.CREATE_TIME &lt;
day2
union
select '06:30' as name, sum(QTY3) as qty, 12 as ord
from IMOS.BASE_BOX_OUTPUT_RECORD 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 ippb.CREATE_TIME &gt;
= day1 and ippb.CREATE_TIME &lt;
day2
)
order by ord
</select>
<select id="selectOutputByTime" resultType="com.ruoyi.system.domain.BoxOutput">
select '07:30' as name, nvl(sum(QTY3),0) as qty
from IMOS.BASE_BOX_OUTPUT_RECORD

Loading…
Cancel
Save