| | |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="batchNumber" column="batch_number" /> |
| | | <result property="resourceGroupName" column="resource_group_name" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsPartRouteStatVo"> |
| | | select id, work_order_no, road_process_number, current_process_number, production_quantity, standard_time, process_total_time, process_plan_start_day, design_times, del_flag, create_by, batch_number from aps_part_route_stat |
| | | select id, work_order_no, road_process_number, current_process_number, production_quantity, standard_time, process_total_time, process_plan_start_day, design_times, del_flag, create_by, batch_number ,resource_group_name from aps_part_route_stat |
| | | </sql> |
| | | |
| | | <select id="selectApsPartRouteStatList" parameterType="ApsPartRouteStat" resultMap="ApsPartRouteStatResult"> |
| | |
| | | left join aps_resource_group as rs on rs.resource_group_name=rt.process_name |
| | | where pl.del_flag='0' and rt.del_flag='0' |
| | | /*零件计划状态为:非完工 */ |
| | | and ( pl.order_status!='' and ( pl.order_status!='3' or pl.order_status!='完工') ) |
| | | /*工艺路线的工序号>=零件计划的当前工序*/ |
| | | and cast( rt.process_number as decimal(18,2)) >= cast( pl.process_number as decimal(18,2)) |
| | | /*工序计划开工日 <= 资源组的截止日期*/ |
| | | and rt.process_plan_start_day<=rs.request_date |
| | | /*资源组需求截止日期<=当前日期+15天*/ |
| | | and rs.request_date<=(current_date + INTERVAL '15 day') |
| | | and ( pl.document_status is not null and ( pl.document_status!='3' or pl.order_status!='完工') ) |
| | | /*工序计划开工日 小于等于 资源组的截止日期*/ |
| | | and rt.process_plan_start_day <= rs.request_date |
| | | order by rt.work_order_no,process_plan_start_day |
| | | </select> |
| | | <select id="selectResourceDateStat" resultMap="com.aps.core.domain.ApsResourceDateStat"> |
| | | with pl as ( |
| | | select |
| | | DATE( st.process_plan_start_day) AS plan_day, |
| | | resource_group_name as resource_name, |
| | | sum(process_total_time) as require_times |
| | | from aps_part_route_stat as st |
| | | where st.del_flag='0' |
| | | group by resource_group_name, plan_day |
| | | ) |
| | | select pl.resource_name |
| | | ,pl.plan_day |
| | | ,require_times |
| | | ,(gp.theory_hours*gp.devices_quantity) as design_times |
| | | ,((gp.theory_hours*gp.devices_quantity) / require_times * 100) as capacity_load |
| | | from pl left join aps_resource_group as gp on pl.resource_group_name=gp.resource_group_name |
| | | where gp.del_flag='0' |
| | | </select> |
| | | |
| | | </mapper> |