| | |
| | | <if test="attach.resultType!=null"> |
| | | and result_type = #{attach.resultType} |
| | | </if> |
| | | <if test="attach.deptList != null and attach.deptList.size > 0"> |
| | | and ba.create_dept in |
| | | <foreach collection="attach.deptList" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId} |
| | | </foreach> |
| | | </if> |
| | | and result_type in (1,2,3,4,5) |
| | | order by create_time desc,id desc |
| | | </select> |
| | |
| | | </select> |
| | | |
| | | <select id="getAttachList" resultType="org.sxkj.resource.vo.AttachVO"> |
| | | select attach.name, attach.wayline_job_id, job.name jobName |
| | | from wayline_job job |
| | | left join blade_attach attach on attach.wayline_job_id = job.job_id |
| | | left join manage_device device on attach.device_sn = device.device_sn |
| | | <where> |
| | | select |
| | | attach.* |
| | | from |
| | | blade_attach attach |
| | | <where> |
| | | <if test="attachIds!=null and attachIds.size()>0"> |
| | | and attach.id in |
| | | <foreach item="item" index="index" collection="attachIds" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="wayLineJobIds!=null and wayLineJobIds.size()>0"> |
| | | and attach.wayline_job_id in |
| | | <foreach item="item" index="index" collection="wayLineJobIds" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="startTime!=null and startTime !='' and endTime!=null and endTime !='' "> |
| | | and DATE_FORMAT(FROM_UNIXTIME(job.execute_time/1000,'%Y-%m-%d %H:%i:%s'),'%Y-%m-%d %H:%i:%s') between |
| | | #{startTime} and #{endTime} |
| | | </if> |
| | | <if test="dockSn!=null and dockSn!=''"> |
| | | and attach.device_sn = #{dockSn} |
| | | </if> |
| | | <if test="jobName!=null and jobName!=''"> |
| | | and job.name like concat('%',#{jobName},'%') |
| | | </if> |
| | | <if test="fileName!=null and fileName!=''"> |
| | | and attach.name like concat('%',#{fileName},'%') |
| | | </if> |
| | | <if test="fileType!=null and fileType!=''"> |
| | | <choose> |
| | | <when test="fileType=='visable'"> |
| | | and attach.media_category = 0 |
| | | </when> |
| | | <when test="fileType=='ir'"> |
| | | and attach.media_category = 1 |
| | | </when> |
| | | </choose> |
| | | </if> |
| | | <!-- <if test="resultType!=null and resultType!=''"> --> |
| | | <!-- and attach.result_type = #{resultType} --> |
| | | <!-- </if> --> |
| | | <if test="resultTypes!=null and resultTypes.size()>0"> |
| | | and attach.result_type in |
| | | <foreach collection="resultTypes" item="resultType" open="(" close=")" separator=","> |
| | | #{resultType} |
| | | </foreach> |
| | | </if> |
| | | AND attach.wayline_job_id IS NOT NULL |
| | | AND job.NAME IS NOT NULL |
| | | AND attach.is_deleted = 0 |
| | | </where> |
| | | </select> |