2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-04-15 c9586d61be8ae3411c6428a2cc2588c11f97db2c
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
44
45
<?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.sandu.ximon.dao.mapper.C3mChargingMapper">
 
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.C3mCharging">
            <id property="c3Id" column="c3_id" jdbcType="BIGINT"/>
            <result property="mcuUdid" column="mcu_udid" jdbcType="VARCHAR"/>
            <result property="c3Name" column="c3_name" jdbcType="VARCHAR"/>
            <result property="c3Mac" column="c3_mac" jdbcType="VARCHAR"/>
            <result property="statusBit" column="status_bit" jdbcType="INTEGER"/>
            <result property="deviceTemperature" column="device_temperature" jdbcType="VARCHAR"/>
            <result property="poleDevicesCode" column="pole_devices_code" jdbcType="VARCHAR"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        c3_id,mcu_udid,c3_name,
        c3_mac,status_bit,device_temperature,
        pole_devices_code,update_time
    </sql>
 
    <select id="getAllByC3Mac" resultType="com.sandu.ximon.dao.domain.C3mCharging">
        select *
        from c3m_charging
        where c3_mac = #{c3Mac}
    </select>
    <select id="listC3mChargingDto" resultType="com.sandu.ximon.dao.bo.C3ChargingBo">
        SELECT t1.*, t3.pole_code,
        t3.pole_name
        FROM c3m_charging t1
        LEFT JOIN pole_binding t2 ON t1.mcu_udid = t2.device_code
        AND t2.device_type = 8
        LEFT JOIN pole t3 ON t3.id = t2.pole_id
        <where>
            <if test="keyword != null and keyword != ''">
                AND (t1.c3_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') OR (t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')))
            </if>
            <if test="userid != null">
                AND (t3.user_id = #{userid} OR t3.client_id = #{userid})
            </if>
        </where>
    </select>
</mapper>