|
|
@ -5,10 +5,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<mapper namespace="com.op.device.mapper.EquRepairWorkOrderMapper">
|
|
|
|
<mapper namespace="com.op.device.mapper.EquRepairWorkOrderMapper">
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap type="EquRepairWorkOrder" id="EquRepairWorkOrderResult">
|
|
|
|
<resultMap type="EquRepairWorkOrder" id="EquRepairWorkOrderResult">
|
|
|
|
|
|
|
|
<!--维修工单-->
|
|
|
|
<result property="workId" column="work_id" />
|
|
|
|
<result property="workId" column="work_id" />
|
|
|
|
<result property="orderId" column="order_id" />
|
|
|
|
<result property="orderId" column="order_id" />
|
|
|
|
<result property="workCode" column="work_code" />
|
|
|
|
<result property="workCode" column="work_code" />
|
|
|
|
<result property="orderCode" column="order_code" />
|
|
|
|
<result property="orderCode" column="order_code" />
|
|
|
|
|
|
|
|
<result property="equipmentCode" column="equipment_code" />
|
|
|
|
<result property="workHandle" column="work_handle" />
|
|
|
|
<result property="workHandle" column="work_handle" />
|
|
|
|
<result property="workPlanTime" column="work_plan_time" />
|
|
|
|
<result property="workPlanTime" column="work_plan_time" />
|
|
|
|
<result property="workPlanDownTime" column="work_plan_down_time" />
|
|
|
|
<result property="workPlanDownTime" column="work_plan_down_time" />
|
|
|
@ -17,11 +19,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<result property="workTeam" column="work_team" />
|
|
|
|
<result property="workTeam" column="work_team" />
|
|
|
|
<result property="workOutsource" column="work_outsource" />
|
|
|
|
<result property="workOutsource" column="work_outsource" />
|
|
|
|
<result property="workDownMachine" column="work_down_machine" />
|
|
|
|
<result property="workDownMachine" column="work_down_machine" />
|
|
|
|
<result property="equipmentCode" column="equipment_code" />
|
|
|
|
|
|
|
|
<result property="workReason" column="work_reason" />
|
|
|
|
<result property="workReason" column="work_reason" />
|
|
|
|
<result property="workFaultDesc" column="work_fault_desc" />
|
|
|
|
<result property="workFaultDesc" column="work_fault_desc" />
|
|
|
|
|
|
|
|
<result property="workStartTime" column="work_start_time" />
|
|
|
|
|
|
|
|
<result property="workEndTime" column="work_end_time" />
|
|
|
|
<result property="workCostTime" column="work_cost_time" />
|
|
|
|
<result property="workCostTime" column="work_cost_time" />
|
|
|
|
<result property="workCost" column="work_cost" />
|
|
|
|
<result property="workCost" column="work_cost" />
|
|
|
|
|
|
|
|
<result property="workStatus" column="work_status" />
|
|
|
|
<result property="outWorkId" column="out_work_id" />
|
|
|
|
<result property="outWorkId" column="out_work_id" />
|
|
|
|
<result property="outWorkCode" column="out_work_code" />
|
|
|
|
<result property="outWorkCode" column="out_work_code" />
|
|
|
|
<result property="attr1" column="attr1" />
|
|
|
|
<result property="attr1" column="attr1" />
|
|
|
@ -39,34 +43,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<result property="equipmentTypeName" column="equipment_type_name" />
|
|
|
|
<result property="equipmentTypeName" column="equipment_type_name" />
|
|
|
|
<result property="equipmentLocation" column="equipment_location" />
|
|
|
|
<result property="equipmentLocation" column="equipment_location" />
|
|
|
|
<result property="department" column="department" />
|
|
|
|
<result property="department" column="department" />
|
|
|
|
|
|
|
|
<!--报修信息-->
|
|
|
|
|
|
|
|
<result property="orderDesc" column="order_desc" />
|
|
|
|
|
|
|
|
<result property="orderBreakdownTime" column="order_breakdown_time" />
|
|
|
|
|
|
|
|
<result property="orderSource" column="order_source" />
|
|
|
|
|
|
|
|
<result property="orderTime" column="order_time" />
|
|
|
|
|
|
|
|
<result property="orderRepairman" column="order_repairman" />
|
|
|
|
|
|
|
|
<result property="orderConnection" column="order_connection" />
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectEquRepairWorkOrderVo">
|
|
|
|
<sql id="selectEquRepairWorkOrderVo">
|
|
|
|
select work_id, order_id, order_code, work_code,work_handle, work_plan_time, work_plan_down_time, order_relevance, work_person, work_team, work_outsource, work_down_machine, equipment_code, work_reason, work_fault_desc, work_cost_time, work_cost, out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code from equ_repair_work_order
|
|
|
|
select work_id, order_id, order_code, work_code,work_handle, work_plan_time, work_plan_down_time, order_relevance, work_person, work_team, work_outsource, work_down_machine, equipment_code, work_reason, work_fault_desc, work_start_time,work_end_time,work_cost_time, work_cost, work_status,out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code from equ_repair_work_order
|
|
|
|
</sql>
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
|
|
|
|
<select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
|
|
|
|
<include refid="selectEquRepairWorkOrderVo"/>
|
|
|
|
<include refid="selectEquRepairWorkOrderVo"/>
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<!--报修id 维修code 报修code-->
|
|
|
|
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
|
|
|
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
|
|
|
<if test="workCode != null and workCode != ''"> and work_code like concat('%', #{workCode}, '%')</if>
|
|
|
|
<if test="workCode != null and workCode != ''"> and work_code like concat('%', #{workCode}, '%')</if>
|
|
|
|
<if test="orderCode != null and orderCode != ''"> and order_code like concat('%', #{orderCode}, '%')</if>
|
|
|
|
<if test="orderCode != null and orderCode != ''"> and order_code like concat('%', #{orderCode}, '%')</if>
|
|
|
|
|
|
|
|
<!--设备code 设备故障描述 计划维修时间 是否停机 计划停机时间-->
|
|
|
|
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if>
|
|
|
|
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if>
|
|
|
|
<if test="workDownMachine != null and workDownMachine != ''"> and work_down_machine = #{workDownMachine}</if>
|
|
|
|
<if test="workFaultDesc != null and workFaultDesc != ''"> and work_fault_desc = #{workFaultDesc}</if>
|
|
|
|
<if test="workPlanTime != null "> and work_plan_time = #{workPlanTime}</if>
|
|
|
|
<if test="workPlanTime != null "> and work_plan_time = #{workPlanTime}</if>
|
|
|
|
|
|
|
|
<if test="workDownMachine != null and workDownMachine != ''"> and work_down_machine = #{workDownMachine}</if>
|
|
|
|
<if test="workPlanDownTime != null "> and work_plan_down_time = #{workPlanDownTime}</if>
|
|
|
|
<if test="workPlanDownTime != null "> and work_plan_down_time = #{workPlanDownTime}</if>
|
|
|
|
|
|
|
|
<!--维修人员 维修组-->
|
|
|
|
<if test="workPerson != null and workPerson != ''"> and work_person like concat('%', #{workPerson}, '%')</if>
|
|
|
|
<if test="workPerson != null and workPerson != ''"> and work_person like concat('%', #{workPerson}, '%')</if>
|
|
|
|
<if test="workTeam != null and workTeam != ''"> and work_team like concat('%', #{workTeam}, '%')</if>
|
|
|
|
<if test="workTeam != null and workTeam != ''"> and work_team like concat('%', #{workTeam}, '%')</if>
|
|
|
|
|
|
|
|
<!--是否委外 委外工单编码-->
|
|
|
|
<if test="workOutsource != null and workOutsource != ''"> and work_outsource = #{workOutsource}</if>
|
|
|
|
<if test="workOutsource != null and workOutsource != ''"> and work_outsource = #{workOutsource}</if>
|
|
|
|
<if test="outWorkCode != null and outWorkCode != ''"> and out_work_code = #{outWorkCode}</if>
|
|
|
|
<if test="outWorkCode != null and outWorkCode != ''"> and out_work_code = #{outWorkCode}</if>
|
|
|
|
<!--没有用上-->
|
|
|
|
<!--故障原因 维修开始时间 维修结束时间 花费时间 费用 维修状态 -->
|
|
|
|
<if test="workHandle != null and workHandle != ''"> and work_handle = #{workHandle}</if>
|
|
|
|
|
|
|
|
<if test="orderRelevance != null and orderRelevance != ''"> and order_relevance = #{orderRelevance}</if>
|
|
|
|
|
|
|
|
<if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if>
|
|
|
|
<if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if>
|
|
|
|
<if test="workFaultDesc != null and workFaultDesc != ''"> and work_fault_desc = #{workFaultDesc}</if>
|
|
|
|
<if test="workStartTime != null "> and work_start_time = #{workStartTime}</if>
|
|
|
|
|
|
|
|
<if test="workEndTime != null "> and work_end_time = #{workEndTime}</if>
|
|
|
|
<if test="workCostTime != null "> and work_cost_time = #{workCostTime}</if>
|
|
|
|
<if test="workCostTime != null "> and work_cost_time = #{workCostTime}</if>
|
|
|
|
<if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if>
|
|
|
|
<if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if>
|
|
|
|
|
|
|
|
<if test="workStatus != null and workStatus != ''"> and work_status = #{workStatus}</if>
|
|
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
|
|
|
|
|
|
<!--没有用上-->
|
|
|
|
|
|
|
|
<if test="workHandle != null and workHandle != ''"> and work_handle = #{workHandle}</if>
|
|
|
|
|
|
|
|
<if test="orderRelevance != null and orderRelevance != ''"> and order_relevance = #{orderRelevance}</if>
|
|
|
|
and del_flag = '0'
|
|
|
|
and del_flag = '0'
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
ORDER BY create_time DESC
|
|
|
|
ORDER BY create_time DESC
|
|
|
@ -89,8 +108,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
erwo.equipment_code,
|
|
|
|
erwo.equipment_code,
|
|
|
|
erwo.work_reason,
|
|
|
|
erwo.work_reason,
|
|
|
|
erwo.work_fault_desc,
|
|
|
|
erwo.work_fault_desc,
|
|
|
|
|
|
|
|
erwo.work_start_time,
|
|
|
|
|
|
|
|
erwo.work_end_time,
|
|
|
|
erwo.work_cost_time,
|
|
|
|
erwo.work_cost_time,
|
|
|
|
erwo.work_cost,
|
|
|
|
erwo.work_cost,
|
|
|
|
|
|
|
|
erwo.work_status,
|
|
|
|
erwo.out_work_id,
|
|
|
|
erwo.out_work_id,
|
|
|
|
erwo.out_work_code,
|
|
|
|
erwo.out_work_code,
|
|
|
|
erwo.attr1,
|
|
|
|
erwo.attr1,
|
|
|
@ -105,9 +127,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
be.equipment_spec,
|
|
|
|
be.equipment_spec,
|
|
|
|
be.equipment_type_name,
|
|
|
|
be.equipment_type_name,
|
|
|
|
be.equipment_location,
|
|
|
|
be.equipment_location,
|
|
|
|
be.department
|
|
|
|
be.department,
|
|
|
|
|
|
|
|
ero.order_desc,
|
|
|
|
|
|
|
|
ero.order_breakdown_time,
|
|
|
|
|
|
|
|
ero.order_source,
|
|
|
|
|
|
|
|
ero.order_time,
|
|
|
|
|
|
|
|
ero.order_repairman,
|
|
|
|
|
|
|
|
ero.order_connection
|
|
|
|
from equ_repair_work_order erwo
|
|
|
|
from equ_repair_work_order erwo
|
|
|
|
left join base_equipment be on erwo.equipment_code = be.equipment_code
|
|
|
|
left join base_equipment be on erwo.equipment_code = be.equipment_code
|
|
|
|
|
|
|
|
left join equ_repair_order ero on erwo.order_code = ero.order_code
|
|
|
|
where erwo.work_id = #{workId}
|
|
|
|
where erwo.work_id = #{workId}
|
|
|
|
and erwo.del_flag = '0'
|
|
|
|
and erwo.del_flag = '0'
|
|
|
|
ORDER BY create_time DESC
|
|
|
|
ORDER BY create_time DESC
|
|
|
@ -131,8 +160,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="equipmentCode != null">equipment_code,</if>
|
|
|
|
<if test="equipmentCode != null">equipment_code,</if>
|
|
|
|
<if test="workReason != null">work_reason,</if>
|
|
|
|
<if test="workReason != null">work_reason,</if>
|
|
|
|
<if test="workFaultDesc != null">work_fault_desc,</if>
|
|
|
|
<if test="workFaultDesc != null">work_fault_desc,</if>
|
|
|
|
|
|
|
|
<if test="workStartTime != null">work_start_time,</if>
|
|
|
|
|
|
|
|
<if test="workEndTime != null">work_end_time,</if>
|
|
|
|
<if test="workCostTime != null">work_cost_time,</if>
|
|
|
|
<if test="workCostTime != null">work_cost_time,</if>
|
|
|
|
<if test="workCost != null">work_cost,</if>
|
|
|
|
<if test="workCost != null">work_cost,</if>
|
|
|
|
|
|
|
|
<if test="workStatus != null">work_status,</if>
|
|
|
|
<if test="outWorkId != null">out_work_id,</if>
|
|
|
|
<if test="outWorkId != null">out_work_id,</if>
|
|
|
|
<if test="outWorkCode != null">out_work_code,</if>
|
|
|
|
<if test="outWorkCode != null">out_work_code,</if>
|
|
|
|
<if test="attr1 != null">attr1,</if>
|
|
|
|
<if test="attr1 != null">attr1,</if>
|
|
|
@ -161,8 +193,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="equipmentCode != null">#{equipmentCode},</if>
|
|
|
|
<if test="equipmentCode != null">#{equipmentCode},</if>
|
|
|
|
<if test="workReason != null">#{workReason},</if>
|
|
|
|
<if test="workReason != null">#{workReason},</if>
|
|
|
|
<if test="workFaultDesc != null">#{workFaultDesc},</if>
|
|
|
|
<if test="workFaultDesc != null">#{workFaultDesc},</if>
|
|
|
|
|
|
|
|
<if test="workStartTime != null">#{workStartTime},</if>
|
|
|
|
|
|
|
|
<if test="workEndTime != null">#{workEndTime},</if>
|
|
|
|
<if test="workCostTime != null">#{workCostTime},</if>
|
|
|
|
<if test="workCostTime != null">#{workCostTime},</if>
|
|
|
|
<if test="workCost != null">#{workCost},</if>
|
|
|
|
<if test="workCost != null">#{workCost},</if>
|
|
|
|
|
|
|
|
<if test="workStatus != null">#{workStatus},</if>
|
|
|
|
<if test="outWorkId != null">#{outWorkId},</if>
|
|
|
|
<if test="outWorkId != null">#{outWorkId},</if>
|
|
|
|
<if test="outWorkCode != null">#{outWorkCode},</if>
|
|
|
|
<if test="outWorkCode != null">#{outWorkCode},</if>
|
|
|
|
<if test="attr1 != null">#{attr1},</if>
|
|
|
|
<if test="attr1 != null">#{attr1},</if>
|
|
|
@ -194,8 +229,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
|
|
|
|
<if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
|
|
|
|
<if test="workReason != null">work_reason = #{workReason},</if>
|
|
|
|
<if test="workReason != null">work_reason = #{workReason},</if>
|
|
|
|
<if test="workFaultDesc != null">work_fault_desc = #{workFaultDesc},</if>
|
|
|
|
<if test="workFaultDesc != null">work_fault_desc = #{workFaultDesc},</if>
|
|
|
|
|
|
|
|
<if test="workStartTime != null">work_start_time = #{workStartTime},</if>
|
|
|
|
|
|
|
|
<if test="workEndTime != null">work_end_time = #{workEndTime},</if>
|
|
|
|
<if test="workCostTime != null">work_cost_time = #{workCostTime},</if>
|
|
|
|
<if test="workCostTime != null">work_cost_time = #{workCostTime},</if>
|
|
|
|
<if test="workCost != null">work_cost = #{workCost},</if>
|
|
|
|
<if test="workCost != null">work_cost = #{workCost},</if>
|
|
|
|
|
|
|
|
<if test="workStatus != null">work_status = #{workStatus},</if>
|
|
|
|
<if test="outWorkId != null">out_work_id = #{outWorkId},</if>
|
|
|
|
<if test="outWorkId != null">out_work_id = #{outWorkId},</if>
|
|
|
|
<if test="outWorkCode != null">out_work_code = #{outWorkCode},</if>
|
|
|
|
<if test="outWorkCode != null">out_work_code = #{outWorkCode},</if>
|
|
|
|
<if test="attr1 != null">attr1 = #{attr1},</if>
|
|
|
|
<if test="attr1 != null">attr1 = #{attr1},</if>
|
|
|
@ -238,4 +276,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
where del_flag = '0'
|
|
|
|
where del_flag = '0'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getMaintenancePersonList" parameterType="EquPerson" resultType="com.op.device.domain.EquPerson">
|
|
|
|
|
|
|
|
select
|
|
|
|
|
|
|
|
su.user_id AS userId,
|
|
|
|
|
|
|
|
su.user_name AS userName,
|
|
|
|
|
|
|
|
su.nick_name AS nickName,
|
|
|
|
|
|
|
|
CONCAT(su.nick_name,su.user_name) AS teamUserName,
|
|
|
|
|
|
|
|
sp.post_code AS postCode,
|
|
|
|
|
|
|
|
sp.post_name AS postName
|
|
|
|
|
|
|
|
from sys_user su
|
|
|
|
|
|
|
|
left join sys_user_post sup on su.user_id = sup.user_id
|
|
|
|
|
|
|
|
left join sys_post sp on sup.post_id = sp.post_id
|
|
|
|
|
|
|
|
where su.del_flag = '0'
|
|
|
|
|
|
|
|
and sp.post_id = '12'
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
</mapper>
|