xuhy
昨天 71d23d994445025d9eaf18c86bbdcf82f632bf83
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?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.ruoyi.chargingPile.mapper.TFaultMessageMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.TFaultMessage">
        <id column="id" property="id" />
        <result column="app_user_id" property="appUserId" />
        <result column="site_id" property="siteId" />
        <result column="charging_pile_id" property="chargingPileId" />
        <result column="charging_gun_id" property="chargingGunId" />
        <result column="status" property="status" />
        <result column="down_time" property="downTime" />
        <result column="end_time" property="endTime" />
        <result column="create_time" property="createTime" />
        <result column="del_flag" property="delFlag" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, app_user_id, site_id, charging_pile_id, status, down_time, create_time, del_flag,charging_gun_id,end_time
    </sql>
 
    
    
    <select id="getFaultMessageList" resultType="com.ruoyi.chargingPile.api.model.TFaultMessage">
        select
        a.*,
        b.name as chargingPileName,
        c.name as siteName
        from t_fault_message a
        left join t_charging_pile b on (a.charging_pile_id = b.id)
        left join t_site c on (a.site_id = c.id)
        where a.del_flag = 0
        <if test="null != siteIds and siteIds.size() > 0">
            and a.site_id in
            <foreach collection="siteIds" item="item" index="index" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        order by a.create_time desc
    </select>
</mapper>