| | |
| | | <result column="result_url" property="resultUrl"/> |
| | | <result column="shoot_time" property="shootTime"/> |
| | | <result column="photo_data" property="photoData"/> |
| | | <result column="location" property="location"/> |
| | | <result column="longitude" property="longitude"/> |
| | | <result column="latitude" property="latitude"/> |
| | | <result column="distribute_status" property="distributeStatus"/> |
| | | <result column="area_code" property="areaCode"/> |
| | | <result column="create_user" property="createUser"/> |
| | |
| | | <result column="distribute_dept_name" property="distributeDeptName"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="gdTaskResultExcelResultMap" type="org.sxkj.gd.workorder.excel.GdTaskResultExcel"> |
| | | <result column="patrol_task_id" property="patrolTaskId"/> |
| | | <result column="result_code" property="resultCode"/> |
| | | <result column="result_url" property="resultUrl"/> |
| | | <result column="shoot_time" property="shootTime"/> |
| | | <result column="photo_data" property="photoData"/> |
| | | <result column="longitude" property="longitude"/> |
| | | <result column="latitude" property="latitude"/> |
| | | <result column="distribute_status" property="distributeStatus"/> |
| | | <result column="area_code" property="areaCode"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectGdTaskResultPage" resultMap="gdTaskResultResultMap"> |
| | | select * from ja_gd_task_result where is_deleted = 0 |
| | | </select> |
| | | |
| | | <select id="selectGdTaskResultListByPatrolTaskId" resultMap="gdTaskResultResultMap"> |
| | | select tr.*, |
| | | SELECT tr.*, |
| | | IFNULL(bu.real_name, bu.name) as distribute_user_name, |
| | | bd.dept_name as distribute_dept_name |
| | | from ja_gd_task_result tr |
| | | left join ja_gd_clue_event ce on ce.result_id = tr.id and ce.is_deleted = 0 |
| | | left join blade_user bu on bu.id = ce.create_user and bu.is_deleted = 0 |
| | | left join blade_dept bd on bd.id = ce.create_dept and bd.is_deleted = 0 |
| | | where tr.is_deleted = 0 |
| | | and tr.patrol_task_id = #{patrolTaskId} |
| | | bd.dept_name as distribute_dept_name |
| | | FROM ja_gd_task_result tr |
| | | LEFT JOIN (SELECT * |
| | | FROM ja_gd_clue_event ce1 |
| | | WHERE ce1.is_deleted = 0 |
| | | AND ce1.create_time = (SELECT MAX(create_time) |
| | | FROM ja_gd_clue_event ce2 |
| | | WHERE ce2.result_id = ce1.result_id |
| | | AND ce2.is_deleted = 0)) ce ON ce.result_id = tr.id |
| | | LEFT JOIN blade_user bu ON bu.id = ce.create_user AND bu.is_deleted = 0 |
| | | LEFT JOIN blade_dept bd ON bd.id = ce.create_dept AND bd.is_deleted = 0 |
| | | WHERE tr.is_deleted = 0 |
| | | AND tr.patrol_task_id = #{patrolTaskId} |
| | | </select> |
| | | |
| | | |
| | | <select id="exportGdTaskResult" resultType="org.sxkj.gd.workorder.excel.GdTaskResultExcel"> |
| | | <select id="exportGdTaskResult" resultMap="gdTaskResultExcelResultMap"> |
| | | SELECT * FROM ja_gd_task_result ${ew.customSqlSegment} |
| | | </select> |
| | | |