|
|
|
|
@ -26,30 +26,76 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectStock" resultType="com.ruoyi.system.domain.BoxStock">
|
|
|
|
|
select substr(MATERIAL_NAME, instr(MATERIAL_NAME, ',', 1, 1) +
|
|
|
|
|
1,instr(MATERIAL_NAME, ',', 1, 2) - 1 - instr(MATERIAL_NAME, ',', 1, 1)) as
|
|
|
|
|
order_type
|
|
|
|
|
, Sum(Store_Qty) as stock
|
|
|
|
|
, ls.STORE_DESC
|
|
|
|
|
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
|
|
|
|
|
from IMOS_LO_STORE_DETIAL losd
|
|
|
|
|
left join IMOS_LO_STORE ls on ls.STORE_CODE = losd.STORE_CODE
|
|
|
|
|
|
|
|
|
|
where ls.Store_Code =#{id}
|
|
|
|
|
where Store_Code =#{id}
|
|
|
|
|
and Material_Code is not null
|
|
|
|
|
and Store_Qty > 0
|
|
|
|
|
group by material_name, ls.STORE_DESC
|
|
|
|
|
and Store_Qty > 0
|
|
|
|
|
group by material_name, Store_Code
|
|
|
|
|
order by material_name
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectOutputByType" resultType="com.ruoyi.system.domain.BoxOutputByType">
|
|
|
|
|
|
|
|
|
|
select substr(MATERIAL_NAME, instr(MATERIAL_NAME, ',', 1, 1) + 1,
|
|
|
|
|
instr(MATERIAL_NAME, ',', 1, 2) - 1 - instr(MATERIAL_NAME, ',', 1, 1)) as plan_type,
|
|
|
|
|
|
|
|
|
|
SUM(ACTUAL_QTY) as actual_production
|
|
|
|
|
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 plan_type,
|
|
|
|
|
SUM(ACTUAL_QTY) as actual_production
|
|
|
|
|
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
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
</mapper>
|