|
|
|
|
<?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 factory_code = '2701'
|
|
|
|
|
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 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
|
|
|
|
|
from IMOS_LO_STORE_DETIAL losd
|
|
|
|
|
left join IMOS_LO_STORE ls on ls.STORE_CODE = losd.STORE_CODE
|
|
|
|
|
|
|
|
|
|
where ls.Store_Code =#{id}
|
|
|
|
|
and Material_Code is not null
|
|
|
|
|
and Store_Qty > 0
|
|
|
|
|
group by material_name, ls.STORE_DESC
|
|
|
|
|
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
|
|
|
|
|
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>
|
|
|
|
|
</mapper>
|