|
|
|
@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<resultMap type="EquRepairWorkOrder" id="EquRepairWorkOrderResult">
|
|
|
|
|
<result property="workId" column="work_id" />
|
|
|
|
|
<result property="orderId" column="order_id" />
|
|
|
|
|
<result property="workCode" column="work_code" />
|
|
|
|
|
<result property="orderCode" column="order_code" />
|
|
|
|
|
<result property="workHandle" column="work_handle" />
|
|
|
|
|
<result property="workPlanTime" column="work_plan_time" />
|
|
|
|
@ -32,42 +33,84 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
|
<result property="factoryCode" column="factory_code" />
|
|
|
|
|
<!--设备-->
|
|
|
|
|
<result property="equipmentName" column="equipment_name" />
|
|
|
|
|
<result property="equipmentSpec" column="equipment_spec" />
|
|
|
|
|
<result property="equipmentTypeName" column="equipment_type_name" />
|
|
|
|
|
<result property="equipmentLocation" column="equipment_location" />
|
|
|
|
|
<result property="department" column="department" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectEquRepairWorkOrderVo">
|
|
|
|
|
select work_id, order_id, order_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_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
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
|
|
|
|
|
<include refid="selectEquRepairWorkOrderVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
|
|
|
|
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
|
|
|
|
|
<if test="workHandle != null and workHandle != ''"> and work_handle = #{workHandle}</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="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="workPlanTime != null "> and work_plan_time = #{workPlanTime}</if>
|
|
|
|
|
<if test="workPlanDownTime != null "> and work_plan_down_time = #{workPlanDownTime}</if>
|
|
|
|
|
<if test="orderRelevance != null and orderRelevance != ''"> and order_relevance = #{orderRelevance}</if>
|
|
|
|
|
<if test="workPerson != null and workPerson != ''"> and work_person = #{workPerson}</if>
|
|
|
|
|
<if test="workTeam != null and workTeam != ''"> and work_team = #{workTeam}</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="workOutsource != null and workOutsource != ''"> and work_outsource = #{workOutsource}</if>
|
|
|
|
|
<if test="workDownMachine != null and workDownMachine != ''"> and work_down_machine = #{workDownMachine}</if>
|
|
|
|
|
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</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="workFaultDesc != null and workFaultDesc != ''"> and work_fault_desc = #{workFaultDesc}</if>
|
|
|
|
|
<if test="workCostTime != null "> and work_cost_time = #{workCostTime}</if>
|
|
|
|
|
<if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if>
|
|
|
|
|
<if test="outWorkId != null and outWorkId != ''"> and out_work_id = #{outWorkId}</if>
|
|
|
|
|
<if test="outWorkCode != null and outWorkCode != ''"> and out_work_code = #{outWorkCode}</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="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
</where>
|
|
|
|
|
ORDER BY create_time DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectEquRepairWorkOrderByWorkId" parameterType="String" resultMap="EquRepairWorkOrderResult">
|
|
|
|
|
<include refid="selectEquRepairWorkOrderVo"/>
|
|
|
|
|
where work_id = #{workId}
|
|
|
|
|
select
|
|
|
|
|
erwo.work_id,
|
|
|
|
|
erwo.order_id,
|
|
|
|
|
erwo.order_code,
|
|
|
|
|
erwo.work_code,
|
|
|
|
|
erwo.work_handle,
|
|
|
|
|
erwo.work_plan_time,
|
|
|
|
|
erwo.work_plan_down_time,
|
|
|
|
|
erwo.order_relevance,
|
|
|
|
|
erwo.work_person,
|
|
|
|
|
erwo.work_team,
|
|
|
|
|
erwo.work_outsource,
|
|
|
|
|
erwo.work_down_machine,
|
|
|
|
|
erwo.equipment_code,
|
|
|
|
|
erwo.work_reason,
|
|
|
|
|
erwo.work_fault_desc,
|
|
|
|
|
erwo.work_cost_time,
|
|
|
|
|
erwo.work_cost,
|
|
|
|
|
erwo.out_work_id,
|
|
|
|
|
erwo.out_work_code,
|
|
|
|
|
erwo.attr1,
|
|
|
|
|
erwo.attr2,
|
|
|
|
|
erwo.attr3,
|
|
|
|
|
erwo.create_by,
|
|
|
|
|
erwo.create_time,
|
|
|
|
|
erwo.update_time,
|
|
|
|
|
erwo.update_by,
|
|
|
|
|
erwo.factory_code,
|
|
|
|
|
be.equipment_name,
|
|
|
|
|
be.equipment_spec,
|
|
|
|
|
be.equipment_type_name,
|
|
|
|
|
be.equipment_location,
|
|
|
|
|
be.department
|
|
|
|
|
from equ_repair_work_order erwo
|
|
|
|
|
left join base_equipment be on erwo.equipment_code = be.equipment_code
|
|
|
|
|
where erwo.work_id = #{workId}
|
|
|
|
|
and erwo.del_flag = '0'
|
|
|
|
|
ORDER BY create_time DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertEquRepairWorkOrder" parameterType="EquRepairWorkOrder">
|
|
|
|
@ -75,6 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="workId != null">work_id,</if>
|
|
|
|
|
<if test="orderId != null">order_id,</if>
|
|
|
|
|
<if test="workCode != null">work_code,</if>
|
|
|
|
|
<if test="orderCode != null">order_code,</if>
|
|
|
|
|
<if test="workHandle != null">work_handle,</if>
|
|
|
|
|
<if test="workPlanTime != null">work_plan_time,</if>
|
|
|
|
@ -104,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="workId != null">#{workId},</if>
|
|
|
|
|
<if test="orderId != null">#{orderId},</if>
|
|
|
|
|
<if test="workCode != null">#{workCode},</if>
|
|
|
|
|
<if test="orderCode != null">#{orderCode},</if>
|
|
|
|
|
<if test="workHandle != null">#{workHandle},</if>
|
|
|
|
|
<if test="workPlanTime != null">#{workPlanTime},</if>
|
|
|
|
@ -136,6 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
update equ_repair_work_order
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="orderId != null">order_id = #{orderId},</if>
|
|
|
|
|
<if test="workCode != null">work_code = #{workCode},</if>
|
|
|
|
|
<if test="orderCode != null">order_code = #{orderCode},</if>
|
|
|
|
|
<if test="workHandle != null">work_handle = #{workHandle},</if>
|
|
|
|
|
<if test="workPlanTime != null">work_plan_time = #{workPlanTime},</if>
|
|
|
|
@ -163,6 +209,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where work_id = #{workId}
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateWorkOutsource" parameterType="EquRepairWorkOrder">
|
|
|
|
|
update equ_repair_work_order
|
|
|
|
|
set
|
|
|
|
|
work_outsource = #{workOutsource},
|
|
|
|
|
out_work_code = #{outWorkCode}
|
|
|
|
|
where work_id = #{workId}
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEquRepairWorkOrderByWorkId" parameterType="String">
|
|
|
|
@ -175,4 +231,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
#{workId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="selectWorkCodeSerialNumber" resultType="java.lang.Integer">
|
|
|
|
|
SELECT COUNT(work_id)+1 AS serialNum
|
|
|
|
|
FROM equ_repair_work_order
|
|
|
|
|
where del_flag = '0'
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|