rain
2024-04-18 3dae83e56bbdef77404be7b47d19136bb8251c8c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?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.dji.sample.log.dao.IDroneFlightLogMapper">
 
    <select id="patrolStatistics" resultType="com.dji.sample.log.model.entity.DroneFlightLogEntity">
        SELECT fl.* FROM drone_flight_log fl
        WHERE 1=1
        <if test="queryTime != null and queryTime != ''">
            and ( FROM_UNIXTIME( fl.end_time / 1000, '%Y' ) = #{queryTime} OR FROM_UNIXTIME( fl.end_time / 1000, '%Y-%m' ) =#{queryTime})
        </if>
        <if test="workspaceId != null and workspaceId != ''">
            and fl.workspace_id = #{workspaceId}
        </if>
        <if test="deviceSn !=null and deviceSn != ''" >
            and fl.device_sn = #{deviceSn}
        </if>
        ORDER BY fl.end_time DESC
    </select>
</mapper>