You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

69 lines
3.1 KiB

<?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.inspect.insreporttask.mapper.InspectionReportTaskMapper">
<resultMap type="com.inspect.insreport.domain.InspectionReport" id="InspectionReportResult">
<result property="lineId" column="line_id"/>
<result property="stationName" column="station_name"/>
<result property="voltLevel" column="volt_level"/>
<result property="stationType" column="station_type"/>
<result property="inspectionDate" column="inspection_date"/>
<result property="inspectionTaskName" column="inspection_task_name"/>
<result property="envInfo" column="env_info"/>
<result property="inspectionStartTime" column="inspection_start_time"/>
<result property="inspectionEndTime" column="inspection_end_time"/>
<result property="patrolStatistics" column="patrol_statistics"/>
<result property="checkPerson" column="check_person"/>
<result property="checkTime" column="check_time"/>
<result property="description" column="description"/>
<result property="taskId" column="task_id"/>
<result property="taskPatrolledId" column="task_patrolled_id"/>
<result property="taskResultId" column="task_result_id"/>
<result property="filePath" column="file_path"/>
<result property="filter" column="filter"/>
<result property="location" column="location"/>
</resultMap>
<insert id="batchInsertInspectionReportTask" parameterType="java.util.List">
insert into inspection_report_task
(report_line_id, task_result_line_id, task_patrolled_id, task_name)
values
<foreach collection="list" item="t" index="index" separator=",">
(#{t.reportLineId}, #{t.taskResultLineId}, #{t.taskPatrolledId}, #{t.taskName})
</foreach>
</insert>
<select id="selectInspectionReportsByTaskPatrolledId" resultMap="InspectionReportResult">
select r.line_id,
r.task_id,
r.task_patrolled_id,
r.file_path,
r.task_result_id,
r.station_name,
r.volt_level,
r.station_type,
r.location,
r.inspection_date,
r.inspection_task_name,
r.env_info,
r.inspection_start_time,
r.inspection_end_time,
r.patrol_statistics,
r.check_person,
r.check_time,
r.description,
r.filter
from inspection_report_task t
join inspection_report r on r.line_id = t.report_line_id
where t.task_patrolled_id = #{taskPatrolledId}
<if test="filter != null and filter != ''">and r.filter = #{filter}</if>
order by r.line_id desc
</select>
<select id="selectTaskPatrolledIdsByReportLineId" resultType="java.lang.String">
select task_patrolled_id from inspection_report_task
where report_line_id = #{reportLineId} order by id
</select>
</mapper>