| | |
| | | |
| | | </select> |
| | | |
| | | <select id="getPageNew" resultType="com.dji.sample.wayline.model.entity.WaylineJobEntity"> |
| | | |
| | | SELECT job.*, |
| | | ( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM wayline_job WHERE parent_id = job.id ) AS hasChildren |
| | | FROM wayline_job job |
| | | LEFT JOIN wayline_file file ON job.file_id = file.wayline_id |
| | | WHERE job.workspace_id = #{workspaceId} |
| | | <if test="queryParam.taskType != null and queryParam.taskType!= '' or queryParam.taskType==0 "> |
| | | AND job.task_type = #{queryParam.taskType} |
| | | </if> |
| | | |
| | | <if test="queryParam.name != null and queryParam.name != '' "> |
| | | AND ( (job.name LIKE CONCAT('%',#{queryParam.name},'%'))or(file.name LIKE CONCAT('%',#{queryParam.name},'%')) ) |
| | | </if> |
| | | |
| | | <if test="queryParam.status != null and queryParam.status !='' "> |
| | | AND job.status in |
| | | <foreach collection="queryParam.status.split(',')" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="queryParam.startTime !=null and queryParam.endTime !=null"> |
| | | AND DATE_FORMAT(FROM_UNIXTIME(job.begin_time/1000,'%Y-%m-%d'),'%Y-%m-%d') >= DATE_FORMAT(#{queryParam.startTime},'%Y-%m-%d') |
| | | </if> |
| | | |
| | | <if test="queryParam.endTime !=null and queryParam.endTime !=null"> |
| | | AND DATE_FORMAT(FROM_UNIXTIME(job.end_time/1000,'%Y-%m-%d'),'%Y-%m-%d') <= DATE_FORMAT(#{queryParam.endTime},'%Y-%m-%d') |
| | | </if> |
| | | |
| | | <if test="queryParam.dockSn != null and queryParam.dockSn != '' "> |
| | | AND job.dock_sn in |
| | | <foreach collection="queryParam.dockSn.split(',')" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="order != null and order != '' and order == 'DESC'"> |
| | | ORDER BY job.create_time DESC |
| | | </if> |
| | | <if test="order != null and order != '' and order == 'ASC'"> |
| | | ORDER BY job.create_time ASC |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="getLatest" resultType="com.dji.sample.wayline.model.entity.WaylineJobEntity"> |
| | | SELECT job.* FROM wayline_job job |
| | | WHERE job.workspace_id = #{workspaceId} |