|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<!DOCTYPE mapper
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.hw.dms.mapper.DmsFaultInstanceActivityMapper">
|
|
|
|
|
|
<resultMap type="DmsFaultInstanceActivity" id="DmsFaultInstanceActivityResult">
|
|
|
<result property="instanceActivityId" column="instance_activity_id" />
|
|
|
<result property="repairInstanceId" column="repair_instance_id" />
|
|
|
<result property="processActivityId" column="process_activity_id" />
|
|
|
<result property="faultType" column="fault_type" />
|
|
|
<result property="faultDescription" column="fault_description" />
|
|
|
<result property="designOperations" column="design_operations" />
|
|
|
<result property="deviceId" column="device_id" />
|
|
|
<result property="repairType" column="repair_type" />
|
|
|
<result property="outsrcId" column="outsrc_id" />
|
|
|
<result property="processHandleResolution" column="process_handle_resolution" />
|
|
|
<result property="remark" column="remark" />
|
|
|
<result property="processHandleStatus" column="process_handle_status" />
|
|
|
<result property="processStepOrder" column="process_step_order" />
|
|
|
<result property="startTime" column="start_time" />
|
|
|
<result property="endTime" column="end_time" />
|
|
|
<result property="handleUserId" column="handle_user_id" />
|
|
|
<result property="handleBy" column="handle_by" />
|
|
|
<result property="handleTime" column="handle_time" />
|
|
|
<result property="createBy" column="create_by" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
<result property="transferUserId" column="transfer_user_id" />
|
|
|
<result property="attr1" column="attr1" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectDmsFaultInstanceActivityVo">
|
|
|
select instance_activity_id, repair_instance_id, process_activity_id, fault_type, fault_description, design_operations, device_id, repair_type, outsrc_id, process_handle_resolution, remark, process_handle_status, process_step_order, start_time, end_time, handle_user_id, handle_by, handle_time, create_by, create_time, transfer_user_id, attr1 from dms_fault_instance_activity
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectDmsFaultInstanceActivityList" parameterType="DmsFaultInstanceActivity" resultMap="DmsFaultInstanceActivityResult">
|
|
|
<include refid="selectDmsFaultInstanceActivityVo"/>
|
|
|
<where>
|
|
|
<if test="repairInstanceId != null "> and repair_instance_id = #{repairInstanceId}</if>
|
|
|
<if test="processActivityId != null "> and process_activity_id = #{processActivityId}</if>
|
|
|
<if test="faultType != null and faultType != ''"> and fault_type = #{faultType}</if>
|
|
|
<if test="faultDescription != null and faultDescription != ''"> and fault_description = #{faultDescription}</if>
|
|
|
<if test="designOperations != null and designOperations != ''"> and design_operations = #{designOperations}</if>
|
|
|
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
|
|
<if test="repairType != null and repairType != ''"> and repair_type = #{repairType}</if>
|
|
|
<if test="outsrcId != null "> and outsrc_id = #{outsrcId}</if>
|
|
|
<if test="processHandleResolution != null and processHandleResolution != ''"> and process_handle_resolution = #{processHandleResolution}</if>
|
|
|
<if test="processHandleStatus != null and processHandleStatus != ''"> and process_handle_status = #{processHandleStatus}</if>
|
|
|
<if test="processStepOrder != null "> and process_step_order = #{processStepOrder}</if>
|
|
|
<if test="startTime != null "> and start_time = #{startTime}</if>
|
|
|
<if test="endTime != null "> and end_time = #{endTime}</if>
|
|
|
<if test="handleUserId != null "> and handle_user_id = #{handleUserId}</if>
|
|
|
<if test="handleBy != null and handleBy != ''"> and handle_by = #{handleBy}</if>
|
|
|
<if test="handleTime != null "> and handle_time = #{handleTime}</if>
|
|
|
<if test="transferUserId != null "> and transfer_user_id = #{transferUserId}</if>
|
|
|
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectDmsFaultInstanceActivityByInstanceActivityId" parameterType="Long" resultMap="DmsFaultInstanceActivityResult">
|
|
|
<include refid="selectDmsFaultInstanceActivityVo"/>
|
|
|
where instance_activity_id = #{instanceActivityId}
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertDmsFaultInstanceActivity" parameterType="DmsFaultInstanceActivity" useGeneratedKeys="true" keyProperty="instanceActivityId">
|
|
|
insert into dms_fault_instance_activity
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="repairInstanceId != null">repair_instance_id,</if>
|
|
|
<if test="processActivityId != null">process_activity_id,</if>
|
|
|
<if test="faultType != null">fault_type,</if>
|
|
|
<if test="faultDescription != null">fault_description,</if>
|
|
|
<if test="designOperations != null">design_operations,</if>
|
|
|
<if test="deviceId != null">device_id,</if>
|
|
|
<if test="repairType != null">repair_type,</if>
|
|
|
<if test="outsrcId != null">outsrc_id,</if>
|
|
|
<if test="processHandleResolution != null">process_handle_resolution,</if>
|
|
|
<if test="remark != null">remark,</if>
|
|
|
<if test="processHandleStatus != null and processHandleStatus != ''">process_handle_status,</if>
|
|
|
<if test="processStepOrder != null">process_step_order,</if>
|
|
|
<if test="startTime != null">start_time,</if>
|
|
|
<if test="endTime != null">end_time,</if>
|
|
|
<if test="handleUserId != null">handle_user_id,</if>
|
|
|
<if test="handleBy != null">handle_by,</if>
|
|
|
<if test="handleTime != null">handle_time,</if>
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
<if test="transferUserId != null">transfer_user_id,</if>
|
|
|
<if test="attr1 != null">attr1,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="repairInstanceId != null">#{repairInstanceId},</if>
|
|
|
<if test="processActivityId != null">#{processActivityId},</if>
|
|
|
<if test="faultType != null">#{faultType},</if>
|
|
|
<if test="faultDescription != null">#{faultDescription},</if>
|
|
|
<if test="designOperations != null">#{designOperations},</if>
|
|
|
<if test="deviceId != null">#{deviceId},</if>
|
|
|
<if test="repairType != null">#{repairType},</if>
|
|
|
<if test="outsrcId != null">#{outsrcId},</if>
|
|
|
<if test="processHandleResolution != null">#{processHandleResolution},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
<if test="processHandleStatus != null and processHandleStatus != ''">#{processHandleStatus},</if>
|
|
|
<if test="processStepOrder != null">#{processStepOrder},</if>
|
|
|
<if test="startTime != null">#{startTime},</if>
|
|
|
<if test="endTime != null">#{endTime},</if>
|
|
|
<if test="handleUserId != null">#{handleUserId},</if>
|
|
|
<if test="handleBy != null">#{handleBy},</if>
|
|
|
<if test="handleTime != null">#{handleTime},</if>
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
<if test="transferUserId != null">#{transferUserId},</if>
|
|
|
<if test="attr1 != null">#{attr1},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateDmsFaultInstanceActivity" parameterType="DmsFaultInstanceActivity">
|
|
|
update dms_fault_instance_activity
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="repairInstanceId != null">repair_instance_id = #{repairInstanceId},</if>
|
|
|
<if test="processActivityId != null">process_activity_id = #{processActivityId},</if>
|
|
|
<if test="faultType != null">fault_type = #{faultType},</if>
|
|
|
<if test="faultDescription != null">fault_description = #{faultDescription},</if>
|
|
|
<if test="designOperations != null">design_operations = #{designOperations},</if>
|
|
|
<if test="deviceId != null">device_id = #{deviceId},</if>
|
|
|
<if test="repairType != null">repair_type = #{repairType},</if>
|
|
|
<if test="outsrcId != null">outsrc_id = #{outsrcId},</if>
|
|
|
<if test="processHandleResolution != null">process_handle_resolution = #{processHandleResolution},</if>
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
<if test="processHandleStatus != null and processHandleStatus != ''">process_handle_status = #{processHandleStatus},</if>
|
|
|
<if test="processStepOrder != null">process_step_order = #{processStepOrder},</if>
|
|
|
<if test="startTime != null">start_time = #{startTime},</if>
|
|
|
<if test="endTime != null">end_time = #{endTime},</if>
|
|
|
<if test="handleUserId != null">handle_user_id = #{handleUserId},</if>
|
|
|
<if test="handleBy != null">handle_by = #{handleBy},</if>
|
|
|
<if test="handleTime != null">handle_time = #{handleTime},</if>
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
<if test="transferUserId != null">transfer_user_id = #{transferUserId},</if>
|
|
|
<if test="attr1 != null">attr1 = #{attr1},</if>
|
|
|
</trim>
|
|
|
where instance_activity_id = #{instanceActivityId}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteDmsFaultInstanceActivityByInstanceActivityId" parameterType="Long">
|
|
|
delete from dms_fault_instance_activity where instance_activity_id = #{instanceActivityId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteDmsFaultInstanceActivityByInstanceActivityIds" parameterType="String">
|
|
|
delete from dms_fault_instance_activity where instance_activity_id in
|
|
|
<foreach item="instanceActivityId" collection="array" open="(" separator="," close=")">
|
|
|
#{instanceActivityId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
<!-- 先查询出该工单审批到了第几步,然后根据步骤查询拥有权限的对象id集合 -->
|
|
|
<select id="selectUserIdByDmsFaultInstanceActivity" parameterType="Long" resultType="java.lang.Long">
|
|
|
select auth_target_id from wf_process_activity_auth where process_activity_id =(
|
|
|
select process_activity_id from wf_process_activity
|
|
|
where wf_process_id = 102
|
|
|
and process_activity_order = (1+(select max(process_step_order)
|
|
|
from dms_fault_instance_activity
|
|
|
where repair_instance_id=#{repairInstanceId})))
|
|
|
</select>
|
|
|
<select id="selectDmsFaultInstanceActivityByRepairIdMin" parameterType="Long" resultMap="DmsFaultInstanceActivityResult">
|
|
|
select * from dms_fault_instance_activity where instance_activity_id = (select min(instance_activity_id) FROM dms_fault_instance_activity where repair_instance_id = #{repairInstanceId})
|
|
|
</select>
|
|
|
</mapper>
|