|  |  | 
 |  |  |       deleted = #{deleted,jdbcType=BIGINT} | 
 |  |  |     where id = #{id,jdbcType=BIGINT} | 
 |  |  |   </update> | 
 |  |  |  | 
 |  |  |   <!--根据工单ID获取未删除的工单对象--> | 
 |  |  |   <select id="getByWorkOrderId" resultType="com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult"> | 
 |  |  |     SELECT * FROM ope_processing_result WHERE deleted = 0 AND work_order_id = #{workOrderId} LIMIT 1 | 
 |  |  |   </select> | 
 |  |  |  | 
 |  |  |   <!--获取指定巡检员的指定未删除且未审批的处理结果上报,删除处理结果前判断使用使用--> | 
 |  |  |   <select id="getProResult" resultType="com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult"> | 
 |  |  |     SELECT * FROM ope_processing_result | 
 |  |  |     WHERE deleted = 0 AND state = 1 AND id = #{proResultId} AND inspector_id = #{inspectorId} LIMIT 1 | 
 |  |  |   </select> | 
 |  |  |  | 
 |  |  |   <!--逻辑删除一个未删除的处理结果记录--> | 
 |  |  |   <update id="deleteProResult"> | 
 |  |  |     UPDATE ope_processing_result SET deleted = UNIX_TIMESTAMP() WHERE deleted = 0 AND id = #{proResultId} | 
 |  |  |   </update> | 
 |  |  |  | 
 |  |  |   <!--根据主键获取处理结果视图对象--> | 
 |  |  |   <select id="getProResultById" resultType="com.dy.pipIrrGlobal.voOp.VoProcessingResult_temp"> | 
 |  |  |     SELECT | 
 |  |  |         res.id AS proResultId, | 
 |  |  |         res.work_order_id AS workOrderId, | 
 |  |  |         us.name AS inspector, | 
 |  |  |         res.content, | 
 |  |  |         res.images, | 
 |  |  |         res.audios, | 
 |  |  |         res.videos, | 
 |  |  |         res.lng, | 
 |  |  |         res.lat, | 
 |  |  |         res.complete_time AS completeTime, | 
 |  |  |         res.report_time AS reportTime, | 
 |  |  |         res.state, | 
 |  |  |         CASE | 
 |  |  |             WHEN res.state = 1 THEN '待审核' | 
 |  |  |             WHEN res.state = 2 THEN '已通过' | 
 |  |  |             WHEN res.state = 3 THEN '已驳回' | 
 |  |  |         END AS stateName | 
 |  |  |     FROM ope_processing_result res | 
 |  |  |         INNER JOIN ba_user us ON us.id = res.inspector_id | 
 |  |  |     WHERE res.deleted = 0 AND res.id = #{proResultId} | 
 |  |  |   </select> | 
 |  |  | </mapper> |