| | |
| | | ba_user.`name` AS inspectorName, |
| | | oi.id AS inspectId, |
| | | oi.start_time AS startTime, |
| | | oi.stop_time AS stopTime |
| | | oi.stop_time AS stopTime, |
| | | oi.inspect_distance AS inspectDistance |
| | | FROM `ope_inspect` oi |
| | | INNER JOIN `ba_user` ON oi.inspector_id = ba_user.id |
| | | <where> |
| | |
| | | SET inspect_distance = #{distance} |
| | | WHERE id = #{inspectId} |
| | | </update> |
| | | |
| | | <!--根据巡检员ID获取巡检记录数量--> |
| | | <select id="getInstectsCountByInspectorId" resultType="java.lang.Long"> |
| | | SELECT |
| | | count(*) |
| | | FROM ope_inspect ins |
| | | LEFT JOIN ba_user user ON user.id = ins.inspector_id |
| | | WHERE ins.inspector_id = #{inspectorId} |
| | | </select> |
| | | |
| | | <!--根据巡检员ID获取巡检列表--> |
| | | <select id="getInstectsByInspectorId" resultType="com.dy.pipIrrGlobal.voOp.VoInspect"> |
| | | SELECT |
| | | user.id AS inspectorId, |
| | | user.name AS inspectorName, |
| | | ins.id AS inspectId, |
| | | ins.start_time AS startTime, |
| | | ins.stop_time AS stopTime, |
| | | ins.inspect_distance AS inspectDistance |
| | | FROM ope_inspect ins |
| | | LEFT JOIN ba_user user ON user.id = ins.inspector_id |
| | | WHERE ins.inspector_id = #{inspectorId} |
| | | ORDER BY ins.start_time DESC |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | </mapper> |