houzhongjian
2024-07-23 a6de490948278991e47952e90671ddba4555e9a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?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.iailab.module.device.dao.DeviceStatNewnessDao">
 
    <select id="getLatDateList" resultType="com.iailab.module.device.dto.DeviceStatNewnessDTO">
        SELECT
            t1.*
        FROM
            t_device_stat_newness AS t1,
            (
                SELECT
                    dev_no,
                    max(date) as date
                FROM
                    t_device_stat_newness
                GROUP BY
                    dev_no
            ) AS t2
        WHERE
            t1.date = t2.date
          AND t1.dev_no = t2.dev_no
    </select>
</mapper>