You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
5.3 KiB
XML

4 years ago
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.BroadDataMapper">
<resultMap type="com.ruoyi.system.domain.BoxPlanCompletion" id="selectplanCompletion">
<result property="plan_shift" column="config_name" />
<result property="planned_number" column="planned_number" />
<result property="quantity_number" column="config_value" />
</resultMap>
<select id="selectplanCompletion" resultType="com.ruoyi.system.domain.BoxPlanCompletion">
select nvl(sum(PLAN_QTY), 0) planned_number,
nvl(sum(actual_qty), 0) quantity_number,
plan_shift
from IMOS_PR_PLAN
where plan_date is not null
and process_code = '1002'
and detial_type_code = '1002'
and delete_flag = '0'
and to_char(plan_date, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
group by to_char(plan_date, 'yyyy-MM-dd'), PLAN_SHIFT
</select>
<select id="selectStock" resultType="com.ruoyi.system.domain.BoxStock">
select material_name
, substr(MATERIAL_NAME,
case
when instr(MATERIAL_NAME, '/', 1, 1) = 0 then instr(MATERIAL_NAME, ',', 1, 1) + 1
else instr(MATERIAL_NAME, '/', 1, 1) + 1
end,
case
when instr(MATERIAL_NAME, ',', 1, 2) = 0 then Length(MATERIAL_NAME)+1
else instr(MATERIAL_NAME, ',', 1, 2)
end
-
case
when instr(MATERIAL_NAME, '/', 1, 1) = 0 then instr(MATERIAL_NAME, ',', 1, 1) + 1
else instr(MATERIAL_NAME, '/', 1, 1) + 1
end) as order_type
, Sum(Store_Qty) as stock
, Store_Code
4 years ago
from IMOS_LO_STORE_DETIAL losd
where Store_Code =#{id}
4 years ago
and Material_Code is not null
and Store_Qty &gt; 0
group by material_name, Store_Code
4 years ago
order by material_name
</select>
<select id="selectOutputByType" resultType="com.ruoyi.system.domain.BoxOutput">
select substr(MATERIAL_NAME,
case
when instr(MATERIAL_NAME, '/', 1, 1) = 0 then instr(MATERIAL_NAME, ',', 1, 1) + 1
else instr(MATERIAL_NAME, '/', 1, 1) + 1
end,
case
when instr(MATERIAL_NAME, ',', 1, 2) = 0 then Length(MATERIAL_NAME) + 1
else instr(MATERIAL_NAME, ',', 1, 2)
end
-
case
when instr(MATERIAL_NAME, '/', 1, 1) = 0 then instr(MATERIAL_NAME, ',', 1, 1) + 1
else instr(MATERIAL_NAME, '/', 1, 1) + 1
end) as name,
SUM(ACTUAL_QTY) as qty
from IMOS_PR_PLAN
where to_char(plan_date, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
and PROCESS_CODE = 1002
group by MATERIAL_NAME
</select>
<resultMap type="com.ruoyi.system.domain.OrderInfo" id="OrderInfoResult">
<result property="orderType" column="order_type" />
<result property="materialType" column="material_type" />
<result property="plannedProduction" column="planned_production" />
<result property="actualProduction" column="actual_production" />
<result property="recordTime" column="record_Time" />
<result property="endTime" column="end_time" />
<result property="planDate" column="plan_date"/>
</resultMap>
<select id="getUHullPlanInfo" resultMap="OrderInfoResult">
select sysdate as end_Time,
case when instr(Material_Name, ',',instr(Material_Name, 'SC', 1, 1), 1)=0
then substr(Material_Name, instr(Material_Name, 'SC', 1, 1))
else substr(Material_Name, instr(Material_Name, 'SC', 1, 1),
instr(Material_Name, ',',instr(Material_Name, 'SC', 1, 1), 1)-instr(Material_Name, 'SC', 1, 1)) end as material_type,
PLAN_NO as order_type,
SUM(PLAN_QTY) as planned_production,
SUM(ACTUAL_QTY) as actual_production
from IMOS_PR_PLAN t
where process_code = '1002'
and detial_type_code = '1002'
and delete_flag = '0'
and to_char(plan_date, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
group by PLAN_NO, MATERIAL_NAME
</select>
<select id="selectOutputByTime" resultType="com.ruoyi.system.domain.BoxOutput">
select TO_CHAR(CREATION_DATE, 'hh24') as name ,Count(TASK_ID) as qty
from IMOS_LO_TASK_HISTORY
where detial_type_code = '1002' and TASK_TYPE='I'
and TO_CHAR(CREATION_DATE, 'YYYY-MM-DD') = TO_CHAR(SYSDATE, 'YYYY-MM-DD')
group by TO_CHAR(CREATION_DATE, 'hh24')
order by TO_CHAR(CREATION_DATE, 'hh24')
</select>
4 years ago
</mapper>