<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper  PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"  "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.tsy.data.idsse.dsds.mapper.sample.SampleDatasetMapper">
 
  <!-- 分页查询 -->
  <select id="datasetWithPage" resultType="map">
	select file_total,d.* from sample_dataset d 
	left join (
	select dataset_id,count(1) file_total from sample_line group by dataset_id 
	union select dataset_id,count(1) file_total from sample_station group by dataset_id 
	) l
	on d.tsy_id=l.dataset_id where 1=1 
	<if test="query != null and query != ''">
      and (dataset_name like concat('%',#{query},'%')  or voyage_name like concat('%',#{query},'%') 
      	or platform_type like  concat('%',#{query},'%') or equipment_type like  concat('%',#{query},'%')
        or platform_name like concat('%',#{query},'%') or dataset_remark like concat('%',#{query},'%')) 
    </if>
    <if test="order != null and order != ''">
		ORDER BY ${order} 
	</if>
	<if test="type != null and (type == 'DESC')">
	 	DESC
	</if>
  </select>
  
  
  
</mapper>