2021与蓝度共同重构项目,服务端
liuhaonan
2022-06-01 9c26c4f3c8ed2187fdb472280fc1d9182c327884
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
<?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.LightEnergyDataMapper">
 
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LightEnergyData">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="taskId" column="task_id" jdbcType="BIGINT"/>
        <result property="ytdTime" column="ytd_time" jdbcType="VARCHAR"/>
        <result property="energy" column="energy" jdbcType="DOUBLE"/>
        <result property="energySaving" column="energy_saving" jdbcType="DOUBLE"/>
        <result property="poleId" column="pole_id" jdbcType="BIGINT"/>
        <result property="userId" column="user_id" jdbcType="BIGINT"/>
        <result property="clientId" column="client_id" jdbcType="BIGINT"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        id
        ,task_id,ytd_time,
        energy,energy_saving,user_id,
        client_id
    </sql>
    <select id="getEnergyList" resultType="com.sandu.ximon.dao.domain.LightEnergyData">
        SELECT
        *
        FROM
        light_energy_data
        WHERE
        <if test="userId != null">
            (user_id = #{userId}
            OR client_id = #{userId})
            AND
        </if>
        ytd_time = #{format}
    </select>
</mapper>