@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id= "selectDmsBillsFaultInstanceVo" >
select repair_instance_id, fault_source_type, fault_source_id, wf_process_id, bills_fault_code, bills_status, apply_user, apply_time, real_begin_time, real_end_time, require_end_time, instance_type, is_flag, remark, create_by, create_time, update_by, update_time,device_id from dms_bills_fault_instance
select repair_instance_id, fault_source_type, fault_source_id, wf_process_id, bills_fault_code, bills_status, apply_user, apply_time, real_begin_time, real_end_time, require_end_time, instance_type, is_flag, remark, create_by, create_time, update_by, update_time,device_id,approveStatus from dms_bills_fault_instance
</sql>
<select id= "selectDmsBillsFaultInstanceList" parameterType= "DmsBillsFaultInstance" resultMap= "DmsBillsFaultInstanceResult" >
@ -151,6 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "wfProcessId != null" > wf_process_id = #{wfProcessId},</if>
<if test= "billsFaultCode != null and billsFaultCode != ''" > bills_fault_code = #{billsFaultCode},</if>
<if test= "billsStatus != null and billsStatus != ''" > bills_status = #{billsStatus},</if>
<if test= "faultSourceType != null and faultSourceType != ''" > fault_source_type = #{faultSourceType},</if>
<if test= "applyUser != null" > apply_user = #{applyUser},</if>
<if test= "applyTime != null" > apply_time = #{applyTime},</if>
<if test= "realBeginTime != null" > real_begin_time = #{realBeginTime},</if>
@ -164,6 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "updateBy != null" > update_by = #{updateBy},</if>
<if test= "updateTime != null" > update_time = #{updateTime},</if>
<if test= "deviceId != null" > device_id = #{deviceId},</if>
<if test= "approveStatus != null" > approveStatus = #{approveStatus},</if>
</trim>
where repair_instance_id = #{repairInstanceId}
</update>
@ -190,7 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id= "selectDmsBillsFaultInstanceJoinVo" >
select dbfi.repair_instance_id, dbfi.fault_source_type, dbfi.fault_source_id, dbfi.wf_process_id, dbfi.bills_fault_code, dbfi.bills_status,
dbfi.apply_user, dbfi.apply_time, dbfi.real_begin_time, dbfi.real_end_time, dbfi.require_end_time, dbfi.device_id,
dbfi.apply_user, dbfi.apply_time, dbfi.real_begin_time, dbfi.real_end_time, dbfi.require_end_time, dbfi.device_id,dbfi.approveStatus,
dbdl.device_code,dbdl.device_name,dbdl.device_location,dbdl.device_spec
from dms_bills_fault_instance dbfi left join dms_base_device_ledger dbdl on dbfi.device_id=dbdl.device_id
</sql>
@ -218,21 +220,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id= "selectFaultInstanceJoinFirstAndDeviceById" parameterType= "Long" resultMap= "DmsBillsFaultInstanceResult" >
select dbfi.repair_instance_id, dbfi.fault_source_type, dbfi.fault_source_id, dbfi.wf_process_id, dbfi.bills_fault_code, dbfi.bills_status,
dbfi.apply_user, dbfi.apply_time, dbfi.real_begin_time, dbfi.real_end_time, dbfi.require_end_time, dbfi.device_id,
dbdl.device_code,dbdl.device_name,dbdl.device_location,dbdl.device_spec,
dfia.instance_activity_id,dfia.fault_type,dfia.fault_description,dfia.design_operations,dfia.repair_type,dfia.outsrc_id,dfia.process_handle_resolution
dbfi.apply_user, dbfi.apply_time, dbfi.real_begin_time, dbfi.real_end_time, dbfi.require_end_time, dbfi.device_id,dbfi.approveStatus,
dbdl.device_code,dbdl.device_name,dbdl.device_location,dbdl.device_spec,
dfia.instance_activity_id,dfia.fault_type,dfia.fault_description,dfia.design_operations,dfia.repair_type,dfia.outsrc_id,dfia.process_handle_resolution
,dfia.checked_fault checked_fault,
dfia.repair_content repair_content,
dfia.protected_method protected_method,
dfia.repairer repairer,
dfia.repair_confirm repair_confirm,
dfia.confirm_time confirm_time,dfia.components_parts_id components_parts_id
from dms_bills_fault_instance dbfi left join dms_base_device_ledger dbdl on dbfi.device_id=dbdl.device_id
left join dms_fault_instance_activity dfia on dbfi.repair_instance_id=dfia.repair_instance_id
left join dms_fault_instance_activity dfia on dbfi.repair_instance_id=dfia.repair_instance_id
where dbfi.repair_instance_id = #{repairInstanceId} and dfia.process_step_order=1
</select>
<select id= "selectFaultInstanceJoinActivityByRepairInstanceId" parameterType= "Long" resultMap= "DmsBillsFaultInstanceDmsFaultInstanceActivityResult" >
select a.repair_instance_id, a.fault_source_type, a.fault_source_id, a.wf_process_id, a.bills_fault_code, a.bills_status, a.apply_user, a.apply_time, a.real_begin_time, a.real_end_time, a.require_end_time, a.instance_type, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,dbdl.device_code,dbdl.device_name,dbdl.device_location,dbdl.device_spec,
select a.repair_instance_id, a.fault_source_type, a.fault_source_id, a.wf_process_id, a.bills_fault_code, a.bills_status, a.apply_user, a.apply_time, a.real_begin_time, a.real_end_time, a.require_end_time, a.instance_type, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,a.approveStatus, dbdl.device_code,dbdl.device_name,dbdl.device_location,dbdl.device_spec,
b.instance_activity_id as sub_instance_activity_id, b.repair_instance_id as sub_repair_instance_id, b.process_activity_id as sub_process_activity_id, b.fault_type as sub_fault_type, b.fault_description as sub_fault_description, b.design_operations as sub_design_operations, b.device_id as sub_device_id, b.repair_type as sub_repair_type, b.outsrc_id as sub_outsrc_id, b.process_handle_resolution as sub_process_handle_resolution, b.remark as sub_remark, b.process_handle_status as sub_process_handle_status, b.process_step_order as sub_process_step_order, b.start_time as sub_start_time, b.end_time as sub_end_time, b.handle_user_id as sub_handle_user_id, b.handle_by as sub_handle_by, b.handle_time as sub_handle_time
from dms_bills_fault_instance a
left join dms_base_device_ledger dbdl on a.device_id=dbdl.device_id
left join dms_fault_instance_activity b on b.repair_instance_id = a.repair_instance_id
where a.repair_instance_id = #{repairInstanceId} order by b.process_step_order
</select>
@ -253,6 +262,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join dms_fault_instance_activity dfia on dbfi.repair_instance_id=dfia.repair_instance_id
where dbfi.repair_instance_id = #{repairInstanceId} and dfia.process_step_order=1
</select>
<select id= "selectFaults" resultType= "com.hw.dms.domain.DmsFaultInstanceActivity"
parameterType="java.lang.Long">
select
x.*,a.device_name ,a.device_location ,b.apply_user ,b.apply_time ,b.real_begin_time ,b.real_end_time
from
`hwjy-cloud`.dms_fault_instance_activity x left join dms_base_device_ledger a on x.device_id = a.device_id
left join dms_bills_fault_instance b on x.repair_instance_id = b.repair_instance_id where x.repair_instance_id = #{repairInstanceId}
</select>
<select id= "selectParts" resultType= "com.hw.dms.domain.DmsFaultCompentsParts"
parameterType="java.lang.Long">
SELECT x.* FROM `hwjy-cloud`.dms_fault_compents_parts x where x.fault_id = #{repairInstanceId}
</select>
</mapper>