Jelajahi Sumber

巡护轨迹

hanfucheng 4 bulan lalu
induk
melakukan
14f176bcd4

+ 8 - 5
src/main/resources/mapper/digitalwater/CenterdataTHydraulicPatrolPlanRecordMapper.xml

@@ -12,6 +12,7 @@
         <result property="taskId" column="task_id"/>
         <result property="status" column="status"/>
         <result property="type" column="type"/>
+        <result property="taskName" column="task_name"/>
     </resultMap>
 
     <sql id="selectCenterdataTHydraulicPatrolPlanRecordVo">
@@ -20,12 +21,14 @@
 
     <select id="selectCenterdataTHydraulicPatrolPlanRecordList" parameterType="CenterdataTHydraulicPatrolPlanRecord"
             resultMap="CenterdataTHydraulicPatrolPlanRecordResult">
-        <include refid="selectCenterdataTHydraulicPatrolPlanRecordVo"/>
+        select a.id, a.begin_time, a.end_time, a.user_id, a.task_id, a.status, a.type, b.task_name
+        from centerdata_t_hydraulic_patrol_plan_record a
+        left join centerdata_t_hydraulic_patrol_task b on a.task_id = b.id
         <where>
-            <if test="userId != null  and userId != ''">and user_id = #{userId}</if>
-            <if test="taskId != null  and taskId != ''">and task_id = #{taskId}</if>
-            <if test="status != null  and status != ''">and status = #{status}</if>
-            <if test="type != null  and type != ''">and type = #{type}</if>
+            <if test="userId != null  and userId != ''">and a.user_id = #{userId}</if>
+            <if test="taskId != null  and taskId != ''">and a.task_id = #{taskId}</if>
+            <if test="status != null  and status != ''">and a.status = #{status}</if>
+            <if test="type != null  and type != ''">and a.type = #{type}</if>
         </where>
     </select>