| | |
| | | AND r.task_id = #{taskId} |
| | | </select> |
| | | <select id="getByTaskIdAndGroupId" resultMap="selectPatrolRecordList"> |
| | | SELECT c.group_id groupId,r.id,r.patrol_type,r.device_ids,r.images,r.videos,r.content,r.status,r.item_id,r.task_id,r.create_user,r.create_dept,r.solution, |
| | | C.items_name itemsName,C.description FROM SM_PATROL_RECORD r |
| | | SELECT |
| | | c.group_id AS groupId, |
| | | r.id, |
| | | r.patrol_type, |
| | | r.device_ids, |
| | | r.images, |
| | | r.videos, |
| | | r.content, |
| | | r.status, |
| | | r.item_id, |
| | | r.task_id, |
| | | r.create_user, |
| | | r.create_dept, |
| | | r.solution, |
| | | C.items_name AS itemsName, |
| | | C.description |
| | | FROM SM_PATROL_RECORD r |
| | | RIGHT JOIN ( |
| | | SELECT B.ID,B.GROUP_ID,B.ITEMS_NAME,B.DESCRIPTION |
| | | FROM SM_PATROL_GROUP A |
| | |
| | | </if> |
| | | ORDER BY B.GROUP_ID |
| | | )C ON C.ID = r.ITEM_ID |
| | | WHERE TASK_ID = #{taskId} |
| | | WHERE TASK_ID = #{taskId} AND r.state = 0 |
| | | </select> |
| | | |
| | | <resultMap id="patrolGroupDTO" type="cn.gistack.sm.patrol.dto.PatrolGroupDTO"> |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="gname"/> |
| | | <collection property="patrolRecordVOList" javaType="java.util.List" ofType="cn.gistack.sm.patrol.vo.PatrolRecordVO"> |
| | | <result property="id" column="rId"/> |
| | | <result property="videos" column="videos" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> |
| | | <result property="images" column="images" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> |
| | | <result property="status" column="status"/> |
| | | <result property="isDeleted" column="isDeleted"/> |
| | | <result property="itemId" column="itemId"/> |
| | | <result property="itemsName" column="itemsName"/> |
| | | <result property="taskId" column="taskId"/> |
| | | <result property="solution" column="solution"/> |
| | | <result property="content" column="content"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <select id="getHistoryRecord" resultMap="patrolGroupDTO"> |
| | | |
| | | SELECT G.ID, |
| | | G.NAME AS gname, |
| | | R.ID AS rId, |
| | | R.VIDEOS, |
| | | R.IMAGES, |
| | | R.STATUS, |
| | | R.IS_DELETED, |
| | | R.ITEM_ID AS itemId, |
| | | I.ITEMS_NAME AS itemsName, |
| | | R.TASK_ID AS taskId , |
| | | R.SOLUTION, |
| | | R.CONTENT |
| | | FROM SM_PATROL_GROUP G |
| | | LEFT JOIN SM_PATROL_GROUP_ITEM I ON I.GROUP_ID = G.ID |
| | | LEFT JOIN SM_PATROL_RECORD R ON R.ITEM_ID = I.ID |
| | | WHERE G.IS_DELETED = 0 |
| | | <if test="vo.flowTaskId != null and vo.flowTaskId !='' "> |
| | | AND R.FLOW_TASK_ID = #{vo.flowTaskId} |
| | | </if> |
| | | <if test="vo.taskId !=null and vo.taskId !='' "> |
| | | AND R.TASK_ID = #{vo.taskId} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |