<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.tofly.base.mapper.DataBackMapper">

  <resultMap id="dataBackMap" type="com.tofly.base.entity.DataBack">
       <id property="id" column="ID"/>
       <result property="backType" column="BACK_TYPE"/>
       <result property="operateType" column="OPERATE_TYPE"/>
       <result property="backDataName" column="BACK_DATA_NAME"/>
       <result property="backDataLength" column="BACK_DATA_LENGTH"/>
       <result property="createTime" column="CREATE_TIME"/>
       <result property="createUser" column="CREATE_USER"/>
       <result property="backDataPath" column="BACK_DATA_PATH"/>
   </resultMap>
   
   
   <select id="getDataBackPage" resultType="map" >
         select * from tf_smpn_databack_x db         
          where 1=1
    <if test="dataBack.backDataName != null and dataBack.backDataName.trim() != ''">
        and db.BACK_DATA_NAME like concat('%', #{dataBack.backDataName}, '%') 
    </if>
    <if test="dataBack.startTime != null and dataBack.startTime.trim() != ''">
        and date_format(db.CREATE_TIME,'%Y-%m-%d') >= #{dataBack.startTime}
    </if>
    <if test="dataBack.endTime != null and dataBack.endTime.trim() != ''">
     <![CDATA[  and date_format(db.CREATE_TIME,'%Y-%m-%d') <= #{dataBack.endTime}   ]]>
    </if>
    </select>
   
   
</mapper>
