|
|
|
@ -61,53 +61,72 @@
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectEquOrderList" parameterType="EquOrder" resultMap="EquOrderResult">
|
|
|
|
|
<include refid="selectEquOrderVo"/>
|
|
|
|
|
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
|
|
|
|
|
<where>
|
|
|
|
|
<if test="planId != null and planId != ''"> and plan_id = #{planId}</if>
|
|
|
|
|
<if test="planCode != null and planCode != ''"> and plan_code like concat('%', #{planCode}, '%')</if>
|
|
|
|
|
<if test="planType != null and planType != ''"> and plan_type = #{planType}</if>
|
|
|
|
|
<if test="orderCode != null and orderCode != ''"> and order_code like concat('%', #{orderCode}, '%')</if>
|
|
|
|
|
<if test="planWorkshop != null and planWorkshop != ''"> and plan_workshop = #{planWorkshop}</if>
|
|
|
|
|
<if test="planProdLine != null and planProdLine != ''"> and plan_prod_line = #{planProdLine}</if>
|
|
|
|
|
<if test="planLoop != null and planLoop != ''"> and plan_loop = #{planLoop}</if>
|
|
|
|
|
<if test="planLoopType != null and planLoopType != ''"> and plan_loop_type = #{planLoopType}</if>
|
|
|
|
|
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if>
|
|
|
|
|
<if test="planLoopStart != null "> and plan_loop_start = #{planLoopStart}</if>
|
|
|
|
|
<if test="planLoopEnd != null "> and plan_loop_end = #{planLoopEnd}</if>
|
|
|
|
|
<if test="orderStart != null "> and order_start = #{orderStart}</if>
|
|
|
|
|
<if test="orderEnd != null "> and order_end = #{ord5erEnd}</if>
|
|
|
|
|
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
|
|
|
|
|
<if test="orderCost != null "> and order_cost = #{orderCost}</if>
|
|
|
|
|
<if test="planPerson != null and planPerson != ''"> and plan_person like concat('%', #{planPerson}, '%')</if>
|
|
|
|
|
<if test="orderCostTime != null and orderCostTime != ''"> and order_cost_time = #{orderCostTime}</if>
|
|
|
|
|
<if test="orderSignPerson != null and orderSignPerson != ''"> and order_sign_person = #{orderSignPerson}</if>
|
|
|
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
|
|
|
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
|
|
|
|
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
|
|
|
|
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
|
|
|
|
|
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
|
|
|
|
<if test="createTime != null "> and CONVERT(date,create_time) = #{createTime}</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
|
|
|
|
|
<if test="updateTime != null "> and CONVERT(date,update_time) = #{updateTime}</if>
|
|
|
|
|
<if test="upkeep != null "> and upkeep = #{upkeep}</if>
|
|
|
|
|
<if test="calculationRule != null "> and calculation_rule = #{calculationRule}</if>
|
|
|
|
|
<if test="shutDown != null "> and shut_down = #{shutDown}</if>
|
|
|
|
|
<if test="orderInspect != null "> and order_inspect = #{orderInspect}</if>
|
|
|
|
|
<if test="repairCode != null "> and repair_code = #{repairCode}</if>
|
|
|
|
|
<if test="outsourceCode != null "> and outsource_code = #{outsourceCode}</if>
|
|
|
|
|
<if test="workCode != null "> and work_code = #{workCode}</if>
|
|
|
|
|
<if test="loopStart != null "> and CONVERT(date,plan_loop_start) >= #{loopStart}</if>
|
|
|
|
|
<if test="loopEnd != null "> and #{loopEnd} >= CONVERT(date,plan_loop_start)</if>
|
|
|
|
|
<if test="loopEndArrayStart != null "> and CONVERT(date,plan_loop_end) >= #{loopEndArrayStart}</if>
|
|
|
|
|
<if test="getLoopEndArrayEnd != null "> and #{getLoopEndArrayEnd} >= CONVERT(date,plan_loop_end)</if>
|
|
|
|
|
<if test="orderStartArrayStart != null "> and CONVERT(date,order_start) >= #{orderStartArrayStart}</if>
|
|
|
|
|
<if test="orderStartArrayEnd != null "> and #{orderStartArrayEnd} >= CONVERT(date,order_start)</if>
|
|
|
|
|
<if test="orderEndArrayStart != null "> and CONVERT(date,order_end) >= #{orderEndArrayStart}</if>
|
|
|
|
|
<if test="orderEndArrayEnd != null "> and #{orderEndArrayEnd} >= CONVERT(date,order_end)</if>
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
<if test="planId != null and planId != ''">and eo.plan_id = #{planId}</if>
|
|
|
|
|
<if test="planCode != null and planCode != ''">and eo.plan_code like concat('%', #{planCode}, '%')</if>
|
|
|
|
|
<if test="planType != null and planType != ''">and eo.plan_type = #{planType}</if>
|
|
|
|
|
<if test="orderCode != null and orderCode != ''">and eo.order_code like concat('%', #{orderCode}, '%')</if>
|
|
|
|
|
<if test="planWorkshop != null and planWorkshop != ''">and eo.plan_workshop = #{planWorkshop}</if>
|
|
|
|
|
<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="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="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="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>
|
|
|
|
|
<if test="attr3 != null and attr3 != ''">and eo.attr3 = #{attr3}</if>
|
|
|
|
|
<if test="delFlag != null and delFlag != ''">and eo.del_flag = #{delFlag}</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">and eo.create_by like concat('%', #{createBy}, '%')</if>
|
|
|
|
|
<if test="createTime != null ">and CONVERT(date,eo.create_time) = #{createTime}</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">and eo.update_by like concat('%', #{updateBy}, '%')</if>
|
|
|
|
|
<if test="updateTime != null ">and CONVERT(date,eo.update_time) = #{updateTime}</if>
|
|
|
|
|
<if test="upkeep != null ">and eo.upkeep = #{upkeep}</if>
|
|
|
|
|
<if test="calculationRule != null ">and eo.calculation_rule = #{calculationRule}</if>
|
|
|
|
|
<if test="shutDown != null ">and eo.shut_down = #{shutDown}</if>
|
|
|
|
|
<if test="orderInspect != null ">and eo.order_inspect = #{orderInspect}</if>
|
|
|
|
|
<if test="repairCode != null ">and eo.repair_code = #{repairCode}</if>
|
|
|
|
|
<if test="outsourceCode != null ">and eo.outsource_code = #{outsourceCode}</if>
|
|
|
|
|
<if test="workCode != null ">and eo.work_code = #{workCode}</if>
|
|
|
|
|
<if test="loopStart != null ">and CONVERT(date,eo.plan_loop_start) >= #{loopStart}</if>
|
|
|
|
|
<if test="loopEnd != null ">and #{loopEnd} >= CONVERT(date,eo.plan_loop_start)</if>
|
|
|
|
|
<if test="loopEndArrayStart != null ">and CONVERT(date,eo.plan_loop_end) >= #{loopEndArrayStart}</if>
|
|
|
|
|
<if test="getLoopEndArrayEnd != null ">and #{getLoopEndArrayEnd} >= CONVERT(date,eo.plan_loop_end)</if>
|
|
|
|
|
<if test="orderStartArrayStart != null ">and CONVERT(date,eo.order_start) >= #{orderStartArrayStart}</if>
|
|
|
|
|
<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>
|
|
|
|
|
and eo.del_flag = '0' and be.del_flag = '0' and ep.del_flag = '0'
|
|
|
|
|
</where>
|
|
|
|
|
order by create_time desc
|
|
|
|
|
order by eo.create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectEquOrderByOrderCode" parameterType="String" resultMap="EquOrderResult">
|
|
|
|
|