|
|
|
@ -61,16 +61,44 @@
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectEquOrderList" parameterType="EquOrder" resultMap="EquOrderResult">
|
|
|
|
|
select eo.order_id, eo.plan_id, eo.plan_code, eo.plan_type, eo.order_code, eo.plan_workshop, eo.plan_prod_line,
|
|
|
|
|
eo.plan_loop,
|
|
|
|
|
eo.plan_loop_type,
|
|
|
|
|
eo.plan_loop_start, eo.plan_loop_end, eo.order_start, eo.order_end, eo.equipment_code, eo.order_status,
|
|
|
|
|
eo.order_cost, eo.plan_person, eo.order_cost_time, eo.order_sign_person,
|
|
|
|
|
eo.factory_code, eo.attr1, eo.attr2, eo.attr3, eo.del_flag, eo.create_by, eo.create_time,
|
|
|
|
|
eo.update_by,
|
|
|
|
|
eo.update_time,eo.upkeep,eo.calculation_rule,eo.shut_down,eo.order_inspect,eo.repair_code,eo.work_code,eo.outsource_code,
|
|
|
|
|
be.equipment_name,
|
|
|
|
|
ep.plan_name planName
|
|
|
|
|
select
|
|
|
|
|
eo.order_id,
|
|
|
|
|
eo.plan_id,
|
|
|
|
|
eo.plan_code,
|
|
|
|
|
eo.plan_type,
|
|
|
|
|
eo.order_code,
|
|
|
|
|
eo.plan_workshop,
|
|
|
|
|
eo.plan_prod_line,
|
|
|
|
|
eo.plan_loop,
|
|
|
|
|
eo.plan_loop_type,
|
|
|
|
|
eo.plan_loop_start,
|
|
|
|
|
eo.plan_loop_end,
|
|
|
|
|
eo.order_start,
|
|
|
|
|
eo.order_end,
|
|
|
|
|
eo.equipment_code,
|
|
|
|
|
eo.order_status,
|
|
|
|
|
eo.order_cost,
|
|
|
|
|
eo.plan_person,
|
|
|
|
|
eo.order_cost_time,
|
|
|
|
|
eo.order_sign_person,
|
|
|
|
|
eo.factory_code,
|
|
|
|
|
eo.attr1,
|
|
|
|
|
eo.attr2,
|
|
|
|
|
eo.attr3,
|
|
|
|
|
eo.del_flag,
|
|
|
|
|
eo.create_by,
|
|
|
|
|
eo.create_time,
|
|
|
|
|
eo.update_by,
|
|
|
|
|
eo.update_time,
|
|
|
|
|
eo.upkeep,
|
|
|
|
|
eo.calculation_rule,
|
|
|
|
|
eo.shut_down,
|
|
|
|
|
eo.order_inspect,
|
|
|
|
|
eo.repair_code,
|
|
|
|
|
eo.work_code,
|
|
|
|
|
eo.outsource_code,
|
|
|
|
|
be.equipment_name,
|
|
|
|
|
ep.plan_name planName
|
|
|
|
|
from equ_order eo
|
|
|
|
|
left join base_equipment be on be.equipment_code = eo.equipment_code
|
|
|
|
|
left join equ_plan ep on ep.plan_code = eo.plan_code
|
|
|
|
@ -83,23 +111,17 @@
|
|
|
|
|
<if test="planProdLine != null and planProdLine != ''">and eo.plan_prod_line = #{planProdLine}</if>
|
|
|
|
|
<if test="planLoop != null and planLoop != ''">and eo.plan_loop = #{planLoop}</if>
|
|
|
|
|
<if test="planLoopType != null and planLoopType != ''">and eo.plan_loop_type = #{planLoopType}</if>
|
|
|
|
|
<if test="equipmentCode != null and equipmentCode != ''">and eo.equipment_code like concat('%',
|
|
|
|
|
#{equipmentCode}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="equipmentName != null and equipmentName != ''">and be.equipment_name like concat('%',
|
|
|
|
|
#{equipmentName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="equipmentCode != null and equipmentCode != ''">and eo.equipment_code like concat('%',#{equipmentCode}, '%')</if>
|
|
|
|
|
<if test="equipmentName != null and equipmentName != ''">and be.equipment_name like concat('%',#{equipmentName}, '%')</if>
|
|
|
|
|
<if test="planLoopStart != null ">and eo.plan_loop_start = #{planLoopStart}</if>
|
|
|
|
|
<if test="planLoopEnd != null ">and eo.plan_loop_end = #{planLoopEnd}</if>
|
|
|
|
|
<if test="orderStart != null ">and CONVERT(date,eo.order_start) = #{orderStart}</if>
|
|
|
|
|
<if test="orderEnd != null ">and eo.order_end = #{ord5erEnd}</if>
|
|
|
|
|
<if test="orderStatus != null and orderStatus != ''">and eo.order_status = #{orderStatus}</if>
|
|
|
|
|
<if test="orderCost != null ">and eo.order_cost = #{orderCost}</if>
|
|
|
|
|
<if test="planPerson != null and planPerson != ''">and eo.plan_person like concat('%', #{planPerson}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="planPerson != null and planPerson != ''">and eo.plan_person like concat('%', #{planPerson}, '%')</if>
|
|
|
|
|
<if test="orderCostTime != null and orderCostTime != ''">and eo.order_cost_time = #{orderCostTime}</if>
|
|
|
|
|
<if test="orderSignPerson != null and orderSignPerson != ''">and eo.order_sign_person = #{orderSignPerson}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderSignPerson != null and orderSignPerson != ''">and eo.order_sign_person = #{orderSignPerson}</if>
|
|
|
|
|
<if test="factoryCode != null and factoryCode != ''">and eo.factory_code = #{factoryCode}</if>
|
|
|
|
|
<if test="attr1 != null and attr1 != ''">and eo.attr1 = #{attr1}</if>
|
|
|
|
|
<if test="attr2 != null and attr2 != ''">and eo.attr2 = #{attr2}</if>
|
|
|
|
@ -124,6 +146,7 @@
|
|
|
|
|
<if test="orderStartArrayEnd != null ">and #{orderStartArrayEnd} >= CONVERT(date,eo.order_start)</if>
|
|
|
|
|
<if test="orderEndArrayStart != null ">and CONVERT(date,eo.order_end) >= #{orderEndArrayStart}</if>
|
|
|
|
|
<if test="orderEndArrayEnd != null ">and #{orderEndArrayEnd} >= CONVERT(date,eo.order_end)</if>
|
|
|
|
|
<if test="planName != null and planName != ''">and ep.plan_name like concat('%', #{planName}, '%')</if>
|
|
|
|
|
and eo.del_flag = '0' and be.del_flag = '0' and ep.del_flag = '0'
|
|
|
|
|
</where>
|
|
|
|
|
order by eo.create_time desc
|
|
|
|
@ -195,14 +218,14 @@
|
|
|
|
|
eo.outsource_code,
|
|
|
|
|
be.equipment_name
|
|
|
|
|
from equ_order eo
|
|
|
|
|
left join base_equipment be on eo.equipment_code = be.equipment_code
|
|
|
|
|
left join base_equipment be on eo.equipment_code = be.equipment_code
|
|
|
|
|
where eo.plan_type = #{planType}
|
|
|
|
|
and eo.del_flag = '0'
|
|
|
|
|
and eo.order_status != '1'
|
|
|
|
|
and eo.order_code in (select order_code
|
|
|
|
|
and eo.del_flag = '0'
|
|
|
|
|
and eo.order_status != '1'
|
|
|
|
|
and eo.order_code in (select order_code
|
|
|
|
|
from equ_order_person
|
|
|
|
|
where del_flag = '0'
|
|
|
|
|
and user_name = #{userId}
|
|
|
|
|
and user_name = #{userId}
|
|
|
|
|
GROUP BY order_code)
|
|
|
|
|
order by eo.plan_loop_type, eo.plan_loop, eo.create_time desc, eo.equipment_code
|
|
|
|
|
</select>
|
|
|
|
@ -245,12 +268,12 @@
|
|
|
|
|
eo.outsource_code,
|
|
|
|
|
be.equipment_name
|
|
|
|
|
from equ_order eo
|
|
|
|
|
left join base_equipment be on eo.equipment_code = be.equipment_code
|
|
|
|
|
left join base_equipment be on eo.equipment_code = be.equipment_code
|
|
|
|
|
where eo.del_flag = '0'
|
|
|
|
|
and eo.order_status = '1'
|
|
|
|
|
and eo.plan_type = #{planType}
|
|
|
|
|
and eo.plan_person = #{userId}
|
|
|
|
|
and eo.order_code in (select order_code
|
|
|
|
|
and eo.order_status = '1'
|
|
|
|
|
and eo.plan_type = #{planType}
|
|
|
|
|
and eo.plan_person = #{userId}
|
|
|
|
|
and eo.order_code in (select order_code
|
|
|
|
|
from equ_order_person
|
|
|
|
|
where del_flag = '0' and user_name = #{userId}
|
|
|
|
|
GROUP BY order_code)
|
|
|
|
@ -404,18 +427,18 @@
|
|
|
|
|
<!-- 手持维修查询检查项-->
|
|
|
|
|
<select id="selectCheckListByWorkCode" parameterType="EquOrder" resultMap="EquOrderResult">
|
|
|
|
|
select
|
|
|
|
|
eo.order_id,
|
|
|
|
|
eo.order_code,
|
|
|
|
|
eo.repair_code,
|
|
|
|
|
eo.work_code,
|
|
|
|
|
eo.plan_loop,
|
|
|
|
|
eo.plan_loop_type,
|
|
|
|
|
eod.id,
|
|
|
|
|
eod.item_name,
|
|
|
|
|
eod.item_method,
|
|
|
|
|
eod.item_type,
|
|
|
|
|
eod.item_type_name,
|
|
|
|
|
eod.item_tools
|
|
|
|
|
eo.order_id,
|
|
|
|
|
eo.order_code,
|
|
|
|
|
eo.repair_code,
|
|
|
|
|
eo.work_code,
|
|
|
|
|
eo.plan_loop,
|
|
|
|
|
eo.plan_loop_type,
|
|
|
|
|
eod.id,
|
|
|
|
|
eod.item_name,
|
|
|
|
|
eod.item_method,
|
|
|
|
|
eod.item_type,
|
|
|
|
|
eod.item_type_name,
|
|
|
|
|
eod.item_tools
|
|
|
|
|
from equ_order eo
|
|
|
|
|
left join equ_order_detail eod on eo.order_code = eod.order_code
|
|
|
|
|
where eo.work_code = #{workCode}
|
|
|
|
@ -425,18 +448,18 @@
|
|
|
|
|
<!-- 手持报修查询检查项-->
|
|
|
|
|
<select id="selectCheckListByRepairCode" parameterType="EquOrder" resultMap="EquOrderResult">
|
|
|
|
|
select
|
|
|
|
|
eo.order_id,
|
|
|
|
|
eo.order_code,
|
|
|
|
|
eo.repair_code,
|
|
|
|
|
eo.work_code,
|
|
|
|
|
eo.plan_loop,
|
|
|
|
|
eo.plan_loop_type,
|
|
|
|
|
eod.id,
|
|
|
|
|
eod.item_name,
|
|
|
|
|
eod.item_method,
|
|
|
|
|
eod.item_type,
|
|
|
|
|
eod.item_type_name,
|
|
|
|
|
eod.item_tools
|
|
|
|
|
eo.order_id,
|
|
|
|
|
eo.order_code,
|
|
|
|
|
eo.repair_code,
|
|
|
|
|
eo.work_code,
|
|
|
|
|
eo.plan_loop,
|
|
|
|
|
eo.plan_loop_type,
|
|
|
|
|
eod.id,
|
|
|
|
|
eod.item_name,
|
|
|
|
|
eod.item_method,
|
|
|
|
|
eod.item_type,
|
|
|
|
|
eod.item_type_name,
|
|
|
|
|
eod.item_tools
|
|
|
|
|
from equ_order eo
|
|
|
|
|
left join equ_order_detail eod on eo.order_code = eod.order_code
|
|
|
|
|
where eo.repair_code = #{repairCode}
|
|
|
|
@ -446,7 +469,7 @@
|
|
|
|
|
<!-- 查询对应检查项id-->
|
|
|
|
|
<select id="getIdsByOrderCode" parameterType="EquOrder" resultType="java.lang.String">
|
|
|
|
|
select
|
|
|
|
|
order_id
|
|
|
|
|
order_id
|
|
|
|
|
from equ_order
|
|
|
|
|
where repair_code = #{orderCode}
|
|
|
|
|
and del_flag = '0'
|
|
|
|
@ -475,7 +498,7 @@
|
|
|
|
|
update base_equipment
|
|
|
|
|
set equipment_status = #{status}
|
|
|
|
|
where equipment_code = #{equipmentCode}
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|